Skip to contentSkip to conversation

Fix PXA2xx sound DMA autoincrementation flags

PATCH Superseded Petr Cvek 2 participants 5 messages Nov 23, 2014 – Nov 24, 2014

Subsystems (2)
lore
Share & tools
lore

Petr Cvek

author
#0 lore raw

PATCH 1/1 Fix PXA2xx sound DMA autoincrementation flags

Fix for address auto-incrementation flags for DMA transmissions for PXA2xx sound.

Old version used playback settings for recording, so it wrongly read from whole register space (instead of one FIFO register) and wrote into single word in memory.

---
  sound/arm/pxa2xx-pcm-lib.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +0 -0
index a61d7a9..5d3a415 100644
@@ -45,7 +45,13 @@ 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
#1 lore raw

PATCH 1/1 Fix PXA2xx sound DMA autoincrementation flags

Hello.

Quoted 18 lines · Petr Cvek

Fix for address auto-incrementation flags for DMA transmissions for PXA2xx sound.

Old version used playback settings for recording, so it wrongly read from whole register space (instead of one FIFO register) and wrote into single word in memory.

---
  sound/arm/pxa2xx-pcm-lib.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +0 -0
index a61d7a9..5d3a415 100644
@@ -45,7 +45,13 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream
 *substream,
      size_t period = params_period_bytes(params);

sound/arm/pxa2xx-pcm-lib.c int __pxa2xx_pcm_hw_params(struct snd_pcm_substream · line 55

Quoted 10 lines
sound/arm/pxa2xx-pcm-lib.c +7 -1
      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;
+    }

[...]

Your patch has all tabs replaced by spaces, so can't be applied.

WBR, Sergei

author
#2 lore raw

PATCH v2 1/1 Fix PXA2xx sound DMA autoincrementation flags

Add support for SCCB devices into PXA27x I2C controller.

Fix generated START but no STOP for message without I2C_M_NOSTART flag. Add support for I2C_M_IGNORE_NAK flag.

---
 sound/arm/pxa2xx-pcm-lib.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +7 -1
index a61d7a9..5d3a415 100644
@@ -45,7 +45,13 @@ 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
#3 lore raw

PATCH v2 1/1 Fix PXA2xx sound DMA autoincrementation flags

Hello.

Quoted 15 lines · Petr Cvek

Add support for SCCB devices into PXA27x I2C controller.

Fix generated START but no STOP for message without I2C_M_NOSTART flag. Add support for I2C_M_IGNORE_NAK flag.

---
  sound/arm/pxa2xx-pcm-lib.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +0 -0
index a61d7a9..5d3a415 100644
@@ -45,7 +45,13 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
  	size_t period = params_period_bytes(params);

sound/arm/pxa2xx-pcm-lib.c int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, · line 54

Quoted 10 lines
sound/arm/pxa2xx-pcm-lib.c +7 -1
  	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;
+	}

{} not needed at all here. Sorry for not complaining at once...

WBR, Sergei

author
#4 lore raw

PATCH v3 1/1 Fix PXA2xx sound DMA autoincrementation flags

Fix for address auto-incrementation flags for DMA transmissions for PXA2xx sound.

Old version used playback settings for recording, so it wrongly read from whole register space (instead of one FIFO register) and wrote into single word in memory.

---
 sound/arm/pxa2xx-pcm-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/arm/pxa2xx-pcm-lib.c +6 -1
index a61d7a9..755f947 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