diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2017-03-24 08:50:12 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-04-24 21:41:48 +0200 |
commit | 8cc35289227c5cbb8811048519c1703e2137d421 (patch) | |
tree | e742bcdbf2b2229677f5abfec2eaf9924fff03b5 /drivers/mmc/host/sdhci-cadence.c | |
parent | mmc: sunxi: change controller error info to debug level (diff) | |
download | linux-8cc35289227c5cbb8811048519c1703e2137d421.tar.xz linux-8cc35289227c5cbb8811048519c1703e2137d421.zip |
mmc: sdhci: clarify the get_timeout_clock callback
Currently the get_timeout_clock callback doesn't clearly
have a statement that it needs the variant drivers to return
the timeout clock rate in kHz if the SDHCI_TIMEOUT_CLK_UNIT
isn't present, otherwise the variant drivers should return it
in MHz. It's also very likely that further variant drivers which
are going to use this callback will be confused by this situation.
Given the fact that moderm sdhci variant hosts are very prone to get
the timeout clock from common clock framework (actually the only three
users did that), it's more natural to return the value in Hz and we
make an explicit comment there. Then we put the unit conversion inside
the sdhci core. Thus will improve the code and prevent further misuses.
Reported-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-cadence.c')
-rw-r--r-- | drivers/mmc/host/sdhci-cadence.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c index 48f641953844..07a27dcb42be 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -105,9 +105,9 @@ static unsigned int sdhci_cdns_get_timeout_clock(struct sdhci_host *host) { /* * Cadence's spec says the Timeout Clock Frequency is the same as the - * Base Clock Frequency. Divide it by 1000 to return a value in kHz. + * Base Clock Frequency. */ - return host->max_clk / 1000; + return host->max_clk; } static void sdhci_cdns_set_emmc_mode(struct sdhci_cdns_priv *priv, u32 mode) |