]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Reset DMA channels in init and add support for 330
authorRomain Goyet <r.goyet@gmail.com>
Thu, 15 Sep 2005 07:14:37 +0000 (10:14 +0300)
committerTony Lindgren <tony@atomide.com>
Thu, 15 Sep 2005 07:14:37 +0000 (10:14 +0300)
Reset DMA channels in init and add support for 330

arch/arm/plat-omap/dma.c

index da7b6514565884e894d82f729ee38274d63ae46d..76f9ed4773082c96f840bccf0ef422524fc8a736 100644 (file)
@@ -951,7 +951,7 @@ void omap_clear_dma(int lch)
        local_irq_save(flags);
        omap_writew(omap_readw(OMAP_DMA_CCR(lch)) & ~OMAP_DMA_CCR_EN,
                    OMAP_DMA_CCR(lch));
-       status = OMAP_DMA_CSR(lch);     /* clear pending interrupts */
+       status = omap_readw(OMAP_DMA_CSR(lch)); /* clear pending interrupts */
        local_irq_restore(flags);
 }
 
@@ -1016,8 +1016,8 @@ static int __init omap_init_dma(void)
 {
        int ch, r;
 
-       if (cpu_is_omap1510()) {
-               printk(KERN_INFO "DMA support for OMAP1510 initialized\n");
+       if (cpu_is_omap15xx()) {
+               printk(KERN_INFO "DMA support for OMAP15xx initialized\n");
                dma_chan_count = 9;
                enable_1510_mode = 1;
        } else if (cpu_is_omap16xx() || cpu_is_omap730()) {
@@ -1048,6 +1048,10 @@ static int __init omap_init_dma(void)
        spin_lock_init(&dma_chan_lock);
        memset(&dma_chan, 0, sizeof(dma_chan));
 
+       /* Disable and clear all DMA channels to avoid spurious IRQ */
+       for (ch = 0; ch < dma_chan_count; ch++) {
+               omap_clear_dma(ch);
+       }
        for (ch = 0; ch < dma_chan_count; ch++) {
                dma_chan[ch].dev_id = -1;
                dma_chan[ch].next_lch = -1;