diff options
author | Philip Rakity <prakity@marvell.com> | 2012-06-27 12:15:00 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-07-22 15:25:51 -0400 |
commit | 38cfc2f71cec9508bdd3a11e576738c2182418d0 (patch) | |
tree | 6ab1b3e57109327035547711136b568fae061b4b /drivers/mmc/host/sdhci.c | |
parent | 8a4de07e05e7bedc894c2de3b3b04673d6d840ec (diff) |
mmc: sdhci: When a UHS switch fails, cycle power if regulator is used
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.
Signed-off-by: Philip Rakity <prakity@marvell.com>
Reviewed-by: Aaron Lu <aaron.lu@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | 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 bc1de70360c8..d9966568143b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1682,11 +1682,15 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, | |||
1682 | pwr = sdhci_readb(host, SDHCI_POWER_CONTROL); | 1682 | pwr = sdhci_readb(host, SDHCI_POWER_CONTROL); |
1683 | pwr &= ~SDHCI_POWER_ON; | 1683 | pwr &= ~SDHCI_POWER_ON; |
1684 | sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL); | 1684 | sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL); |
1685 | if (host->vmmc) | ||
1686 | regulator_disable(host->vmmc); | ||
1685 | 1687 | ||
1686 | /* Wait for 1ms as per the spec */ | 1688 | /* Wait for 1ms as per the spec */ |
1687 | usleep_range(1000, 1500); | 1689 | usleep_range(1000, 1500); |
1688 | pwr |= SDHCI_POWER_ON; | 1690 | pwr |= SDHCI_POWER_ON; |
1689 | sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL); | 1691 | sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL); |
1692 | if (host->vmmc) | ||
1693 | regulator_enable(host->vmmc); | ||
1690 | 1694 | ||
1691 | pr_info(DRIVER_NAME ": Switching to 1.8V signalling " | 1695 | pr_info(DRIVER_NAME ": Switching to 1.8V signalling " |
1692 | "voltage failed, retrying with S18R set to 0\n"); | 1696 | "voltage failed, retrying with S18R set to 0\n"); |