]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: davinci-mcasp: Fine tune and correct the DMA burst configuration
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Tue, 1 Apr 2014 12:55:12 +0000 (15:55 +0300)
committerMark Brown <broonie@linaro.org>
Mon, 14 Apr 2014 16:24:11 +0000 (17:24 +0100)
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@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/davinci/davinci-mcasp.c

index 9454d123f4bb0a37700dd875fc78c48fa66eb403..196158f2d1c433ae04565a2a5fe930b4ebe7d82f 100644 (file)
@@ -529,8 +529,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;
        }
 
@@ -558,6 +569,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;