diff options
author | Ulf Hansson <ulf.hansson@stericsson.com> | 2017-03-07 08:31:54 +0100 |
---|---|---|
committer | Bertolin, PierreX <pierrex.bertolin@intel.com> | 2017-03-14 01:54:36 -0700 |
commit | 5b1362041534f5555ac51e64b234f542a7d9dc9f (patch) | |
tree | 37bb1d6aa25f874a1fe087702f65dc76c839a0ef | |
parent | 3a67257ded429c4ef1b9afc787d2e2314bff598a (diff) | |
download | x86-5b1362041534f5555ac51e64b234f542a7d9dc9f.tar.gz |
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.
Change-Id: I4fd19a2b5d0271064fad36879ba71a5709ad046c
Tracked-On: https://jira01.devtools.intel.com/browse/AW-4233
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>
Reviewed-on: https://android.intel.com/571805
Reviewed-by: Dubray, SimonX <simonx.dubray@intel.com>
Tested-by: Zaghdoud, WalidX <walidx.zaghdoud@intel.com>
Reviewed-by: Zaghdoud, WalidX <walidx.zaghdoud@intel.com>
Reviewed-by: Nassiet, GaelleX <gaellex.nassiet@intel.com>
Reviewed-by: Louis, FabienX <fabienx.louis@intel.com>
Reviewed-by: Tasayco Loarte, VictorX <victorx.tasayco.loarte@intel.com>
-rw-r--r-- | drivers/mmc/core/core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 0510596e9809..e059ff616a01 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1799,6 +1799,12 @@ void mmc_power_off(struct mmc_host *host) /* Set initial state and call mmc_set_ios */ mmc_set_initial_state(host); host->ios.signal_voltage = 3; + /* + * Reset ocr mask to be the highest possible voltage supported for + * this mmc host. This value will be used at next power up. + */ + host->ocr = 1 << (fls(host->ocr_avail) - 1); + if (!mmc_host_is_spi(host)) { host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; } |