diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-06-10 17:03:43 +0200 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-06-27 12:39:19 -0400 |
commit | 03d071fc8de4ad9b6e7374720ae81b7e928f6075 (patch) | |
tree | 959ae3f9c890a50722f853d1f58f824b8ffdabf3 /drivers/mmc | |
parent | 5992e78697484d8f58b749f87a06f89f4ba40a47 (diff) | |
download | linux-03d071fc8de4ad9b6e7374720ae81b7e928f6075.tar.gz linux-03d071fc8de4ad9b6e7374720ae81b7e928f6075.tar.bz2 linux-03d071fc8de4ad9b6e7374720ae81b7e928f6075.zip |
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/mmc')
-rw-r--r-- | drivers/mmc/core/mmc.c | 17 |
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) } } -/* - * Suspend callback from host. - */ -static int mmc_suspend(struct mmc_host *host) +static int _mmc_suspend(struct mmc_host *host, bool is_suspend) { int err = 0; + unsigned int notify_type = is_suspend ? EXT_CSD_POWER_OFF_SHORT : + EXT_CSD_POWER_OFF_LONG; BUG_ON(!host); BUG_ON(!host->card); @@ -1487,7 +1486,7 @@ static int mmc_suspend(struct mmc_host *host) goto out; if (mmc_can_poweroff_notify(host->card)) - err = mmc_poweroff_notify(host->card, EXT_CSD_POWER_OFF_SHORT); + err = mmc_poweroff_notify(host->card, notify_type); else if (mmc_can_sleep(host->card)) err = mmc_sleep(host); else if (!mmc_host_is_spi(host)) @@ -1502,6 +1501,14 @@ out: } /* + * Suspend callback from host. + */ +static int mmc_suspend(struct mmc_host *host) +{ + return _mmc_suspend(host, true); +} + +/* * Resume callback from host. * * This function tries to determine if the same card is still present |