Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78b8d647 authored by Asutosh Das's avatar Asutosh Das Committed by Stephen Boyd
Browse files

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: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 347109c9
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -2165,11 +2165,15 @@ int mmc_can_reset(struct mmc_card *card)
{
	u8 rst_n_function;

	if (!mmc_card_mmc(card))
	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)
		if ((rst_n_function & EXT_CSD_RST_N_EN_MASK) !=
		    EXT_CSD_RST_N_ENABLED)
			return 0;
	}
	return 1;
}
EXPORT_SYMBOL(mmc_can_reset);