]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] Change all omap15xx devices to use similar DMA handling than h6300 uses
authorMika Laitio <lamikr@cc.jyu.fi>
Tue, 12 Sep 2006 11:56:10 +0000 (14:56 +0300)
committerTony Lindgren <tony@atomide.com>
Tue, 12 Sep 2006 11:56:10 +0000 (14:56 +0300)
Change all omap15xx devices to use similar DMA handling than h6300 uses.
Thanks for the James Selvam for verifying this with omap 1510 innovator.
http://linux.omap.com/pipermail/linux-omap-open-source/2006-May/007256.html

Signed-off-by: Mika Laitio <lamikr@cc.jyu.fi>
Signed-off-by: Tony Lindgren <tony@atomide.com>
sound/arm/omap/omap-alsa.c

index 328003be2bcaa86c2ede90af9f7d0dd123db83e8..583460cf176838a8f6f8b45a1813d978914f0ad4 100644 (file)
@@ -190,9 +190,7 @@ static void audio_process_dma(struct audio_stream *s)
        unsigned int dma_size;
        unsigned int offset;
        int ret;
-#ifdef CONFIG_MACH_OMAP_H6300
        unsigned long flags;
-#endif
        
        ADEBUG();
        runtime = substream->runtime;
@@ -200,14 +198,20 @@ static void audio_process_dma(struct audio_stream *s)
                dma_size = frames_to_bytes(runtime, runtime->period_size);
                offset = dma_size * s->period;
                snd_assert(dma_size <= DMA_BUF_SIZE,);
-#ifdef CONFIG_MACH_OMAP_H6300
-               spin_lock_irqsave(&s->dma_lock, flags);
-               omap_stop_alsa_sound_dma(s);
-               spin_unlock_irqrestore(&s->dma_lock, flags);
-#endif
+               /*
+                * On omap1510 based devices, we need to call the stop_dma
+                * before calling the start_dma or we will not receive the
+                * irq from DMA after the first transfered/played buffer.
+                * (invocation of callback_omap_alsa_sound_dma() method).
+                */
+               if (cpu_is_omap15xx()) {
+                       spin_lock_irqsave(&s->dma_lock, flags);
+                       omap_stop_alsa_sound_dma(s);
+                       spin_unlock_irqrestore(&s->dma_lock, flags);
+               }
                ret = omap_start_alsa_sound_dma(s,
-                                        (dma_addr_t) runtime->dma_area +
-                                        offset, dma_size);
+                               (dma_addr_t)runtime->dma_area + offset,
+                               dma_size);
                if (ret) {
                        printk(KERN_ERR
                               "audio_process_dma: cannot queue DMA buffer (%i)\n",