Skip to content

Commit

Permalink
mmc: core: Put eMMC in Sleep mode before suspend
Browse files Browse the repository at this point in the history
Put MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend
so that Vcc (NAND core) can be cut to minimize power consumption.
eMMC put into SLEEP can respond to CMD0 or H/W reset or CMD5.
Current implemention on resume from suspend relies on CMD0 in
mmc_init_card to get out of SLEEP mode.

Signed-off-by: Balaji T K <balajitk@ti.com>
Acked-by: Venkatraman S <svenkatr@ti.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Balaji T K authored and Chris Ball committed Oct 26, 2011
1 parent 6fe4717 commit c380546
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit c380546

Please sign in to comment.