mmc: omap_hsmmc: correct max value of clkd
authorBalaji T K <balajitk@ti.com>
Sun, 20 Oct 2013 18:55:21 +0000 (00:25 +0530)
committerChris Ball <cjb@laptop.org>
Thu, 31 Oct 2013 00:26:20 +0000 (20:26 -0400)
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>
drivers/mmc/host/omap_hsmmc.c

index 4d1170fa34c04b9136c86306c002dcb3079a1739..fbd2d89017a9385ef0b992165fef1e979988b092 100644 (file)
@@ -75,6 +75,7 @@
 #define ICE                    0x1
 #define ICS                    0x2
 #define CEN                    (1 << 2)
+#define CLKD_MAX               0x3FF           /* max clock divisor: 1023 */
 #define CLKD_MASK              0x0000FFC0
 #define CLKD_SHIFT             6
 #define DTO_MASK               0x000F0000
@@ -497,8 +498,8 @@ static u16 calc_divisor(struct omap_hsmmc_host *host, struct mmc_ios *ios)
 
        if (ios->clock) {
                dsor = DIV_ROUND_UP(clk_get_rate(host->fclk), ios->clock);
-               if (dsor > 250)
-                       dsor = 250;
+               if (dsor > CLKD_MAX)
+                       dsor = CLKD_MAX;
        }
 
        return dsor;
This page took 0.032668 seconds and 5 git commands to generate.