|
@@ -553,6 +553,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
|
|
|
* need to tell some cards to go back to the idle
|
|
|
* state. We wait 1ms to give cards time to
|
|
|
* respond.
|
|
|
+ * mmc_go_idle is needed for eMMC that are asleep
|
|
|
*/
|
|
|
mmc_go_idle(host);
|
|
|
|
|
@@ -900,16 +901,20 @@ static void mmc_detect(struct mmc_host *host)
|
|
|
*/
|
|
|
static int mmc_suspend(struct mmc_host *host)
|
|
|
{
|
|
|
+ int err = 0;
|
|
|
+
|
|
|
BUG_ON(!host);
|
|
|
BUG_ON(!host->card);
|
|
|
|
|
|
mmc_claim_host(host);
|
|
|
- if (!mmc_host_is_spi(host))
|
|
|
+ if (mmc_card_can_sleep(host))
|
|
|
+ err = mmc_card_sleep(host);
|
|
|
+ else if (!mmc_host_is_spi(host))
|
|
|
mmc_deselect_cards(host);
|
|
|
host->card->state &= ~MMC_STATE_HIGHSPEED;
|
|
|
mmc_release_host(host);
|
|
|
|
|
|
- return 0;
|
|
|
+ return err;
|
|
|
}
|
|
|
|
|
|
/*
|