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

Commit 08c82dfa authored by Takashi Iwai's avatar Takashi Iwai Committed by Chris Ball
Browse files

mmc: fix mmc_set_bus_width_ddr() call without bus-width-test cap



With the bus-width test patch, mmc_set_bus_width*() isn't called properly
when the driver doesn't set MMC_CAP_BUS_WIDTH and no DDR mode.
This patch fixes the regression by moving the call up before the cap test.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Reviewed-by: default avatarChris Ball <cjb@laptop.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent f95f3850
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -558,6 +558,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
					 EXT_CSD_BUS_WIDTH,
					 EXT_CSD_BUS_WIDTH,
					 ext_csd_bits[idx][0]);
					 ext_csd_bits[idx][0]);
			if (!err) {
			if (!err) {
				mmc_set_bus_width_ddr(card->host,
						      bus_width, MMC_SDR_MODE);
				/*
				/*
				 * If controller can't handle bus width test,
				 * If controller can't handle bus width test,
				 * use the highest bus width to maintain
				 * use the highest bus width to maintain
@@ -565,8 +567,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
				 */
				 */
				if (!(host->caps & MMC_CAP_BUS_WIDTH_TEST))
				if (!(host->caps & MMC_CAP_BUS_WIDTH_TEST))
					break;
					break;
				mmc_set_bus_width_ddr(card->host,
						      bus_width, MMC_SDR_MODE);
				err = mmc_bus_test(card, bus_width);
				err = mmc_bus_test(card, bus_width);
				if (!err)
				if (!err)
					break;
					break;