MMC core: limit minimum initialization frequency to 400kHz
authorSascha Hauer <s.hauer@pengutronix.de>
Thu, 9 Apr 2009 06:32:02 +0000 (08:32 +0200)
committerPierre Ossman <pierre@ossman.eu>
Sat, 13 Jun 2009 20:42:57 +0000 (22:42 +0200)
Some controllers allow a much lower frequency than 400kHz.
Keep the minimum frequency within sensible limits.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
drivers/mmc/core/core.c

index 23fb2c39d9edc38bffdb2a628ea3860013ab7ca1..d84c880fac84f41a0d388540d74d22a4a7649705 100644 (file)
@@ -708,7 +708,13 @@ static void mmc_power_up(struct mmc_host *host)
         */
        mmc_delay(10);
 
-       host->ios.clock = host->f_min;
+       if (host->f_min > 400000) {
+               pr_warning("%s: Minimum clock frequency too high for "
+                               "identification mode\n", mmc_hostname(host));
+               host->ios.clock = host->f_min;
+       } else
+               host->ios.clock = 400000;
+
        host->ios.power_mode = MMC_POWER_ON;
        mmc_set_ios(host);