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

Commit a77dc8ab authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: core: Update mmc_scale_high logic properly for HS400 mode"

parents 6efcd532 3417de3d
Loading
Loading
Loading
Loading
+12 −29
Original line number Diff line number Diff line
@@ -1610,45 +1610,28 @@ static int mmc_scale_high(struct mmc_host *host)
		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",
				mmc_hostname(host), __func__);
			WARN_ON(1);
			return -EPERM;
		}

		err = mmc_select_hs200(host->card);
	mmc_set_initial_state(host);
	err = mmc_select_timing(host->card);
	if (err) {
			pr_err("%s: %s: selecting HS200 failed (%d)\n",
		pr_err("%s: %s: select hs400 failed (%d)\n",
			mmc_hostname(host), __func__, err);
		return err;
	}

		mmc_set_bus_speed(host->card);

	if (mmc_card_hs200(host->card)) {
		err = mmc_hs200_tuning(host->card);
		if (err) {
			pr_err("%s: %s: hs200 tuning failed (%d)\n",
				mmc_hostname(host), __func__, err);
			return err;
		}

		if (!(host->card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS400)) {
			pr_debug("%s: card does not support HS400\n",
				mmc_hostname(host));
			return 0;
		}
	}

	mmc_set_initial_state(host);
	err = mmc_select_timing(host->card);
		err = mmc_select_hs400(host->card);
		if (err) {
		pr_err("%s: %s: select hs400 failed (%d)\n",
			pr_err("%s: %s: Select hs400 failed (%d)\n",
				mmc_hostname(host), __func__, err);
			return err;
		}

	}
	return 0;
}