On 06/28/2012 12:15 AM, [email protected] wrote:
From: Philip Rakity<[email protected]>

Power needs to be removed from the card when switching to 1.8v fails.

If a regulator is used to control vmmc we need to turn the
regulator off and then back on otherwise power will not be removed
from the card.

Reviewed-by: Aaron Lu <[email protected]>

-Aaron


Signed-off-by: Philip Rakity<[email protected]>
---
  drivers/mmc/host/sdhci.c |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index f4b8b4d..ef4231a 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1663,11 +1663,15 @@ static int sdhci_do_start_signal_voltage_switch(struct 
sdhci_host *host,
                pwr = sdhci_readb(host, SDHCI_POWER_CONTROL);
                pwr&= ~SDHCI_POWER_ON;
                sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL);
+               if (host->vmmc)
+                       regulator_disable(host->vmmc);

                /* Wait for 1ms as per the spec */
                usleep_range(1000, 1500);
                pwr |= SDHCI_POWER_ON;
                sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL);
+               if (host->vmmc)
+                       regulator_enable(host->vmmc);

                pr_info(DRIVER_NAME ": Switching to 1.8V signalling "
                        "voltage failed, retrying with S18R set to 0\n");


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to