Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157668
b: refs/heads/master
c: 471e3de
h: refs/heads/master
v: v3
  • Loading branch information
Janusz Krzysztofik authored and Mark Brown committed Aug 17, 2009
1 parent c9d92b6 commit 3588ba0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64844a6ac8ddd586cb832fea7cf2e93e5e7e03f4
refs/heads/master: 471e3dec3abe2d41e8c742046353fcb01bc2459e
22 changes: 20 additions & 2 deletions trunk/sound/soc/omap/omap-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,21 @@ static void omap_pcm_dma_irq(int ch, u16 stat, void *data)
* that can be used by omap_pcm_pointer() instead.
*/
spin_lock_irqsave(&prtd->lock, flags);
if ((stat == OMAP_DMA_LAST_IRQ) &&
(prtd->period_index == runtime->periods - 1)) {
/* we are in sync, do nothing */
spin_unlock_irqrestore(&prtd->lock, flags);
return;
}
if (prtd->period_index >= 0) {
if (++prtd->period_index == runtime->periods) {
if (stat & OMAP_DMA_BLOCK_IRQ) {
/* end of buffer reached, loop back */
prtd->period_index = 0;
} else if (stat & OMAP_DMA_LAST_IRQ) {
/* update the counter for the last period */
prtd->period_index = runtime->periods - 1;
} else if (++prtd->period_index >= runtime->periods) {
/* end of buffer missed? loop back */
prtd->period_index = 0;
}
}
Expand Down Expand Up @@ -175,7 +188,12 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
dma_params.frame_count = runtime->periods;
omap_set_dma_params(prtd->dma_ch, &dma_params);

omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ);
if ((cpu_is_omap1510()) &&
(substream->stream == SNDRV_PCM_STREAM_PLAYBACK))
omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ |
OMAP_DMA_LAST_IRQ | OMAP_DMA_BLOCK_IRQ);
else
omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ);

return 0;
}
Expand Down

0 comments on commit 3588ba0

Please sign in to comment.