From: Jaehoon Chung <jh80.chung@samsung.com>
To: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: Chris Ball <cjb@laptop.org>, Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH] mmc: sdhci: fixed regulator control when suspend/resume
Date: Thu, 07 Apr 2011 13:23:52 +0900 [thread overview]
Message-ID: <4D9D3C58.5030901@samsung.com> (raw)
Suspend/resume is working always enable regulator after resuming.
(if there is host->vmmc)
I assume that if regulator is enabled, card is inserted.
Then We need to restore "vmmc".
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/mmc/host/sdhci.c | 8 +++++---
include/linux/mmc/sdhci.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 9e15f41..70cbbd6 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1663,8 +1663,10 @@ int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state)
free_irq(host->irq, host);
- if (host->vmmc)
+ if (host->vmmc && regulator_is_enabled(host->vmmc)) {
ret = regulator_disable(host->vmmc);
+ host->restore_vmmc = true;
+ }
return ret;
}
@@ -1675,8 +1677,8 @@ int sdhci_resume_host(struct sdhci_host *host)
{
int ret;
- if (host->vmmc) {
- int ret = regulator_enable(host->vmmc);
+ if (host->vmmc && host->restore_vmmc) {
+ ret = regulator_enable(host->vmmc);
if (ret)
return ret;
}
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 83bd9f7..1c38261 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -92,6 +92,7 @@ struct sdhci_host {
const struct sdhci_ops *ops; /* Low level hw interface */
struct regulator *vmmc; /* Power regulator */
+ bool restore_vmmc; /* Restore vmmc */
/* Internal data */
struct mmc_host *mmc; /* MMC structure */
--
next reply other threads:[~2011-04-07 4:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 4:23 Jaehoon Chung [this message]
2011-04-08 18:47 ` [PATCH] mmc: sdhci: fixed regulator control when suspend/resume Wolfram Sang
2011-04-09 11:44 ` Jae hoon Chung
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=4D9D3C58.5030901@samsung.com \
--to=jh80.chung@samsung.com \
--cc=cjb@laptop.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-mmc@vger.kernel.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.