From: <r66093@freescale.com>
To: linux-mmc@vger.kernel.org
Cc: Jerry Huang <Chang-Ming.Huang@freescale.com>,
Jiang Yutang <b14898@freescale.com>, Chris Ball <cjb@laptop.org>
Subject: [PATCH 3/4 v5] ESDHC: Power management for ESDHC
Date: Mon, 16 Jan 2012 14:13:05 +0800 [thread overview]
Message-ID: <1326694386-28820-4-git-send-email-r66093@freescale.com> (raw)
In-Reply-To: <1326694386-28820-3-git-send-email-r66093@freescale.com>
From: Jerry Huang <Chang-Ming.Huang@freescale.com>
For FSL ESDHC controllor, when enter the sleep, the controller will power off,
therefore the register will lost its valuse, and driver should save value of
register during suspend and used during resume.
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Jiang Yutang <b14898@freescale.com>
CC: Chris Ball <cjb@laptop.org>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
---
changes for v2:
- change the property to compatible for quirks
changes for v3:
- fix one compile error
changes for v4:
- use hooks to suspend/resume the special platform
changes for v5:
- add the Acked-by
drivers/mmc/host/sdhci-of-esdhc.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index c21be67..385a4ff 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -104,6 +104,21 @@ static int esdhc_of_get_cd(struct sdhci_host *host)
return present;
}
+#ifdef CONFIG_PM
+static u32 esdhc_proctl;
+static void esdhc_of_suspend(struct sdhci_host *host)
+{
+ esdhc_proctl = sdhci_be32bs_readl(host, SDHCI_HOST_CONTROL);
+}
+
+static void esdhc_of_resume(struct sdhci_host *host)
+{
+ esdhc_of_enable_dma(host);
+ sdhci_be32bs_writel(host, esdhc_proctl, SDHCI_HOST_CONTROL);
+
+}
+#endif
+
static struct sdhci_ops sdhci_esdhc_ops = {
.read_l = sdhci_be32bs_readl,
.read_w = esdhc_readw,
@@ -116,6 +131,10 @@ static struct sdhci_ops sdhci_esdhc_ops = {
.get_max_clock = esdhc_of_get_max_clock,
.get_min_clock = esdhc_of_get_min_clock,
.get_cd = esdhc_of_get_cd,
+#ifdef CONFIG_PM
+ .platform_suspend = esdhc_of_suspend,
+ .platform_resume = esdhc_of_resume,
+#endif
};
static struct sdhci_pltfm_data sdhci_esdhc_pdata = {
--
1.7.5.4
next prev parent reply other threads:[~2012-01-16 6:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 6:13 [PATCH 0/4] new version workaround for FSL's eSDHC controller r66093
2012-01-16 6:13 ` [PATCH 1/4 v3] ESDHC: add PIO mode support r66093
2012-01-16 6:13 ` [PATCH 2/4 v3] ESDHC: set the timeout to the max value r66093
2012-01-16 6:13 ` r66093 [this message]
2012-01-16 6:13 ` [PATCH 4/4 v5] ESDHC: Workaround for data crc error on p1010rdb r66093
2012-02-04 22:22 ` Chris Ball
2012-02-07 8:03 ` Huang Changming-R66093
2012-02-08 3:34 ` Huang Changming-R66093
2012-02-05 1:18 ` [PATCH 0/4] new version workaround for FSL's eSDHC controller Chris Ball
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=1326694386-28820-4-git-send-email-r66093@freescale.com \
--to=r66093@freescale.com \
--cc=Chang-Ming.Huang@freescale.com \
--cc=b14898@freescale.com \
--cc=cjb@laptop.org \
--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 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).