aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAisheng Dong <b29396@freescale.com>2014-08-27 03:26:31 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-09-09 07:59:22 -0400
commit28aab053396125c8e191537ec2b9781ec0174b04 (patch)
treee8eea59931503aad9b4e170c12fd442597258297
parente33eb8e2818c9a7b41bac68a1c83ee4c136af9ba (diff)
mmc: sdhci: calculate timeout_clk conditionally in sdhci_add_host
The timeout_clk calculation code in sdhci_add_host is meaningless for SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK. So only execute them with no SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK set. Signed-off-by: Dong Aisheng <b29396@freescale.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ff0e1c55d958..1e50880d57de 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2931,27 +2931,27 @@ int sdhci_add_host(struct sdhci_host *host)
2931 } else 2931 } else
2932 mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200; 2932 mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;
2933 2933
2934 host->timeout_clk = 2934 if (!(host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) {
2935 (caps[0] & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; 2935 host->timeout_clk = (caps[0] & SDHCI_TIMEOUT_CLK_MASK) >>
2936 if (host->timeout_clk == 0) { 2936 SDHCI_TIMEOUT_CLK_SHIFT;
2937 if (host->ops->get_timeout_clock) { 2937 if (host->timeout_clk == 0) {
2938 host->timeout_clk = host->ops->get_timeout_clock(host); 2938 if (host->ops->get_timeout_clock) {
2939 } else if (!(host->quirks & 2939 host->timeout_clk =
2940 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) { 2940 host->ops->get_timeout_clock(host);
2941 pr_err("%s: Hardware doesn't specify timeout clock " 2941 } else {
2942 "frequency.\n", mmc_hostname(mmc)); 2942 pr_err("%s: Hardware doesn't specify timeout clock frequency.\n",
2943 return -ENODEV; 2943 mmc_hostname(mmc));
2944 return -ENODEV;
2945 }
2944 } 2946 }
2945 }
2946 if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT)
2947 host->timeout_clk *= 1000;
2948 2947
2949 if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) 2948 if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT)
2950 host->timeout_clk = mmc->f_max / 1000; 2949 host->timeout_clk *= 1000;
2951 2950
2952 mmc->max_busy_timeout = host->ops->get_max_timeout_count ? 2951 mmc->max_busy_timeout = host->ops->get_max_timeout_count ?
2953 host->ops->get_max_timeout_count(host) : 1 << 27; 2952 host->ops->get_max_timeout_count(host) : 1 << 27;
2954 mmc->max_busy_timeout /= host->timeout_clk; 2953 mmc->max_busy_timeout /= host->timeout_clk;
2954 }
2955 2955
2956 mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; 2956 mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
2957 mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; 2957 mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;