aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c9
-rw-r--r--drivers/mmc/host/sdhci.h1
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 4432fec7467a..ac8b12b18fa4 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1794,8 +1794,13 @@ int sdhci_add_host(struct sdhci_host *host)
1794 mmc_dev(host->mmc)->dma_mask = &host->dma_mask; 1794 mmc_dev(host->mmc)->dma_mask = &host->dma_mask;
1795 } 1795 }
1796 1796
1797 host->max_clk = 1797 if (host->version >= SDHCI_SPEC_300)
1798 (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; 1798 host->max_clk = (caps & SDHCI_CLOCK_V3_BASE_MASK)
1799 >> SDHCI_CLOCK_BASE_SHIFT;
1800 else
1801 host->max_clk = (caps & SDHCI_CLOCK_BASE_MASK)
1802 >> SDHCI_CLOCK_BASE_SHIFT;
1803
1799 host->max_clk *= 1000000; 1804 host->max_clk *= 1000000;
1800 if (host->max_clk == 0 || host->quirks & 1805 if (host->max_clk == 0 || host->quirks &
1801 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN) { 1806 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN) {
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 950d4fd90072..ae28a310a6a1 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -144,6 +144,7 @@
144#define SDHCI_TIMEOUT_CLK_SHIFT 0 144#define SDHCI_TIMEOUT_CLK_SHIFT 0
145#define SDHCI_TIMEOUT_CLK_UNIT 0x00000080 145#define SDHCI_TIMEOUT_CLK_UNIT 0x00000080
146#define SDHCI_CLOCK_BASE_MASK 0x00003F00 146#define SDHCI_CLOCK_BASE_MASK 0x00003F00
147#define SDHCI_CLOCK_V3_BASE_MASK 0x0000FF00
147#define SDHCI_CLOCK_BASE_SHIFT 8 148#define SDHCI_CLOCK_BASE_SHIFT 8
148#define SDHCI_MAX_BLOCK_MASK 0x00030000 149#define SDHCI_MAX_BLOCK_MASK 0x00030000
149#define SDHCI_MAX_BLOCK_SHIFT 16 150#define SDHCI_MAX_BLOCK_SHIFT 16