aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-03-10 12:43:07 -0500
committerChris Ball <cjb@laptop.org>2011-03-25 10:39:56 -0400
commitd9b03421775d5cf8b4d5518a3e80b28cf3f999ce (patch)
treeccba01a449585df5a5e3d999687b797ad5e2cafa
parentd80e9221742235ebfcbe85e3899603ab2b716749 (diff)
mmc: tmio: remove work-around for unmasked SDIO interrupts
SDIO IRQs got unmasked on sh-mobile while writing to the CTL_CLK_AND_WAIT_CTL register, because that register at address 0x138 is not implemented on those SoCs and writes to it overwrite the register at address 0x38: CTL_SDIO_IRQ_MASK. Previous patches eliminated access to register above 0xff on sh-mobile, so that this work-around isn't needed anymore. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/tmio_mmc_pio.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 28e14c7a2540..e1aed2555126 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -208,26 +208,14 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
208 208
209static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) 209static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
210{ 210{
211 struct tmio_mmc_data *pdata = host->pdata;
212 struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0); 211 struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
213 212
214 /*
215 * Testing on sh-mobile showed that SDIO IRQs are unmasked when
216 * CTL_CLK_AND_WAIT_CTL gets written, so we have to disable the
217 * device IRQ here and restore the SDIO IRQ mask before
218 * re-enabling the device IRQ.
219 */
220 if (pdata->flags & TMIO_MMC_SDIO_IRQ)
221 disable_irq(host->irq);
222 /* implicit BUG_ON(!res) */ 213 /* implicit BUG_ON(!res) */
223 if (resource_size(res) > 0x100) { 214 if (resource_size(res) > 0x100) {
224 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000); 215 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
225 msleep(10); 216 msleep(10);
226 } 217 }
227 if (pdata->flags & TMIO_MMC_SDIO_IRQ) { 218
228 tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
229 enable_irq(host->irq);
230 }
231 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~0x0100 & 219 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~0x0100 &
232 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); 220 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
233 msleep(10); 221 msleep(10);
@@ -235,24 +223,17 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
235 223
236static void tmio_mmc_clk_start(struct tmio_mmc_host *host) 224static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
237{ 225{
238 struct tmio_mmc_data *pdata = host->pdata;
239 struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0); 226 struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
240 227
241 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 | 228 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
242 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); 229 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
243 msleep(10); 230 msleep(10);
244 /* see comment in tmio_mmc_clk_stop above */ 231
245 if (pdata->flags & TMIO_MMC_SDIO_IRQ)
246 disable_irq(host->irq);
247 /* implicit BUG_ON(!res) */ 232 /* implicit BUG_ON(!res) */
248 if (resource_size(res) > 0x100) { 233 if (resource_size(res) > 0x100) {
249 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100); 234 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
250 msleep(10); 235 msleep(10);
251 } 236 }
252 if (pdata->flags & TMIO_MMC_SDIO_IRQ) {
253 tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
254 enable_irq(host->irq);
255 }
256} 237}
257 238
258static void tmio_mmc_reset(struct tmio_mmc_host *host) 239static void tmio_mmc_reset(struct tmio_mmc_host *host)