Skip to contentSkip to conversation

Sound: PXA: Fix settings of PXAxxx DMA

PATCH In review Petr Cvek 4 participants 9 messages Jan 29, 2015 – Mar 6, 2015

Subsystems (2)
lore
Share & tools
lore

Petr Cvek

author
#0 lore raw

PATCH v4 1/1 Sound: PXA: Fix settings of PXAxxx DMA

Fix PXA DMA autoincrementation, so capture will not use playback settings (incrementation in register space instead in target buffer).

---
 sound/arm/pxa2xx-pcm-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +6 -1
index 01f8fdc..f8ca3ca 100644
@@ -45,7 +45,12 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
 	size_t period = params_period_bytes(params);
 	pxa_dma_desc *dma_desc;
 	dma_addr_t dma_buff_phys, next_desc_phys;
-	u32 dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	u32 dcmd = 0;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	else
+		dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC;
 
 	/* temporary transition hack */
 	switch (rtd->params->addr_width) {
Signature · 1 line
1.7.12.1
maintainer
#1 lore raw

PATCH v4 1/1 Sound: PXA: Fix settings of PXAxxx DMA

Quoted 4 lines · Petr Cvek

Fix PXA DMA autoincrementation, so capture will not use playback settings (incrementation in register space instead in target buffer).

Yes, that's actually a regression from d65a14587 ("ASoC: pxa: use snd_dmaengine_dai_dma_data"). Your fix seems right to me, thanks for spotting this.

Daniel

Quoted 23 lines
---
 sound/arm/pxa2xx-pcm-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +6 -1
index 01f8fdc..f8ca3ca 100644
@@ -45,7 +45,12 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
 	size_t period = params_period_bytes(params);
 	pxa_dma_desc *dma_desc;
 	dma_addr_t dma_buff_phys, next_desc_phys;
-	u32 dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	u32 dcmd = 0;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	else
+		dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC;
 
 	/* temporary transition hack */
 	switch (rtd->params->addr_width) {
maintainer
#2 lore raw

PATCH v4 1/1 Sound: PXA: Fix settings of PXAxxx DMA

Quoted 11 lines · Daniel Mack
Quoted 4 lines · Petr Cvek

Fix PXA DMA autoincrementation, so capture will not use playback settings (incrementation in register space instead in target buffer).

Yes, that's actually a regression from d65a14587 ("ASoC: pxa: use snd_dmaengine_dai_dma_data"). Your fix seems right to me, thanks for spotting this.

However, as this should go through the ASoC tree, please make sure to
Cc: its maintainers.

Mark, do you need a resend of this patch?

Thanks,
Daniel

Quoted 28 lines

Daniel

Quoted 23 lines
---
 sound/arm/pxa2xx-pcm-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +6 -1
index 01f8fdc..f8ca3ca 100644
@@ -45,7 +45,12 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
 	size_t period = params_period_bytes(params);
 	pxa_dma_desc *dma_desc;
 	dma_addr_t dma_buff_phys, next_desc_phys;
-	u32 dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	u32 dcmd = 0;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	else
+		dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC;
 
 	/* temporary transition hack */
 	switch (rtd->params->addr_width) {
#3 lore raw

PATCH v4 1/1 Sound: PXA: Fix settings of PXAxxx DMA

Quoted 4 lines · Daniel Mack

However, as this should go through the ASoC tree, please make sure to
Cc: its maintainers.

Mark, do you need a resend of this patch?

Yes, please.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150129/fc295827/attachment.sig>

author Acked-by Daniel Mack on v4 1/1
#4 lore raw
In reply to Petr Cvek

Fix PXA DMA autoincrementation, so capture will not use playback settings (incrementation in register space instead in target buffer).

Regression from:
'commit d65a14587a9be853a887a1407db133df1fb68e29 ("ASoC: pxa: use snd_dmaengine_dai_dma_data")'

---
 sound/arm/pxa2xx-pcm-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +6 -1
index 01f8fdc..f8ca3ca 100644
@@ -45,7 +45,12 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
 	size_t period = params_period_bytes(params);
 	pxa_dma_desc *dma_desc;
 	dma_addr_t dma_buff_phys, next_desc_phys;
-	u32 dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	u32 dcmd = 0;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	else
+		dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC;
 
 	/* temporary transition hack */
 	switch (rtd->params->addr_width) {
Signature · 1 line
1.7.12.1
author
#6 lore raw
In reply to Petr Cvek

bump

Quoted 31 lines · Petr Cvek

Fix PXA DMA autoincrementation, so capture will not use playback settings (incrementation in register space instead in target buffer).

Regression from:
'commit d65a14587a9be853a887a1407db133df1fb68e29 ("ASoC: pxa: use snd_dmaengine_dai_dma_data")'

---
 sound/arm/pxa2xx-pcm-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +6 -1
index 01f8fdc..f8ca3ca 100644
@@ -45,7 +45,12 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
 	size_t period = params_period_bytes(params);
 	pxa_dma_desc *dma_desc;
 	dma_addr_t dma_buff_phys, next_desc_phys;
-	u32 dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	u32 dcmd = 0;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	else
+		dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC;
 
 	/* temporary transition hack */
 	switch (rtd->params->addr_width) {
author Acked-by Daniel Mack Acked-by Robert Jarzmik
#8 lore raw

Fix PXA DMA autoincrementation, so capture will not use playback settings (incrementation in register space instead in target buffer).

Regression from:
'commit d65a14587a9be853a887a1407db133df1fb68e29 ("ASoC: pxa: use snd_dmaengine_dai_dma_data")'

---
 sound/arm/pxa2xx-pcm-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +6 -1
index 01f8fdc..f8ca3ca 100644
@@ -45,7 +45,12 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
 	size_t period = params_period_bytes(params);
 	pxa_dma_desc *dma_desc;
 	dma_addr_t dma_buff_phys, next_desc_phys;
-	u32 dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	u32 dcmd = 0;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
+	else
+		dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC;
 
 	/* temporary transition hack */
 	switch (rtd->params->addr_width) {

-- 1.7.12.1