aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@stericsson.com>2011-03-05 08:36:24 -0500
committerChris Ball <cjb@laptop.org>2011-03-17 15:35:13 -0400
commitb33d46c398fd071dccd0815f33620924684860cd (patch)
tree1b83b93235a825fee112865d0627b069d4d5348a
parentab1efd271704416c9e6e9cb4e5f58e7e4c4260e6 (diff)
mmc: core: reset card voltage after power off
At power off, reset OCR mask to be the highest possible voltage supported for the current mmc host. This solves the re-initialization during the power up sequence. The voltage may have been decreased due to the card accepts a lower voltage than the voltage used during the initialization sequence. We need to reset the voltage to by the host highest possible value since according to specification the initialization must always be done at high voltage. Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com> Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/core/core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 4956da133be4..1f453acc8682 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1009,6 +1009,13 @@ static void mmc_power_off(struct mmc_host *host)
1009{ 1009{
1010 host->ios.clock = 0; 1010 host->ios.clock = 0;
1011 host->ios.vdd = 0; 1011 host->ios.vdd = 0;
1012
1013 /*
1014 * Reset ocr mask to be the highest possible voltage supported for
1015 * this mmc host. This value will be used at next power up.
1016 */
1017 host->ocr = 1 << (fls(host->ocr_avail) - 1);
1018
1012 if (!mmc_host_is_spi(host)) { 1019 if (!mmc_host_is_spi(host)) {
1013 host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; 1020 host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
1014 host->ios.chip_select = MMC_CS_DONTCARE; 1021 host->ios.chip_select = MMC_CS_DONTCARE;