]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/mmc/host/mmci.c
ARM: 6033/1: ARM: MMCI: pass max frequency from platform
[net-next-2.6.git] / drivers / mmc / host / mmci.c
index 7e70c1a06d8ad6711a58661f00e9029b95a1fc6c..ff115d92088811fbe544220cd9800da07f58cd4b 100644 (file)
@@ -631,7 +631,18 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 
        mmc->ops = &mmci_ops;
        mmc->f_min = (host->mclk + 511) / 512;
-       mmc->f_max = min(host->mclk, fmax);
+       /*
+        * If the platform data supplies a maximum operating
+        * frequency, this takes precedence. Else, we fall back
+        * to using the module parameter, which has a (low)
+        * default value in case it is not specified. Either
+        * value must not exceed the clock rate into the block,
+        * of course.
+        */
+       if (plat->f_max)
+               mmc->f_max = min(host->mclk, plat->f_max);
+       else
+               mmc->f_max = min(host->mclk, fmax);
        dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
 
 #ifdef CONFIG_REGULATOR