From: Adrian Hunter <adrian.hunter@intel.com>
To: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org, Adrian Hunter <adrian.hunter@intel.com>
Subject: [PATCH 3/4] mmc: sdhci: add quirk for keeping card power during suspend
Date: Tue, 7 Feb 2012 14:48:54 +0200 [thread overview]
Message-ID: <1328618935-25175-4-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1328618935-25175-1-git-send-email-adrian.hunter@intel.com>
Add quirk SDHCI_QUIRK2_HOST_OFF_CARD_ON to cater for the
case when the card keeps power during suspend but the
host controller does not i.e. the card power is not
controlled by the host controller. In that case, the
controller must be fully reset on resume.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci.c | 13 +++++++++++--
include/linux/mmc/sdhci.h | 2 ++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 1f5888b..80cc784 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2426,8 +2426,17 @@ int sdhci_resume_host(struct sdhci_host *host)
if (ret)
return ret;
- sdhci_init(host, (host->mmc->pm_flags & MMC_PM_KEEP_POWER));
- mmiowb();
+ if ((host->mmc->pm_flags & MMC_PM_KEEP_POWER) &&
+ (host->quirks2 & SDHCI_QUIRK2_HOST_OFF_CARD_ON)) {
+ /* Card keeps power but host controller does not */
+ sdhci_init(host, 0);
+ host->pwr = 0;
+ host->clock = 0;
+ sdhci_do_set_ios(host, &host->mmc->ios);
+ } else {
+ sdhci_init(host, (host->mmc->pm_flags & MMC_PM_KEEP_POWER));
+ mmiowb();
+ }
ret = mmc_resume_host(host->mmc);
sdhci_enable_card_detection(host);
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index c750f85..e9051e1 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -90,6 +90,8 @@ struct sdhci_host {
unsigned int quirks2; /* More deviations from spec. */
+#define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0)
+
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */
--
1.7.6.4
next prev parent reply other threads:[~2012-02-07 12:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 12:48 [PATCH 0/4] mmc: add a cap and a quirk Adrian Hunter
2012-02-07 12:48 ` [PATCH 1/4] mmc: core: add high-capacity erase size capability flag Adrian Hunter
2012-02-08 16:32 ` Ulf Hansson
2012-02-09 7:12 ` Adrian Hunter
2012-02-08 22:38 ` Linus Walleij
2012-02-09 7:02 ` Adrian Hunter
2012-02-07 12:48 ` [PATCH 2/4] mmc: sdhci-pci: select HC erase size for Medfield eMMC Adrian Hunter
2012-02-07 12:48 ` Adrian Hunter [this message]
2012-02-07 12:48 ` [PATCH 4/4] mmc: sdhci-pci: add SDHCI_QUIRK2_HOST_OFF_CARD_ON for Medfield SDIO Adrian Hunter
2012-03-13 6:41 ` [PATCH 0/4] mmc: add a cap and a quirk Adrian Hunter
2012-03-13 9:35 ` 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=1328618935-25175-4-git-send-email-adrian.hunter@intel.com \
--to=adrian.hunter@intel.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).