]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: davinci-mcasp: Fix rx format when more bclk is used on the bus
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Mon, 10 Nov 2014 10:32:19 +0000 (12:32 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 10 Nov 2014 14:55:54 +0000 (14:55 +0000)
When the bus is configured to have more BCLK then the data type demands we
need to use the rotation to move the data to correct place.

Reported-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/davinci/davinci-mcasp.c

index 80c54ede5737bf3394bcc15c7763a028f64ae39e..ea3ad747d092954e1ac76ad4028311b04b2c92e3 100644 (file)
@@ -490,8 +490,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
         * both left and right channels), so it has to be divided by number of
         * tdm-slots (for I2S - divided by 2).
         */
-       if (mcasp->bclk_lrclk_ratio)
-               word_length = mcasp->bclk_lrclk_ratio / mcasp->tdm_slots;
+       if (mcasp->bclk_lrclk_ratio) {
+               u32 slot_length = mcasp->bclk_lrclk_ratio / mcasp->tdm_slots;
+
+               /*
+                * When we have more bclk then it is needed for the data, we
+                * need to use the rotation to move the received samples to have
+                * correct alignment.
+                */
+               rx_rotate = (slot_length - word_length) / 4;
+               word_length = slot_length;
+       }
 
        /* mapping of the XSSZ bit-field as described in the datasheet */
        fmt = (word_length >> 1) - 1;