提交 38cfc2f7 编写于 作者: P Philip Rakity 提交者: Chris Ball

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: NPhilip Rakity <prakity@marvell.com>
Reviewed-by: NAaron Lu <aaron.lu@amd.com>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 8a4de07e
...@@ -1682,11 +1682,15 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, ...@@ -1682,11 +1682,15 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
pwr = sdhci_readb(host, SDHCI_POWER_CONTROL); pwr = sdhci_readb(host, SDHCI_POWER_CONTROL);
pwr &= ~SDHCI_POWER_ON; pwr &= ~SDHCI_POWER_ON;
sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL); sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL);
if (host->vmmc)
regulator_disable(host->vmmc);
/* Wait for 1ms as per the spec */ /* Wait for 1ms as per the spec */
usleep_range(1000, 1500); usleep_range(1000, 1500);
pwr |= SDHCI_POWER_ON; pwr |= SDHCI_POWER_ON;
sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL); sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL);
if (host->vmmc)
regulator_enable(host->vmmc);
pr_info(DRIVER_NAME ": Switching to 1.8V signalling " pr_info(DRIVER_NAME ": Switching to 1.8V signalling "
"voltage failed, retrying with S18R set to 0\n"); "voltage failed, retrying with S18R set to 0\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册