Skip to contentSkip to conversation

ASoC: omap-pcm: Fix the no period wakeup implementation

PATCH Applied Peter Ujfalusi 3 participants 4 messages Oct 4, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: omap-pcm: Fix the no period wakeup implementation

After omap_request_dma the BLOCK_IRQ is enabled as default configuration for the channel.
If we are requested for no period wakeup, we need to disable the BLOCK_IRQ in order to not receive any interrupts.

---
 sound/soc/omap/omap-pcm.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
sound/soc/omap/omap-pcm.c +8 -0
index 9b5c88a..5e37ec9 100644
@@ -198,6 +198,14 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
 			      OMAP_DMA_LAST_IRQ | OMAP_DMA_BLOCK_IRQ);
 	else if (!substream->runtime->no_period_wakeup)
 		omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ);
+	else {
+		/*
+		 * No period wakeup:
+		 * we need to disable BLOCK_IRQ, which is enabled by the omap
+		 * dma core at request dma time.
+		 */
+		omap_disable_dma_irq(prtd->dma_ch, OMAP_DMA_BLOCK_IRQ);
+	}
 
 	if (!(cpu_class_is_omap1())) {
 		omap_set_dma_src_burst_mode(prtd->dma_ch,
Signature · 1 line
1.7.7
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Peter Ujfalusi

After omap_request_dma the BLOCK_IRQ is enabled as default configuration for the channel.
If we are requested for no period wakeup, we need to disable the BLOCK_IRQ in order to not receive any interrupts.

---
  sound/soc/omap/omap-pcm.c |    8 ++++++++
  1 files changed, 8 insertions(+), 0 deletions(-)
sound/soc/omap/omap-pcm.c +0 -0
index 9b5c88a..5e37ec9 100644
@@ -198,6 +198,14 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
  			      OMAP_DMA_LAST_IRQ | OMAP_DMA_BLOCK_IRQ);
  	else if (!substream->runtime->no_period_wakeup)

sound/soc/omap/omap-pcm.c static int omap_pcm_prepare(struct snd_pcm_substream *substream) · line 209

Quoted 10 lines
sound/soc/omap/omap-pcm.c +8 -0
  		omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ);
+	else {
+		/*
+		 * No period wakeup:
+		 * we need to disable BLOCK_IRQ, which is enabled by the omap
+		 * dma core at request dma time.
+		 */
+		omap_disable_dma_irq(prtd->dma_ch, OMAP_DMA_BLOCK_IRQ);
+	}
 

while it would be more clear to fix this in omap dma core.

#2 lore raw
Quoted 4 lines · On Tuesday 04 October 2011 11:34:28 Jarkko Nikula wrote:

while it would be more clear to fix this in omap dma core.

I have thought about that.. however, the only configuration, where we do not need the BLOCK_IRQ is in audio, and only when we are running in 'no period wakeup' mode.
In all other cases we need to have the BLOCK_IRQ enabled.
I have looked at the other OMAP drivers, which uses the DMA and all assumes, that the BLOCK_IRQ is enabled out of box.

We can modify all OMAP drivers, and the dma core, or we can just disable the BLOCK_IRQ at the only case, when it is not needed.

--
Péter

Applied
#3 lore raw
In reply to Peter Ujfalusi
Quoted 4 lines · Peter Ujfalusi

After omap_request_dma the BLOCK_IRQ is enabled as default configuration for the channel.
If we are requested for no period wakeup, we need to disable the BLOCK_IRQ in order to not receive any interrupts.

Applied, thanks.