]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mmc/mmc.c
Merge ../linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / mmc / mmc.c
index eb41391e06e938a5a0607b90defab00f82fd9827..887d1a91ec61765446b499ab66d9338e7298440a 100644 (file)
@@ -694,6 +694,7 @@ static void mmc_power_up(struct mmc_host *host)
        int bit = fls(host->ocr_avail) - 1;
 
        host->ios.vdd = bit;
+       host->ios.clock = host->f_min;
        host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
        host->ios.chip_select = MMC_CS_DONTCARE;
        host->ios.power_mode = MMC_POWER_UP;
@@ -702,7 +703,6 @@ static void mmc_power_up(struct mmc_host *host)
 
        mmc_delay(1);
 
-       host->ios.clock = host->f_min;
        host->ios.power_mode = MMC_POWER_ON;
        host->ops->set_ios(host, &host->ios);
 
@@ -736,7 +736,7 @@ static int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
 
                if (cmd.resp[0] & MMC_CARD_BUSY || ocr == 0)
                        break;
-
+               mmc_delay(1);
                err = MMC_ERR_TIMEOUT;
 
                mmc_delay(10);
@@ -1078,6 +1078,14 @@ static void mmc_setup(struct mmc_host *host)
        host->ios.bus_mode = MMC_BUSMODE_PUSHPULL;
        host->ops->set_ios(host, &host->ios);
 
+       /*
+        * Some already detectd cards get confused in the card identification
+        * mode and futher commands can fail.  Doing an extra status inquiry
+        * after the identification mode seems to get cards back to their
+        * senses.
+        */
+       mmc_check_cards(host);
+
        mmc_read_csds(host);
 
        if (host->mode == MMC_MODE_SD)