]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
MMC: Fix MMC_POWER_UP on some OMAP boards
authorTony Lindgren <tony@atomide.com>
Wed, 3 May 2006 10:59:07 +0000 (03:59 -0700)
committerTony Lindgren <tony@atomide.com>
Wed, 3 May 2006 10:59:07 +0000 (03:59 -0700)
MMC spec says that we must not enable clock prior to the power
stabilizing. But at least omap16xx needs clock divisor configured
during MMC_POWER_UP.

Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mmc/omap.c

index 7c8b6ceb9348455f36fe3d8aa5174ce20ca72b29..51670cf1eedfab0678fad2a443e8611a02de1031 100644 (file)
@@ -899,9 +899,16 @@ static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        int dsor;
        int realclock, i;
 
-       realclock = ios->clock;
+       /* According to the MMC spec we must not enable clock prior to
+        * power stabilizing. But at least omap16xx needs clock dsor
+        * configured during MMC_POWER_UP.
+        */
+       if ((ios->power_mode == MMC_POWER_UP) && (ios->clock == 0))
+               realclock = mmc->f_min;
+       else
+               realclock = ios->clock;
 
-       if (ios->clock == 0)
+       if (realclock == 0)
                dsor = 0;
        else {
                int func_clk_rate = clk_get_rate(host->fclk);