summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorGary King <gking@nvidia.com>2009-12-07 19:20:38 -0800
committerGary King <gking@nvidia.com>2009-12-08 13:52:49 -0800
commit43179bd75fa0a0bfe1f4a4c9f73bacc795d63190 (patch)
tree455160aa7f339ebd98fcc028f2932db6af7f7884 /drivers/mmc
parentee565dd759da88ba98ad0b874c7d47de7515003d (diff)
sdhci: add ENABLE_INTERRUPT_AT_BLOCK_GAP quirk
some controllers need to have INTERRUPT_AT_BLOCK_GAP enabled to detect card interrupts in SDIO mode
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c9
-rw-r--r--drivers/mmc/host/sdhci.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 245d3cfab2a9..6179b358a390 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1130,6 +1130,15 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
writel(ier, host->ioaddr + SDHCI_INT_ENABLE);
writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
+ if (host->quirks & SDHCI_QUIRK_ENABLE_INTERRUPT_AT_BLOCK_GAP) {
+ u8 gap_ctrl = readb(host->ioaddr + SDHCI_BLOCK_GAP_CONTROL);
+ if (enable)
+ gap_ctrl |= 0x8;
+ else
+ gap_ctrl &= ~0x8;
+ writeb(gap_ctrl, host->ioaddr + SDHCI_BLOCK_GAP_CONTROL);
+ }
+
out:
mmiowb();
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 99d05bd4ff1f..5b23b3de5810 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -212,6 +212,8 @@ struct sdhci_host {
#define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14)
/* Controller write protect bit is broken. Assume no write protection */
#define SDHCI_QUIRK_BROKEN_WRITE_PROTECT (1<<15)
+/* Controller needs INTERRUPT_AT_BLOCK_GAP enabled to detect card interrupts */
+#define SDHCI_QUIRK_ENABLE_INTERRUPT_AT_BLOCK_GAP (1<<16)
int irq; /* Device IRQ */
void __iomem * ioaddr; /* Mapped address */