Linux-mmc Archive on lore.kernel.org
 help / color / Atom feed
From: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
To: adrian.hunter@intel.com, ulf.hansson@linaro.org,
	bjorn.andersson@linaro.org
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	Veerabhadrarao Badiganti <vbadigan@codeaurora.org>,
	Andy Gross <agross@kernel.org>
Subject: [PATCH V1] mmc: sdhci-msm: Set IO pins in low power state during suspend
Date: Wed,  8 Jul 2020 18:41:20 +0530
Message-ID: <1594213888-2780-2-git-send-email-vbadigan@codeaurora.org> (raw)
In-Reply-To: <1594213888-2780-1-git-send-email-vbadigan@codeaurora.org>

Configure SDHC IO pins with low power configuration when the driver
is in suspend state.

Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
---
 drivers/mmc/host/sdhci-msm.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 392d41d57a6e..efd2bae1430c 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -15,6 +15,7 @@
 #include <linux/iopoll.h>
 #include <linux/regulator/consumer.h>
 #include <linux/interconnect.h>
+#include <linux/pinctrl/consumer.h>
 
 #include "sdhci-pltfm.h"
 #include "cqhci.h"
@@ -1352,6 +1353,19 @@ static void sdhci_msm_set_uhs_signaling(struct sdhci_host *host,
 		sdhci_msm_hs400(host, &mmc->ios);
 }
 
+static int sdhci_msm_set_pincfg(struct sdhci_msm_host *msm_host, bool level)
+{
+	struct platform_device *pdev = msm_host->pdev;
+	int ret;
+
+	if (level)
+		ret = pinctrl_pm_select_default_state(&pdev->dev);
+	else
+		ret = pinctrl_pm_select_sleep_state(&pdev->dev);
+
+	return ret;
+}
+
 static int sdhci_msm_set_vmmc(struct mmc_host *mmc)
 {
 	if (IS_ERR(mmc->supply.vmmc))
@@ -1596,6 +1610,9 @@ static void sdhci_msm_handle_pwr_irq(struct sdhci_host *host, int irq)
 			ret = sdhci_msm_set_vqmmc(msm_host, mmc,
 					pwr_state & REQ_BUS_ON);
 		if (!ret)
+			ret = sdhci_msm_set_pincfg(msm_host,
+					pwr_state & REQ_BUS_ON);
+		if (!ret)
 			irq_ack |= CORE_PWRCTL_BUS_SUCCESS;
 		else
 			irq_ack |= CORE_PWRCTL_BUS_FAIL;
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project


  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 13:11 [PATCH V1] mmc: sdhci-msm: Override DLL_CONFIG only if the valid value is supplied Veerabhadrarao Badiganti
2020-07-08 13:11 ` Veerabhadrarao Badiganti [this message]
2020-07-08 13:33   ` [PATCH V1] mmc: sdhci-msm: Set IO pins in low power state during suspend Ulf Hansson
2020-07-10  0:52   ` Matthias Kaehlcke
2020-07-10 10:58     ` Veerabhadrarao Badiganti
2020-07-11  0:19       ` Matthias Kaehlcke
2020-07-13 15:56         ` Veerabhadrarao Badiganti
2020-07-14 14:12           ` Veerabhadrarao Badiganti
2020-07-24  9:36             ` Ulf Hansson
2020-07-27 10:21               ` Veerabhadrarao Badiganti
2020-07-08 13:33 ` [PATCH V1] mmc: sdhci-msm: Override DLL_CONFIG only if the valid value is supplied 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=1594213888-2780-2-git-send-email-vbadigan@codeaurora.org \
    --to=vbadigan@codeaurora.org \
    --cc=adrian.hunter@intel.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

Linux-mmc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mmc/0 linux-mmc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mmc linux-mmc/ https://lore.kernel.org/linux-mmc \
		linux-mmc@vger.kernel.org
	public-inbox-index linux-mmc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mmc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git