[alsa-devel] [PATCH 6/6] ASoC: davinci-mcasp: Fine tune and correct the DMA burst configuration

Peter Ujfalusi peter.ujfalusi at ti.com
Tue Apr 1 14:55:12 CEST 2014


When the AFIFO is not enabled but more than one serializers are used the DMA
need to transfer number of words equal to active serializers when a DMA
request is generated.
When configuring the burst for the DMA avoid using value '1' for the burst
since it is going to enable additional logic in the DMA drivers. Burst '1'
means that the DMA should send/receive one word per DMA requests.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
---
 sound/soc/davinci/davinci-mcasp.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 9e877044a00a..52fc6bbd56bd 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -521,8 +521,19 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
 	/* AFIFO is not in use */
 	if (!numevt) {
 		/* Configure the burst size for platform drivers */
-		dma_params->fifo_level = 0;
-		dma_data->maxburst = 0;
+		if (active_serializers > 1) {
+			/*
+			 * If more than one serializers are in use we have one
+			 * DMA request to provide data for all serializers.
+			 * For example if three serializers are enabled the DMA
+			 * need to transfer three words per DMA request.
+			 */
+			dma_params->fifo_level = active_serializers;
+			dma_data->maxburst = active_serializers;
+		} else {
+			dma_params->fifo_level = 0;
+			dma_data->maxburst = 0;
+		}
 		return 0;
 	}
 
@@ -550,6 +561,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
 	mcasp_mod_bits(mcasp, reg, NUMEVT(numevt), NUMEVT_MASK);
 
 	/* Configure the burst size for platform drivers */
+	if (numevt == 1)
+		numevt = 0;
 	dma_params->fifo_level = numevt;
 	dma_data->maxburst = numevt;
 
-- 
1.9.1



More information about the Alsa-devel mailing list