diff options
| author | Venkat Gopalakrishnan <venkatg@codeaurora.org> | 2015-06-11 18:27:27 -0700 |
|---|---|---|
| committer | Subhash Jadavani <subhashj@codeaurora.org> | 2016-05-31 15:26:47 -0700 |
| commit | ac15746a7b1f9aed83fb8eee70a13b6ff43a519e (patch) | |
| tree | 5a42e749d8349e9691ad744d5f1da78e2973ec9a /drivers/mmc | |
| parent | 506b393bf6e69fb7dbad718e18f0d033ef19da8f (diff) | |
mmc: Fix bus width setting in enhanced strobe mode
The 8-bit bus width needs to be set first before switching to
DDR bus width when entering HS400 in enhanced strobe mode.
Also use the mmc_select_bus_width() for doing this instead of
rewriting portion of that code.
Change-Id: If9bec799de77714d7183c812a0ba04a9a4ac48f5
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'drivers/mmc')
| -rw-r--r-- | drivers/mmc/core/mmc.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index f4b6ca033487..e47e4658e754 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1189,8 +1189,12 @@ static int mmc_select_hs400(struct mmc_card *card) } val = EXT_CSD_DDR_BUS_WIDTH_8; - if (card->ext_csd.strobe_support) + if (card->ext_csd.strobe_support) { + err = mmc_select_bus_width(card); + if (IS_ERR_VALUE(err)) + return err; val |= EXT_CSD_BUS_WIDTH_STROBE; + } /* Switch card to DDR */ err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, @@ -1203,25 +1207,6 @@ static int mmc_select_hs400(struct mmc_card *card) return err; } - if (card->ext_csd.strobe_support) { - mmc_set_bus_width(host, MMC_BUS_WIDTH_8); - /* - * If controller can't handle bus width test, - * compare ext_csd previously read in 1 bit mode - * against ext_csd at new bus width - */ - if (!(host->caps & MMC_CAP_BUS_WIDTH_TEST)) - err = mmc_compare_ext_csds(card, MMC_BUS_WIDTH_8); - else - err = mmc_bus_test(card, MMC_BUS_WIDTH_8); - - if (err) { - pr_warn("%s: switch to bus width %d failed\n", - mmc_hostname(host), MMC_BUS_WIDTH_8); - return err; - } - } - /* Switch card to HS400 */ val = EXT_CSD_TIMING_HS400 | card->drive_strength << EXT_CSD_DRV_STR_SHIFT; |
