From cab82c3a83bbc0c9180bc04237001423161b3245 Mon Sep 17 00:00:00 2001 From: Dong Aisheng Date: Thu, 11 May 2017 20:38:17 +0800 Subject: [PATCH] MLK-14774 mmc: sdhci-esdhc-imx: restore pins state after suspend After commit 3e3274ab9ff3 ("mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host()"), we lost the pins state store and save in common sdhci_pltfm_{suspend|resume} API which results in the pins state lost in state un-retainable suspend/resume, then CMD transfer will meet timeout subsequently. Due to sdhci_pltfm_{suspend|resume} API becomes static after that commit later, we then do manual pins state save and restore in our platform suspend/resume API instead. Signed-off-by: Dong Aisheng --- drivers/mmc/host/sdhci-esdhc-imx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 4f5ee6a86254..69967212be12 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1442,6 +1442,7 @@ static int sdhci_esdhc_suspend(struct device *dev) struct sdhci_host *host = dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); + int ret; #ifdef CONFIG_PM pm_runtime_get_sync(host->mmc->parent); @@ -1453,7 +1454,11 @@ static int sdhci_esdhc_suspend(struct device *dev) mmc_retune_needed(host->mmc); } - return sdhci_suspend_host(host); + ret = sdhci_suspend_host(host); + + pinctrl_pm_select_sleep_state(dev); + + return ret; } static int sdhci_esdhc_resume(struct device *dev) @@ -1461,6 +1466,8 @@ static int sdhci_esdhc_resume(struct device *dev) struct sdhci_host *host = dev_get_drvdata(dev); int ret; + pinctrl_pm_select_default_state(dev); + /* re-initialize hw state in case it's lost in low power mode */ sdhci_esdhc_imx_hwinit(host); -- 2.17.1