dect
/
linux-2.6
Archived
13
0
Fork 0

mmc: sdhci: add quirk for keeping card power during suspend

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>
Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
Adrian Hunter 2012-02-07 14:48:54 +02:00 committed by Chris Ball
parent da721cf780
commit 6308d2905b
2 changed files with 13 additions and 2 deletions

View File

@ -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);

View File

@ -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 */