linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ulf.hansson@linaro.org (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 2/4] mmc: mmci: Use optional sleep pinctrl state
Date: Tue,  3 Sep 2013 11:29:34 +0200	[thread overview]
Message-ID: <1378200576-13413-3-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1378200576-13413-1-git-send-email-ulf.hansson@linaro.org>

By optionally putting the pins into sleep state in the .runtime_suspend
callback we can accomplish two things. One is to minimize current leakage
from pins and thus save power, second we can prevent the IP from driving
pins output in an uncontrolled manner, which may happen if the power domain
drops the domain regulator.

When returning from idle, entering .runtime_resume callback, the pins
are restored to default state.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Rickard Andersson <rickard.andersson@stericsson.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/host/mmci.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 5dffbbd..c550b3e 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1750,6 +1750,7 @@ static int mmci_runtime_suspend(struct device *dev)
 
 	if (mmc) {
 		struct mmci_host *host = mmc_priv(mmc);
+		pinctrl_pm_select_sleep_state(dev);
 		clk_disable_unprepare(host->clk);
 	}
 
@@ -1764,6 +1765,7 @@ static int mmci_runtime_resume(struct device *dev)
 	if (mmc) {
 		struct mmci_host *host = mmc_priv(mmc);
 		clk_prepare_enable(host->clk);
+		pinctrl_pm_select_default_state(dev);
 	}
 
 	return 0;
-- 
1.7.9.5

  parent reply	other threads:[~2013-09-03  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03  9:29 [PATCH V3 0/4] mmc: mmci: Support ap_sleep in cpuidle for ux500 Ulf Hansson
2013-09-03  9:29 ` [PATCH V3 1/4] mmc: mmci: Adapt to new pinctrl handling Ulf Hansson
2013-09-04  5:42   ` Linus Walleij
2013-09-03  9:29 ` Ulf Hansson [this message]
2013-09-04  5:43   ` [PATCH V3 2/4] mmc: mmci: Use optional sleep pinctrl state Linus Walleij
2013-09-03  9:29 ` [PATCH V3 3/4] mmc: mmci: Adapt to register write restrictions Ulf Hansson
2013-09-03  9:50   ` Daniel Lezcano
2013-09-03 11:56     ` Ulf Hansson
2013-09-03  9:29 ` [PATCH V3 4/4] mmc: mmci: Save and restore register context Ulf Hansson
2013-09-03  9:53   ` Daniel Lezcano

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=1378200576-13413-3-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).