diff options
-rw-r--r-- | drivers/mmc/host/sdhci-of.c | 8 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.c | 5 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.h | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c index d79fa55c3b8..908844327db 100644 --- a/drivers/mmc/host/sdhci-of.c +++ b/drivers/mmc/host/sdhci-of.c | |||
@@ -158,6 +158,13 @@ static unsigned int esdhc_get_max_clock(struct sdhci_host *host) | |||
158 | return of_host->clock; | 158 | return of_host->clock; |
159 | } | 159 | } |
160 | 160 | ||
161 | static unsigned int esdhc_get_min_clock(struct sdhci_host *host) | ||
162 | { | ||
163 | struct sdhci_of_host *of_host = sdhci_priv(host); | ||
164 | |||
165 | return of_host->clock / 256 / 16; | ||
166 | } | ||
167 | |||
161 | static unsigned int esdhc_get_timeout_clock(struct sdhci_host *host) | 168 | static unsigned int esdhc_get_timeout_clock(struct sdhci_host *host) |
162 | { | 169 | { |
163 | struct sdhci_of_host *of_host = sdhci_priv(host); | 170 | struct sdhci_of_host *of_host = sdhci_priv(host); |
@@ -184,6 +191,7 @@ static struct sdhci_of_data sdhci_esdhc = { | |||
184 | .set_clock = esdhc_set_clock, | 191 | .set_clock = esdhc_set_clock, |
185 | .enable_dma = esdhc_enable_dma, | 192 | .enable_dma = esdhc_enable_dma, |
186 | .get_max_clock = esdhc_get_max_clock, | 193 | .get_max_clock = esdhc_get_max_clock, |
194 | .get_min_clock = esdhc_get_min_clock, | ||
187 | .get_timeout_clock = esdhc_get_timeout_clock, | 195 | .get_timeout_clock = esdhc_get_timeout_clock, |
188 | }, | 196 | }, |
189 | }; | 197 | }; |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 6779b4ecab1..62041c7e924 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1766,7 +1766,10 @@ int sdhci_add_host(struct sdhci_host *host) | |||
1766 | * Set host parameters. | 1766 | * Set host parameters. |
1767 | */ | 1767 | */ |
1768 | mmc->ops = &sdhci_ops; | 1768 | mmc->ops = &sdhci_ops; |
1769 | mmc->f_min = host->max_clk / 256; | 1769 | if (host->ops->get_min_clock) |
1770 | mmc->f_min = host->ops->get_min_clock(host); | ||
1771 | else | ||
1772 | mmc->f_min = host->max_clk / 256; | ||
1770 | mmc->f_max = host->max_clk; | 1773 | mmc->f_max = host->max_clk; |
1771 | mmc->caps = MMC_CAP_SDIO_IRQ; | 1774 | mmc->caps = MMC_CAP_SDIO_IRQ; |
1772 | 1775 | ||
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 831ddf7dcb4..c77e9ff3022 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -302,6 +302,7 @@ struct sdhci_ops { | |||
302 | 302 | ||
303 | int (*enable_dma)(struct sdhci_host *host); | 303 | int (*enable_dma)(struct sdhci_host *host); |
304 | unsigned int (*get_max_clock)(struct sdhci_host *host); | 304 | unsigned int (*get_max_clock)(struct sdhci_host *host); |
305 | unsigned int (*get_min_clock)(struct sdhci_host *host); | ||
305 | unsigned int (*get_timeout_clock)(struct sdhci_host *host); | 306 | unsigned int (*get_timeout_clock)(struct sdhci_host *host); |
306 | }; | 307 | }; |
307 | 308 | ||