All of lore.kernel.org
 help / color / mirror / Atom feed
From: haibo.chen@nxp.com
To: adrian.hunter@intel.com, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org
Cc: linux-imx@nxp.com, haibo.chen@nxp.com, linus.walleij@linaro.org
Subject: [PATCH v4 13/14] mmc: sdhci-esdhc-imx: restore pin state when resume back
Date: Wed, 19 Feb 2020 16:25:56 +0800	[thread overview]
Message-ID: <1582100757-20683-8-git-send-email-haibo.chen@nxp.com> (raw)
In-Reply-To: <1582100757-20683-1-git-send-email-haibo.chen@nxp.com>

From: Haibo Chen <haibo.chen@nxp.com>

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>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 786305309eb0..b38b9d7f0a0d 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1731,7 +1731,11 @@ 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)
@@ -1739,6 +1743,10 @@ 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);
 
-- 
2.17.1


  parent reply	other threads:[~2020-02-19  8:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19  8:25 [PATCH v4 06/14] mmc: sdhci-esdhc-imx: add strobe-dll-delay-target support haibo.chen
2020-02-19  8:25 ` [PATCH v4 07/14] mmc: sdhci-esdhc-imx: optimize the clock setting haibo.chen
2020-02-19  8:25 ` [PATCH v4 08/14] mmc: sdhci-esdhc-imx: optimize the strobe dll setting haibo.chen
2020-02-19  8:25 ` [PATCH v4 09/14] mmc: sdhci-esdhc-imx: add flag ESDHC_FLAG_BROKEN_AUTO_CMD23 haibo.chen
2020-02-19  8:25 ` [PATCH v4 10/14] mmc: sdhci-esdhc-imx: Add an new esdhc_soc_data for i.MX8MM haibo.chen
2020-02-19  8:25 ` [PATCH v4 11/14] mmc: sdhci-esdhc-imx: clear pending interrupt and halt cqhci haibo.chen
2020-02-19  8:25 ` [PATCH v4 12/14] mmc: sdhci-esdhc-imx: clear DMA_SEL when disable DMA mode haibo.chen
2020-02-19  8:25 ` haibo.chen [this message]
2020-02-19  8:25 ` [PATCH v4 14/14] mmc: queue: create dev->dma_parms before call dma_set_max_seg_size() haibo.chen
2020-03-04 13:32   ` Ulf Hansson
2020-03-04 16:28     ` Christoph Hellwig
2020-03-05 10:52       ` Ulf Hansson
2020-03-05 15:22         ` Christoph Hellwig
2020-03-05 14:29       ` Linus Walleij
2020-03-05 14:45         ` Arnd Bergmann
2020-03-05 15:03           ` Linus Walleij
2020-03-05 15:31             ` Arnd Bergmann
2020-03-05 15:23         ` Christoph Hellwig
2020-03-06 14:02           ` Ulf Hansson
2020-03-06 14:19             ` Christoph Hellwig
2020-03-11  9:31               ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1582100757-20683-8-git-send-email-haibo.chen@nxp.com \
    --to=haibo.chen@nxp.com \
    --cc=adrian.hunter@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.