summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSayali Lokhande <sayalil@codeaurora.org>2017-07-05 11:21:28 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-07-10 02:28:00 -0700
commitb52748d7fc19e471b5296291214ca7be7208d9be (patch)
treea6d9425a541609d841a7fe7b3e7ef71cbc1c87d0
parent3ec8bfc9bb3a1f1a8584074f914c1d92f052b7f1 (diff)
mmc: core: Select HS mode in device first and then in the host
While switching from hs400 to hs200 mode, high speed mode timing should be selected in the device before changing the clock frequency in the host. But current implementation, (mmc_hs400_to_hs200) first updates the frequency in the host and then updates mode in the device. This is a spec violation. Hence update the sequence to comply with the spec. Change-Id: I0694edac9dd005ec68add9cc38bbe6fa4245ed48 Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
-rw-r--r--drivers/mmc/core/mmc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 7173bf56c2c5..a28d6b98a042 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1323,10 +1323,6 @@ int mmc_hs400_to_hs200(struct mmc_card *card)
if (host->caps & MMC_CAP_WAIT_WHILE_BUSY)
send_status = false;
- /* Reduce frequency to HS */
- max_dtr = card->ext_csd.hs_max_dtr;
- mmc_set_clock(host, max_dtr);
-
/* Switch HS400 to HS DDR */
val = EXT_CSD_TIMING_HS;
err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING,
@@ -1337,6 +1333,10 @@ int mmc_hs400_to_hs200(struct mmc_card *card)
mmc_set_timing(host, MMC_TIMING_MMC_DDR52);
+ /* Reduce frequency to HS */
+ max_dtr = card->ext_csd.hs_max_dtr;
+ mmc_set_clock(host, max_dtr);
+
if (!send_status) {
err = mmc_switch_status(card, false);
if (err)