]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Reduce MMC clock frequency
authorJuha Yrjölä <juha.yrjola at nokia.com>
Fri, 1 Jul 2005 12:20:56 +0000 (05:20 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 1 Jul 2005 12:20:56 +0000 (05:20 -0700)
Reduce the MMC clock frequency slightly to make all cards work.
Otherwise weird CRC errors seem to happen with many RS-MMC
cards.

Signed-off-by: Juha Yrjölä <juha.yrjola at nokia.com>
drivers/mmc/omap.c

index af7e0aeac2bc8d5abb39e9e202ad2c238025332d..7f4c74e0316530fb3e15eecb66a89487731b49aa 100644 (file)
@@ -845,15 +845,18 @@ static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        if (ios->clock == 0) {
                dsor = 0;
        } else {
-               dsor = 48000000 / realclock;
+               int func_clk_rate = clk_get_rate(host->clk);
+
+               dsor = func_clk_rate / realclock;
                if (dsor < 1)
                        dsor = 1;
 
-               if (48000000 / dsor > realclock)
+               if (func_clk_rate / dsor > realclock)
                        dsor++;
 
                if (dsor > 250)
                        dsor = 250;
+               dsor++;
        }
 
        /* REVISIT:  if (ios->bus_width == MMC_BUS_WIDTH_4) dsor |= 1 << 15; */