diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index d5fe43d53c51..5b35c7e5a26d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -120,7 +120,6 @@ | |||
120 | 120 | ||
121 | #define MMC_AUTOSUSPEND_DELAY 100 | 121 | #define MMC_AUTOSUSPEND_DELAY 100 |
122 | #define MMC_TIMEOUT_MS 20 | 122 | #define MMC_TIMEOUT_MS 20 |
123 | #define OMAP_MMC_MASTER_CLOCK 96000000 | ||
124 | #define OMAP_MMC_MIN_CLOCK 400000 | 123 | #define OMAP_MMC_MIN_CLOCK 400000 |
125 | #define OMAP_MMC_MAX_CLOCK 52000000 | 124 | #define OMAP_MMC_MAX_CLOCK 52000000 |
126 | #define DRIVER_NAME "omap_hsmmc" | 125 | #define DRIVER_NAME "omap_hsmmc" |
@@ -598,12 +597,12 @@ static void omap_hsmmc_disable_irq(struct omap_hsmmc_host *host) | |||
598 | } | 597 | } |
599 | 598 | ||
600 | /* Calculate divisor for the given clock frequency */ | 599 | /* Calculate divisor for the given clock frequency */ |
601 | static u16 calc_divisor(struct mmc_ios *ios) | 600 | static u16 calc_divisor(struct omap_hsmmc_host *host, struct mmc_ios *ios) |
602 | { | 601 | { |
603 | u16 dsor = 0; | 602 | u16 dsor = 0; |
604 | 603 | ||
605 | if (ios->clock) { | 604 | if (ios->clock) { |
606 | dsor = DIV_ROUND_UP(OMAP_MMC_MASTER_CLOCK, ios->clock); | 605 | dsor = DIV_ROUND_UP(clk_get_rate(host->fclk), ios->clock); |
607 | if (dsor > 250) | 606 | if (dsor > 250) |
608 | dsor = 250; | 607 | dsor = 250; |
609 | } | 608 | } |
@@ -623,7 +622,7 @@ static void omap_hsmmc_set_clock(struct omap_hsmmc_host *host) | |||
623 | 622 | ||
624 | regval = OMAP_HSMMC_READ(host->base, SYSCTL); | 623 | regval = OMAP_HSMMC_READ(host->base, SYSCTL); |
625 | regval = regval & ~(CLKD_MASK | DTO_MASK); | 624 | regval = regval & ~(CLKD_MASK | DTO_MASK); |
626 | regval = regval | (calc_divisor(ios) << 6) | (DTO << 16); | 625 | regval = regval | (calc_divisor(host, ios) << 6) | (DTO << 16); |
627 | OMAP_HSMMC_WRITE(host->base, SYSCTL, regval); | 626 | OMAP_HSMMC_WRITE(host->base, SYSCTL, regval); |
628 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | 627 | OMAP_HSMMC_WRITE(host->base, SYSCTL, |
629 | OMAP_HSMMC_READ(host->base, SYSCTL) | ICE); | 628 | OMAP_HSMMC_READ(host->base, SYSCTL) | ICE); |