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

Commit 14613439 authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Xiaonian Wang
Browse files

mmc: sdhci-msm: Implement uhs_set_signaling to select right mode



The MSM SDHCI controller requires SDR104 mode to be set for HS200
cards. To handle this case, implement uhs_set_signaling so that
the mode selection for MSM SDHCI doesn't happen in sdhci driver.

Change-Id: I901dc82312b4299e86a7812dd74d3682650966a2
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
[venkatg@codeaurora.org: Fix fn signature for set_uhs_signaling
that changed as part of 3.14 kernel]
Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent eaa21864
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -1604,7 +1604,32 @@ void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)
	return;
}

static void sdhci_msm_set_uhs_signaling(struct sdhci_host *host,
					unsigned int uhs)
{
	u16 ctrl_2;

	ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
	/* Select Bus Speed Mode for host */
	ctrl_2 &= ~SDHCI_CTRL_UHS_MASK;
	if (uhs == MMC_TIMING_MMC_HS200)
		ctrl_2 |= SDHCI_CTRL_UHS_SDR104;
	else if (uhs == MMC_TIMING_UHS_SDR12)
		ctrl_2 |= SDHCI_CTRL_UHS_SDR12;
	else if (uhs == MMC_TIMING_UHS_SDR25)
		ctrl_2 |= SDHCI_CTRL_UHS_SDR25;
	else if (uhs == MMC_TIMING_UHS_SDR50)
		ctrl_2 |= SDHCI_CTRL_UHS_SDR50;
	else if (uhs == MMC_TIMING_UHS_SDR104)
		ctrl_2 |= SDHCI_CTRL_UHS_SDR104;
	else if (uhs == MMC_TIMING_UHS_DDR50)
		ctrl_2 |= SDHCI_CTRL_UHS_DDR50;
	sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);

}

static struct sdhci_ops sdhci_msm_ops = {
	.set_uhs_signaling = sdhci_msm_set_uhs_signaling,
	.check_power_status = sdhci_msm_check_power_status,
	.platform_execute_tuning = sdhci_msm_execute_tuning,
	.toggle_cdr = sdhci_msm_toggle_cdr,