]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sdhci: Add quirk for controllers that need IRQ re-init after reset
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Mon, 16 Mar 2009 21:14:02 +0000 (00:14 +0300)
committerPierre Ossman <drzeus@drzeus.cx>
Tue, 24 Mar 2009 20:30:10 +0000 (21:30 +0100)
FSL eSDHC controllers losing signal/interrupt enable states after
reset, so we should re-enable them.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h

index cd6dab34ba54d21f046d21874f050092e5ce65fd..3a72fe2cf1cf0d11a58d50a15a803554315cbd49 100644 (file)
@@ -134,6 +134,7 @@ static void sdhci_disable_card_detection(struct sdhci_host *host)
 static void sdhci_reset(struct sdhci_host *host, u8 mask)
 {
        unsigned long timeout;
+       u32 uninitialized_var(ier);
 
        if (host->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) {
                if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
@@ -141,6 +142,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask)
                        return;
        }
 
+       if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
+               ier = sdhci_readl(host, SDHCI_INT_ENABLE);
+
        sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET);
 
        if (mask & SDHCI_RESET_ALL)
@@ -160,6 +164,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask)
                timeout--;
                mdelay(1);
        }
+
+       if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
+               sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);
 }
 
 static void sdhci_init(struct sdhci_host *host)
index c5ce9ee1a1bc63ceb5f72726fcfc79910f389418..2962102b6953f6451a9e23089d6628aa35463da7 100644 (file)
@@ -222,6 +222,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_NONSTANDARD_CLOCK                  (1<<17)
 /* Controller does not like fast PIO transfers */
 #define SDHCI_QUIRK_PIO_NEEDS_DELAY                    (1<<18)
+/* Controller losing signal/interrupt enable states after reset */
+#define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET           (1<<19)
 
        int                     irq;            /* Device IRQ */
        void __iomem *          ioaddr;         /* Mapped address */