mmc: core: power-cycle sd card on error

Hardware reset is not implemented in SD card. To circumvent this,
a power-cycle is issued to the card & it is reinitialized.
This would help recovering from 'card stuck in programming state'
situations.

mmc_can_reset:	Added check for SD card.

CRs-fixed: 375869
Change-Id: I8bd7dc071f3569898371d5becca06ec2fe937d4a
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
This commit is contained in:
Asutosh Das 2012-07-16 16:15:03 +05:30 committed by Stephen Boyd
parent 347109c92e
commit 78b8d647af
1 changed files with 8 additions and 4 deletions

View File

@ -2165,11 +2165,15 @@ int mmc_can_reset(struct mmc_card *card)
{
u8 rst_n_function;
if (!mmc_card_mmc(card))
return 0;
rst_n_function = card->ext_csd.rst_n_function;
if ((rst_n_function & EXT_CSD_RST_N_EN_MASK) != EXT_CSD_RST_N_ENABLED)
if (mmc_card_sdio(card))
return 0;
if (mmc_card_mmc(card)) {
rst_n_function = card->ext_csd.rst_n_function;
if ((rst_n_function & EXT_CSD_RST_N_EN_MASK) !=
EXT_CSD_RST_N_ENABLED)
return 0;
}
return 1;
}
EXPORT_SYMBOL(mmc_can_reset);