]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mmc: sdhci: switch voltage before sdhci_set_ios in runtime resume
authorJisheng Zhang <jszhang@marvell.com>
Thu, 29 Jan 2015 09:42:12 +0000 (17:42 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 29 Jan 2015 10:28:06 +0000 (11:28 +0100)
I observed the Host Control2 register isn't correctly restored
after runtime resuming on BG2Q. For example, the register reads
as 0x800c before runtime suspend, but it's set as 0x8004 after runtime
resuming. This could results in a non working host.

The reason is the Host Control2 is incorrectly reset when switching
voltage. We fix this by following the same sequence during initialization.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index c9881ca131d5ba7c7d653915a19df12326af6a1f..0ad412a4876fae403a1a2cdd1a75e7761c809fac 100644 (file)
@@ -2871,9 +2871,9 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
        /* Force clock and power re-program */
        host->pwr = 0;
        host->clock = 0;
+       sdhci_do_start_signal_voltage_switch(host, &host->mmc->ios);
        sdhci_do_set_ios(host, &host->mmc->ios);
 
-       sdhci_do_start_signal_voltage_switch(host, &host->mmc->ios);
        if ((host_flags & SDHCI_PV_ENABLED) &&
                !(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN)) {
                spin_lock_irqsave(&host->lock, flags);