Skip to content

Commit

Permalink
mmc: sdhci-esdhc-imx: restore pin state when resume back
Browse files Browse the repository at this point in the history
In some low power mode, SoC will lose the pin state, so need to restore
the pin state when resume back.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://lore.kernel.org/r/1582100757-20683-8-git-send-email-haibo.chen@nxp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Haibo Chen authored and Ulf Hansson committed Mar 24, 2020
1 parent e534b82 commit af8fade
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/mmc/host/sdhci-esdhc-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1731,14 +1731,22 @@ static int sdhci_esdhc_suspend(struct device *dev)
if (host->tuning_mode != SDHCI_TUNING_MODE_3)
mmc_retune_needed(host->mmc);

return sdhci_suspend_host(host);
ret = sdhci_suspend_host(host);
if (!ret)
return pinctrl_pm_select_sleep_state(dev);

return ret;
}

static int sdhci_esdhc_resume(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
int ret;

ret = pinctrl_pm_select_default_state(dev);
if (ret)
return ret;

/* re-initialize hw state in case it's lost in low power mode */
sdhci_esdhc_imx_hwinit(host);

Expand Down

0 comments on commit af8fade

Please sign in to comment.