diff mbox

SDHCI: Suspend/Resume needs to save/restore INT_ENABLE on ARM/Tegra2

Message ID 20110308213921.00625208186@grundler.mtv.corp.google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Grant Grundler March 8, 2011, 9:39 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 3c6358f..68d2e36 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1654,6 +1654,8 @@  int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state)
 	if (mmc->card && (mmc->card->type != MMC_TYPE_SDIO))
 		ret = mmc_suspend_host(host->mmc);
 
+	/* Save the original intmask to restore later */
+	host->save_intmask = sdhci_readl(host, SDHCI_INT_ENABLE);
 	sdhci_mask_irqs(host, SDHCI_INT_ALL_MASK);
 
 	if (host->vmmc)
@@ -1695,6 +1697,9 @@  int sdhci_resume_host(struct sdhci_host *host)
 
 	sdhci_enable_card_detection(host);
 
+	/* Restore the original intmask */
+	sdhci_unmask_irqs(host, host->save_intmask);
+
 	return ret;
 }
 
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index dfb2106..5b9f6db 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -141,6 +141,8 @@  struct sdhci_host {
 
 	unsigned int caps;	/* Alternative capabilities */
 
+	unsigned int save_intmask;    /* Store original intmask */
+
 	unsigned long private[0] ____cacheline_aligned;
 };
 #endif /* __SDHCI_H */