From dc7b43dce7dd7de0e042362d5bca5ba1a264905e Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Fri, 20 Nov 2020 10:26:00 +0800 Subject: [PATCH] mmc: sdhci-of-dwcmshc: move rxclk non-invert code to .set_clock() This setting will be lost during deep suspend in case of powering off the controller. So we need to always recovery it when calling resume hook. But .set_clock() will be awlays called whenever the driver's probed or resumed. So we move it there. Change-Id: I65ccc04241db04cf84486a43fe5954f20e3cc95d Signed-off-by: Shawn Lin --- drivers/mmc/host/sdhci-of-dwcmshc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c index 4d8c124e8b16..afbf39aa6d87 100644 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c @@ -134,6 +134,12 @@ static void dwcmshc_rk_set_clock(struct sdhci_host *host, unsigned int clock) int err; host->mmc->actual_clock = 0; + + /* DO NOT TOUCH THIS SETTING */ + extra = DWCMSHC_EMMC_DLL_DLYENA | + DLL_RXCLK_NO_INVERTER << DWCMSHC_EMMC_DLL_RXCLK_SRCSEL; + sdhci_writel(host, extra, DWCMSHC_EMMC_DLL_RXCLK); + if (clock == 0) return; @@ -215,7 +221,6 @@ static const struct sdhci_pltfm_data sdhci_dwcmshc_rk_pdata = { static int rockchip_pltf_init(struct sdhci_host *host, struct dwcmshc_priv *priv) { int err; - u32 extra; priv->rockchip_clks[0].id = "axi"; priv->rockchip_clks[1].id = "block"; @@ -237,9 +242,6 @@ static int rockchip_pltf_init(struct sdhci_host *host, struct dwcmshc_priv *priv &priv->txclk_tapnum)) priv->txclk_tapnum = DLL_TXCLK_TAPNUM_DEFAULT; - extra = DWCMSHC_EMMC_DLL_DLYENA | - DLL_RXCLK_NO_INVERTER << DWCMSHC_EMMC_DLL_RXCLK_SRCSEL; - sdhci_writel(host, extra, DWCMSHC_EMMC_DLL_RXCLK); return 0; }