diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-03-16 17:14:02 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2009-03-24 16:30:10 -0400 |
commit | 063a9dbbce5559770b7e2e2f51bd29adf3ab9b1e (patch) | |
tree | 232a9b438c7d0f7649088a31b0b89ef2b61f4205 /drivers/mmc/host | |
parent | 3e3bf20756aeee57a40fd37b923263c9a51b8c68 (diff) |
sdhci: Add quirk for controllers that need IRQ re-init after reset
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>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 7 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index cd6dab34ba54..3a72fe2cf1cf 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -134,6 +134,7 @@ static void sdhci_disable_card_detection(struct sdhci_host *host) | |||
134 | static void sdhci_reset(struct sdhci_host *host, u8 mask) | 134 | static void sdhci_reset(struct sdhci_host *host, u8 mask) |
135 | { | 135 | { |
136 | unsigned long timeout; | 136 | unsigned long timeout; |
137 | u32 uninitialized_var(ier); | ||
137 | 138 | ||
138 | if (host->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { | 139 | if (host->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { |
139 | if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) & | 140 | if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) & |
@@ -141,6 +142,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) | |||
141 | return; | 142 | return; |
142 | } | 143 | } |
143 | 144 | ||
145 | if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET) | ||
146 | ier = sdhci_readl(host, SDHCI_INT_ENABLE); | ||
147 | |||
144 | sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET); | 148 | sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET); |
145 | 149 | ||
146 | if (mask & SDHCI_RESET_ALL) | 150 | if (mask & SDHCI_RESET_ALL) |
@@ -160,6 +164,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) | |||
160 | timeout--; | 164 | timeout--; |
161 | mdelay(1); | 165 | mdelay(1); |
162 | } | 166 | } |
167 | |||
168 | if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET) | ||
169 | sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier); | ||
163 | } | 170 | } |
164 | 171 | ||
165 | static void sdhci_init(struct sdhci_host *host) | 172 | static void sdhci_init(struct sdhci_host *host) |
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index c5ce9ee1a1bc..2962102b6953 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -222,6 +222,8 @@ struct sdhci_host { | |||
222 | #define SDHCI_QUIRK_NONSTANDARD_CLOCK (1<<17) | 222 | #define SDHCI_QUIRK_NONSTANDARD_CLOCK (1<<17) |
223 | /* Controller does not like fast PIO transfers */ | 223 | /* Controller does not like fast PIO transfers */ |
224 | #define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18) | 224 | #define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18) |
225 | /* Controller losing signal/interrupt enable states after reset */ | ||
226 | #define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19) | ||
225 | 227 | ||
226 | int irq; /* Device IRQ */ | 228 | int irq; /* Device IRQ */ |
227 | void __iomem * ioaddr; /* Mapped address */ | 229 | void __iomem * ioaddr; /* Mapped address */ |