summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2017-09-21 04:58:53 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-09-25 07:25:53 (GMT)
commit00f59bc13130eda8f0c3ac56de95209826a89a83 (patch)
tree1f58dc0aa7c80549a00b8873ee792a5bc8e0fefe /drivers/mmc
parent540acefa2f374f3500c8ab1aba2f75e048e752b8 (diff)
downloadlinux-00f59bc13130eda8f0c3ac56de95209826a89a83.tar.xz
mmc: sdhci-of-esdhc: disable SD clock for clock value 0
SD clock should be disabled for clock value 0. It's not right to just return. This may cause failure of signal voltage switching. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-of-esdhc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index cd85a18..4b0f375 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -36,6 +36,8 @@ struct sdhci_esdhc {
unsigned int peripheral_clock;
};
+static void esdhc_clock_enable(struct sdhci_host *host, bool enable);
+
/**
* esdhc_read*_fixup - Fixup the value read from incompatible eSDHC register
* to make it compatible with SD spec.
@@ -469,8 +471,10 @@ static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock)
host->mmc->actual_clock = 0;
- if (clock == 0)
+ if (clock == 0) {
+ esdhc_clock_enable(host, false);
return;
+ }
/* Workaround to start pre_div at 2 for VNN < VENDOR_V_23 */
if (esdhc->vendor_ver < VENDOR_V_23)