mmc: sdio: Add high speed support to sdio_reset_comm()
authorDaniel Chen <daniel.ch_chen@htc.com>
Wed, 9 Dec 2009 17:45:36 +0000 (09:45 -0800)
committerColin Cross <ccross@android.com>
Thu, 30 Sep 2010 00:49:15 +0000 (17:49 -0700)
Signed-off-by: San Mehat <san@google.com>
drivers/mmc/core/sdio.c

index e2da3ac3fd921383bf140372f82a4087aaeb7a6d..cd37b3511f68e0cfadf762ba4ab132aca8f0c238 100644 (file)
@@ -841,7 +841,28 @@ int sdio_reset_comm(struct mmc_card *card)
                        goto err;
        }
 
-       mmc_set_clock(host, card->cis.max_dtr);
+       /*
+        * Switch to high-speed (if supported).
+        */
+       err = sdio_enable_hs(card);
+       if (err)
+               goto err;
+
+       /*
+        * Change to the card's maximum speed.
+        */
+       if (mmc_card_highspeed(card)) {
+               /*
+                * The SDIO specification doesn't mention how
+                * the CIS transfer speed register relates to
+                * high-speed, but it seems that 50 MHz is
+                * mandatory.
+                */
+               mmc_set_clock(host, 50000000);
+       } else {
+               mmc_set_clock(host, card->cis.max_dtr);
+       }
+
        err = sdio_enable_wide(card);
        if (err)
                goto err;