aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-06-10 11:03:43 -0400
committerChris Ball <cjb@laptop.org>2013-06-27 12:39:19 -0400
commit03d071fc8de4ad9b6e7374720ae81b7e928f6075 (patch)
tree959ae3f9c890a50722f853d1f58f824b8ffdabf3 /drivers
parent5992e78697484d8f58b749f87a06f89f4ba40a47 (diff)
mmc: core: Handle both poweroff notification types for eMMC
Depending on the context of the operation while powering down the card, either POWER_OFF_NOTIFY_SHORT or POWER_OFF_NOTIFY_LONG will be used. In suspend context a short timeout is preferred while a long timeout would be acceptable in a shutdown/hibernation context. We add a new parameter to the mmc_suspend function so we can provide an indication of what notification type to use. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/core/mmc.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index c8c7135c84b0..ab34a39486ae 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1464,12 +1464,11 @@ static void mmc_detect(struct mmc_host *host)
1464 } 1464 }
1465} 1465}
1466 1466
1467/* 1467static int _mmc_suspend(struct mmc_host *host, bool is_suspend)
1468 * Suspend callback from host.
1469 */
1470static int mmc_suspend(struct mmc_host *host)
1471{ 1468{
1472 int err = 0; 1469 int err = 0;
1470 unsigned int notify_type = is_suspend ? EXT_CSD_POWER_OFF_SHORT :
1471 EXT_CSD_POWER_OFF_LONG;
1473 1472
1474 BUG_ON(!host); 1473 BUG_ON(!host);
1475 BUG_ON(!host->card); 1474 BUG_ON(!host->card);
@@ -1487,7 +1486,7 @@ static int mmc_suspend(struct mmc_host *host)
1487 goto out; 1486 goto out;
1488 1487
1489 if (mmc_can_poweroff_notify(host->card)) 1488 if (mmc_can_poweroff_notify(host->card))
1490 err = mmc_poweroff_notify(host->card, EXT_CSD_POWER_OFF_SHORT); 1489 err = mmc_poweroff_notify(host->card, notify_type);
1491 else if (mmc_can_sleep(host->card)) 1490 else if (mmc_can_sleep(host->card))
1492 err = mmc_sleep(host); 1491 err = mmc_sleep(host);
1493 else if (!mmc_host_is_spi(host)) 1492 else if (!mmc_host_is_spi(host))
@@ -1502,6 +1501,14 @@ out:
1502} 1501}
1503 1502
1504/* 1503/*
1504 * Suspend callback from host.
1505 */
1506static int mmc_suspend(struct mmc_host *host)
1507{
1508 return _mmc_suspend(host, true);
1509}
1510
1511/*
1505 * Resume callback from host. 1512 * Resume callback from host.
1506 * 1513 *
1507 * This function tries to determine if the same card is still present 1514 * This function tries to determine if the same card is still present