summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2011-09-08 22:08:39 +0530
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-27 16:07:55 +0200
commit49f9b3db2a7f8da006949b256c7a9419671184bb (patch)
tree1663ffd905e44513e99f5edb97868d94425c5505
parent4723eb54f478794401792dad5046ae807e36f82a (diff)
mmc: core: Put eMMC in Sleep mode before suspend
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> Change-Id: I910a07fce263626e37421920c08e454412d8fb67 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33432 Reviewed-by: Ulf HANSSON <ulf.hansson@stericsson.com> Tested-by: Ulf HANSSON <ulf.hansson@stericsson.com>
-rw-r--r--drivers/mmc/core/mmc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index e746b672246..b74e6f14b3a 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -557,6 +557,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);
@@ -905,16 +906,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;
}
/*