mmc: core: modify scaling up/down sequence

The scaling down sequence requires the clock to be set
after selecting the corresponding bus-speed mode in the
controller.
The scaling up to HS400 requires the timing and clock to
be set to legacy.

Without the above configuration, bus-width switch fails,
further leading to CRC errors.

Change-Id: If502f28e19924264dfb99d76f6881d3167f56a05
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Pavan Anamula <pavana@codeaurora.org>
This commit is contained in:
Asutosh Das 2016-02-25 17:30:38 +05:30 committed by Kyle Yan
parent e6855ed3fe
commit aff06730c3

View file

@ -1550,7 +1550,6 @@ static int mmc_select_hs_ddr52(struct mmc_host *host)
int err; int err;
mmc_select_hs(host->card); mmc_select_hs(host->card);
mmc_set_clock(host, MMC_HIGH_52_MAX_DTR);
err = mmc_select_bus_width(host->card); err = mmc_select_bus_width(host->card);
if (err < 0) { if (err < 0) {
pr_err("%s: %s: select_bus_width failed(%d)\n", pr_err("%s: %s: select_bus_width failed(%d)\n",
@ -1559,6 +1558,7 @@ static int mmc_select_hs_ddr52(struct mmc_host *host)
} }
err = mmc_select_hs_ddr(host->card); err = mmc_select_hs_ddr(host->card);
mmc_set_clock(host, MMC_HIGH_52_MAX_DTR);
return err; return err;
} }
@ -1610,6 +1610,11 @@ static int mmc_scale_high(struct mmc_host *host)
{ {
int err = 0; int err = 0;
if (mmc_card_ddr52(host->card)) {
mmc_set_timing(host, MMC_TIMING_LEGACY);
mmc_set_clock(host, MMC_HIGH_26_MAX_DTR);
}
if (!host->card->ext_csd.strobe_support) { if (!host->card->ext_csd.strobe_support) {
if (!(host->card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200)) { if (!(host->card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200)) {
pr_err("%s: %s: card does not support HS200\n", pr_err("%s: %s: card does not support HS200\n",