Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6c61a78 authored by Asutosh Das's avatar Asutosh Das Committed by Pavan Anamula
Browse files

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: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarPavan Anamula <pavana@codeaurora.org>
parent edf4d230
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1419,7 +1419,6 @@ static int mmc_select_hs_ddr52(struct mmc_host *host)
	int err;

	mmc_select_hs(host->card);
	mmc_set_clock(host, MMC_HIGH_52_MAX_DTR);
	err = mmc_select_bus_width(host->card);
	if (err < 0) {
		pr_err("%s: %s: select_bus_width failed(%d)\n",
@@ -1428,6 +1427,7 @@ static int mmc_select_hs_ddr52(struct mmc_host *host)
	}

	err = mmc_select_hs_ddr(host->card);
	mmc_set_clock(host, MMC_HIGH_52_MAX_DTR);

	return err;
}
@@ -1479,6 +1479,11 @@ static int mmc_scale_high(struct mmc_host *host)
{
	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->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200)) {
			pr_err("%s: %s: card does not support HS200\n",