Skip to content

Commit

Permalink
mmc: core: put eMMC in sleep (cmd5) 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
to minimize power consumption.

Signed-off-by: Balaji T K <[email protected]>
Acked-by: Venkatraman S <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
Signed-off-by: Subhash Jadavani <[email protected]>
(cherry picked from commit 3765839)

Change-Id: I0c0d5d06c4204b15471d1ca95aec0c7fcaaae816
Signed-off-by: Shruthi Krishna <[email protected]>
  • Loading branch information
balajitk authored and turl committed Nov 5, 2011
1 parent a8d7439 commit d4e3577
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,16 +589,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 d4e3577

Please sign in to comment.