summaryrefslogtreecommitdiff
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorDaniel Chen <daniel.ch_chen@htc.com>2009-12-09 09:45:36 -0800
committerArve Hjønnevåg <arve@android.com>2010-02-08 15:08:37 -0800
commit25c29cc964ec4d29370e8af7ae3b51f1f6a239ac (patch)
tree0c3e2aa746bbef3c00e6303141e3060b5088e3b5 /drivers/mmc/core
parent94f9243a145376ef793dce987f4eeb42adf6f289 (diff)
mmc: sdio: Add high speed support to sdio_reset_comm()
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/sdio.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index a78b4dc3fd9e..ac9102487e25 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -661,7 +661,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;