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

Commit ae5c51c3 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan Committed by Matt Wagantall
Browse files

mmc: core: Add workaround for hosts that need addtional tuning for HS400



Add a capability to identify hosts that need additional tuning for HS400
and perform a post tuning process that maybe needed for proper HS400
functionality.

Change-Id: I3895aabddce4dbecb208e3c522957e656f37e30d
Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent 938ace4b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1100,6 +1100,17 @@ static int mmc_select_hs400(struct mmc_card *card)
	mmc_set_timing(host, MMC_TIMING_MMC_HS400);
	mmc_set_bus_speed(card);

	if ((host->caps2 & MMC_CAP2_HS400_POST_TUNING) && host->ops->execute_tuning) {
		mmc_host_clk_hold(host);
		err = host->ops->execute_tuning(host,
				MMC_SEND_TUNING_BLOCK_HS200);
		mmc_host_clk_release(host);

		if (err)
			pr_warn("%s: tuning execution failed\n",
				mmc_hostname(host));
	}

	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -312,6 +312,8 @@ struct mmc_host {
#define MMC_CAP2_CLK_SCALE	(1 << 19)	/* Allow dynamic clk scaling */
/* Allows Asynchronous SDIO irq while card is in 4-bit mode */
#define MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE (1 << 20)
/* Some hosts need additional tuning */
#define MMC_CAP2_HS400_POST_TUNING	(1 << 21)
#define MMC_CAP2_NONHOTPLUG	(1 << 25)	/*Don't support hotplug*/

	mmc_pm_flag_t		pm_caps;	/* supported pm features */