mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
mmc: sdhci: move timeout_clk calculation farther down
This moves the calculation below the assignment of mmc->f_max, which we need for calculating timeout_clk in the next patch in this series. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
parent
78a2ca2727
commit
272308caaa
@ -2456,25 +2456,6 @@ int sdhci_add_host(struct sdhci_host *host)
|
||||
host->max_clk = host->ops->get_max_clock(host);
|
||||
}
|
||||
|
||||
host->timeout_clk =
|
||||
(caps[0] & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT;
|
||||
if (host->timeout_clk == 0) {
|
||||
if (host->ops->get_timeout_clock) {
|
||||
host->timeout_clk = host->ops->get_timeout_clock(host);
|
||||
} else if (!(host->quirks &
|
||||
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) {
|
||||
printk(KERN_ERR
|
||||
"%s: Hardware doesn't specify timeout clock "
|
||||
"frequency.\n", mmc_hostname(mmc));
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT)
|
||||
host->timeout_clk *= 1000;
|
||||
|
||||
if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
|
||||
host->timeout_clk = host->clock / 1000;
|
||||
|
||||
/*
|
||||
* In case of Host Controller v3.00, find out whether clock
|
||||
* multiplier is supported.
|
||||
@ -2507,6 +2488,25 @@ int sdhci_add_host(struct sdhci_host *host)
|
||||
} else
|
||||
mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;
|
||||
|
||||
host->timeout_clk =
|
||||
(caps[0] & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT;
|
||||
if (host->timeout_clk == 0) {
|
||||
if (host->ops->get_timeout_clock) {
|
||||
host->timeout_clk = host->ops->get_timeout_clock(host);
|
||||
} else if (!(host->quirks &
|
||||
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) {
|
||||
printk(KERN_ERR
|
||||
"%s: Hardware doesn't specify timeout clock "
|
||||
"frequency.\n", mmc_hostname(mmc));
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT)
|
||||
host->timeout_clk *= 1000;
|
||||
|
||||
if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
|
||||
host->timeout_clk = host->clock / 1000;
|
||||
|
||||
if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
|
||||
mmc->max_discard_to = (1 << 27) / (mmc->f_max / 1000);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user