Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
[pandora-kernel.git] / drivers / mmc / host / mmci.c
index fef7140..56e9a41 100644 (file)
@@ -1184,7 +1184,15 @@ static int __devinit mmci_probe(struct amba_device *dev,
        }
 
        mmc->ops = &mmci_ops;
-       mmc->f_min = (host->mclk + 511) / 512;
+       /*
+        * The ARM and ST versions of the block have slightly different
+        * clock divider equations which means that the minimum divider
+        * differs too.
+        */
+       if (variant->st_clkdiv)
+               mmc->f_min = DIV_ROUND_UP(host->mclk, 257);
+       else
+               mmc->f_min = DIV_ROUND_UP(host->mclk, 512);
        /*
         * If the platform data supplies a maximum operating
         * frequency, this takes precedence. Else, we fall back