summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2020-01-20 10:40:37 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2020-01-20 10:40:37 +0100
commit6fac4a3cb0599b32a3437356ab03e7be10e1f036 (patch)
tree1c69cab8c91d69756db786dccff97969278846d5 /drivers/mmc/host/sdhci.c
parent9e84a2e688d7ac0f23ab73ad541ee2081dcb53ec (diff)
parent2a187d03352086e300daa2044051db00044cd171 (diff)
Merge branch 'fixes' into next
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index fe465964a312..30b5a624b50e 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -4133,11 +4133,13 @@ int sdhci_setup_host(struct sdhci_host *host)
if (host->ops->get_min_clock)
mmc->f_min = host->ops->get_min_clock(host);
else if (host->version >= SDHCI_SPEC_300) {
- if (host->clk_mul) {
- mmc->f_min = (host->max_clk * host->clk_mul) / 1024;
+ if (host->clk_mul)
max_clk = host->max_clk * host->clk_mul;
- } else
- mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300;
+ /*
+ * Divided Clock Mode minimum clock rate is always less than
+ * Programmable Clock Mode minimum clock rate.
+ */
+ mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300;
} else
mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;