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

Commit d2ad7697 authored by Ritesh Harjani's avatar Ritesh Harjani Committed by Pavan Anamula
Browse files

mmc: sdhci-msm: Correct the CDR toggle logic



We should keep either one of CDR_EN or CDR_EXT_EN enabled.
So correct this logic in toggle CDR function.

CRs-fixed: 759398
Change-Id: Ic137ae2a28e912ab131644ff9d81e41f4256dd05
Signed-off-by: default avatarRitesh Harjani <riteshh@codeaurora.org>
Signed-off-by: default avatarPavan Anamula <pavana@codeaurora.org>
parent 99d0928b
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -2304,14 +2304,17 @@ static void sdhci_msm_check_power_status(struct sdhci_host *host, u32 req_type)

static void sdhci_msm_toggle_cdr(struct sdhci_host *host, bool enable)
{
	if (enable)
		writel_relaxed((readl_relaxed(host->ioaddr +
					      CORE_DLL_CONFIG) | CORE_CDR_EN),
			       host->ioaddr + CORE_DLL_CONFIG);
	else
		writel_relaxed((readl_relaxed(host->ioaddr +
					      CORE_DLL_CONFIG) & ~CORE_CDR_EN),
			       host->ioaddr + CORE_DLL_CONFIG);
	u32 config = readl_relaxed(host->ioaddr + CORE_DLL_CONFIG);

	if (enable) {
		config |= CORE_CDR_EN;
		config &= ~CORE_CDR_EXT_EN;
		writel_relaxed(config, host->ioaddr + CORE_DLL_CONFIG);
	} else {
		config &= ~CORE_CDR_EN;
		config |= CORE_CDR_EXT_EN;
		writel_relaxed(config, host->ioaddr + CORE_DLL_CONFIG);
	}
}

static unsigned int sdhci_msm_max_segs(void)