aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/omap-pcm.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 3e3a9d478c0d..12e14c01068e 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -68,8 +68,21 @@ static void omap_pcm_dma_irq(int ch, u16 stat, void *data)
68 * that can be used by omap_pcm_pointer() instead. 68 * that can be used by omap_pcm_pointer() instead.
69 */ 69 */
70 spin_lock_irqsave(&prtd->lock, flags); 70 spin_lock_irqsave(&prtd->lock, flags);
71 if ((stat == OMAP_DMA_LAST_IRQ) &&
72 (prtd->period_index == runtime->periods - 1)) {
73 /* we are in sync, do nothing */
74 spin_unlock_irqrestore(&prtd->lock, flags);
75 return;
76 }
71 if (prtd->period_index >= 0) { 77 if (prtd->period_index >= 0) {
72 if (++prtd->period_index == runtime->periods) { 78 if (stat & OMAP_DMA_BLOCK_IRQ) {
79 /* end of buffer reached, loop back */
80 prtd->period_index = 0;
81 } else if (stat & OMAP_DMA_LAST_IRQ) {
82 /* update the counter for the last period */
83 prtd->period_index = runtime->periods - 1;
84 } else if (++prtd->period_index >= runtime->periods) {
85 /* end of buffer missed? loop back */
73 prtd->period_index = 0; 86 prtd->period_index = 0;
74 } 87 }
75 } 88 }
@@ -175,7 +188,12 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
175 dma_params.frame_count = runtime->periods; 188 dma_params.frame_count = runtime->periods;
176 omap_set_dma_params(prtd->dma_ch, &dma_params); 189 omap_set_dma_params(prtd->dma_ch, &dma_params);
177 190
178 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ); 191 if ((cpu_is_omap1510()) &&
192 (substream->stream == SNDRV_PCM_STREAM_PLAYBACK))
193 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ |
194 OMAP_DMA_LAST_IRQ | OMAP_DMA_BLOCK_IRQ);
195 else
196 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ);
179 197
180 return 0; 198 return 0;
181} 199}