diff options
author | Balaji T K <balajitk@ti.com> | 2013-10-20 14:55:21 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-10-30 20:26:20 -0400 |
commit | ed164182154d11589a33710a9d04eafd6215d6e5 (patch) | |
tree | ab2134e0ca4396c27271cd42fe6c40ad71dc2798 /drivers/mmc | |
parent | 1e881786c9038cd78dfa325b012f4a00ce1bcfd4 (diff) |
mmc: omap_hsmmc: correct max value of clkd
clock divisor can take a max value of 1023. Update code so that card
init can be handled at f_min even at higher IP clock frequencies from
which clock to the card is derived.
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 4d1170fa34c0..fbd2d89017a9 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -75,6 +75,7 @@ | |||
75 | #define ICE 0x1 | 75 | #define ICE 0x1 |
76 | #define ICS 0x2 | 76 | #define ICS 0x2 |
77 | #define CEN (1 << 2) | 77 | #define CEN (1 << 2) |
78 | #define CLKD_MAX 0x3FF /* max clock divisor: 1023 */ | ||
78 | #define CLKD_MASK 0x0000FFC0 | 79 | #define CLKD_MASK 0x0000FFC0 |
79 | #define CLKD_SHIFT 6 | 80 | #define CLKD_SHIFT 6 |
80 | #define DTO_MASK 0x000F0000 | 81 | #define DTO_MASK 0x000F0000 |
@@ -497,8 +498,8 @@ static u16 calc_divisor(struct omap_hsmmc_host *host, struct mmc_ios *ios) | |||
497 | 498 | ||
498 | if (ios->clock) { | 499 | if (ios->clock) { |
499 | dsor = DIV_ROUND_UP(clk_get_rate(host->fclk), ios->clock); | 500 | dsor = DIV_ROUND_UP(clk_get_rate(host->fclk), ios->clock); |
500 | if (dsor > 250) | 501 | if (dsor > CLKD_MAX) |
501 | dsor = 250; | 502 | dsor = CLKD_MAX; |
502 | } | 503 | } |
503 | 504 | ||
504 | return dsor; | 505 | return dsor; |