aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c22
-rw-r--r--drivers/mmc/host/sdhci.h2
2 files changed, 17 insertions, 7 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c814220d214e..34ab77bd12ae 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1674,19 +1674,27 @@ int sdhci_add_host(struct sdhci_host *host)
1674 1674
1675 host->max_clk = 1675 host->max_clk =
1676 (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; 1676 (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT;
1677 host->max_clk *= 1000000;
1677 if (host->max_clk == 0) { 1678 if (host->max_clk == 0) {
1678 printk(KERN_ERR "%s: Hardware doesn't specify base clock " 1679 if (!host->ops->get_max_clock) {
1679 "frequency.\n", mmc_hostname(mmc)); 1680 printk(KERN_ERR
1680 return -ENODEV; 1681 "%s: Hardware doesn't specify base clock "
1682 "frequency.\n", mmc_hostname(mmc));
1683 return -ENODEV;
1684 }
1685 host->max_clk = host->ops->get_max_clock(host);
1681 } 1686 }
1682 host->max_clk *= 1000000;
1683 1687
1684 host->timeout_clk = 1688 host->timeout_clk =
1685 (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; 1689 (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT;
1686 if (host->timeout_clk == 0) { 1690 if (host->timeout_clk == 0) {
1687 printk(KERN_ERR "%s: Hardware doesn't specify timeout clock " 1691 if (!host->ops->get_timeout_clock) {
1688 "frequency.\n", mmc_hostname(mmc)); 1692 printk(KERN_ERR
1689 return -ENODEV; 1693 "%s: Hardware doesn't specify timeout clock "
1694 "frequency.\n", mmc_hostname(mmc));
1695 return -ENODEV;
1696 }
1697 host->timeout_clk = host->ops->get_timeout_clock(host);
1690 } 1698 }
1691 if (caps & SDHCI_TIMEOUT_CLK_UNIT) 1699 if (caps & SDHCI_TIMEOUT_CLK_UNIT)
1692 host->timeout_clk *= 1000; 1700 host->timeout_clk *= 1000;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 6980f2725b85..aab0652a4585 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -285,6 +285,8 @@ struct sdhci_ops {
285#endif 285#endif
286 286
287 int (*enable_dma)(struct sdhci_host *host); 287 int (*enable_dma)(struct sdhci_host *host);
288 unsigned int (*get_max_clock)(struct sdhci_host *host);
289 unsigned int (*get_timeout_clock)(struct sdhci_host *host);
288}; 290};
289 291
290#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS 292#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS