summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorDaniel Chen <daniel.ch_chen@htc.com>2011-10-09 02:17:19 +0100
committerAndy Green <andy.green@linaro.org>2011-10-09 02:17:19 +0100
commitc1e9c87bd03b9ae6056656a2700a094b014f8a9f (patch)
tree38b65f9f0e202a3efae2b840d943e726a430c3d9 /drivers/mmc
parent7f1bcc252afee5f5f63e5be0119099ff15ad20dc (diff)
mmc: sdio: Add high speed support to sdio_reset_comm()
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'drivers/mmc')
-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 0b976f09e8e..9de1f542249 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -968,7 +968,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;