Skip to contentSkip to conversation

ASoC: generic-dmaengine-pcm: Set BATCH flag when residue reporting is not supported

PATCH Applied Lars-Peter Clausen 2 participants 2 messages Nov 30, 2013 – Dec 2, 2013

Subsystems (3)
lore
Share & tools
lore

Lars-Peter Clausen

author maintainer
#0 lore raw

PATCH 1/1 ASoC: generic-dmaengine-pcm: Set BATCH flag when residue reporting is not supported

For dmaengine drivers which do not support transfer residue reporting we update the PCM pointer with period granularity. Set the SNDRV_PCM_INFO_BATCH flag in this case to let userspace know about this.

---
 sound/soc/soc-generic-dmaengine-pcm.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/soc-generic-dmaengine-pcm.c +3 -0
index cbc9c96..87e8635 100644
@@ -137,6 +137,9 @@ static int dmaengine_pcm_set_runtime_hwparams(struct snd_pcm_substream *substrea
 	hw.buffer_bytes_max = SIZE_MAX;
 	hw.fifo_size = dma_data->fifo_size;
 
+	if (pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_RESIDUE)
+		hw.info |= SNDRV_PCM_INFO_BATCH;
+
 	ret = dma_get_slave_caps(chan, &dma_caps);
 	if (ret == 0) {
 		if (dma_caps.cmd_pause)
Signature · 1 line
1.8.0
maintainer Applied
#1 lore raw
Quoted 3 lines · Lars-Peter Clausen

For dmaengine drivers which do not support transfer residue reporting we update the PCM pointer with period granularity. Set the SNDRV_PCM_INFO_BATCH flag in this case to let userspace know about this.

Applied, thanks.