summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
authorSuneel Garapati <suneel.garapati@xilinx.com>2015-06-09 10:31:50 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2015-08-17 12:32:41 +0300
commitd1955c3a9a1d89c53c9e7ce3b87799f8db1855c1 (patch)
treeb599c2a9e9ccfdd317c3bcc31879648bf5368602 /drivers/mmc/host/sdhci.c
parent6464b71409511939efce1ae4fb4ec6e3483b11b2 (diff)
downloadlinux-d1955c3a9a1d89c53c9e7ce3b87799f8db1855c1.tar.xz
mmc: sdhci: add quirk SDHCI_QUIRK_CLOCK_DIV_ZERO_BROKEN
adds quirk for controllers whose clock divider zero is broken, sdhci_set_clock function will incorporate this modification. Signed-off-by: Suneel Garapati <suneel.garapati@xilinx.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 1dbe93232030..2ae8415e59f8 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1210,6 +1210,9 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
}
real_div = div;
div >>= 1;
+ if ((host->quirks2 & SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN)
+ && !div && host->max_clk <= 25000000)
+ div = 1;
}
} else {
/* Version 2.00 divisors must be a power of 2. */