rsi: fix sdio card reset problem

card reset is not working with recent kernels. Using
host->card->ocr instead of host->ocr_avail solved the problem.

Signed-off-by: Karun Eagalapati <karun256@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Karun Eagalapati 2017-07-06 20:07:06 +05:30 committed by Kalle Valo
parent 09cfb41f35
commit f95bbd979d
1 changed files with 9 additions and 17 deletions

View File

@ -219,26 +219,18 @@ static void rsi_reset_card(struct sdio_func *pfunction)
if (err)
rsi_dbg(ERR_ZONE, "%s: CMD0 failed : %d\n", __func__, err);
if (!host->ocr_avail) {
/* Issue CMD5, arg = 0 */
err = rsi_issue_sdiocommand(pfunction,
SD_IO_SEND_OP_COND,
0,
(MMC_RSP_R4 | MMC_CMD_BCR),
&resp);
if (err)
rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n",
__func__, err);
host->ocr_avail = resp;
}
/* Issue CMD5, arg = 0 */
err = rsi_issue_sdiocommand(pfunction, SD_IO_SEND_OP_COND, 0,
(MMC_RSP_R4 | MMC_CMD_BCR), &resp);
if (err)
rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n", __func__, err);
card->ocr = resp;
/* Issue CMD5, arg = ocr. Wait till card is ready */
for (i = 0; i < 100; i++) {
err = rsi_issue_sdiocommand(pfunction,
SD_IO_SEND_OP_COND,
host->ocr_avail,
(MMC_RSP_R4 | MMC_CMD_BCR),
&resp);
err = rsi_issue_sdiocommand(pfunction, SD_IO_SEND_OP_COND,
card->ocr,
(MMC_RSP_R4 | MMC_CMD_BCR), &resp);
if (err) {
rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n",
__func__, err);