aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2014-11-10 05:32:19 -0500
committerMark Brown <broonie@kernel.org>2014-11-10 09:55:54 -0500
commitd742b925244ce91f16d380befdca473e4536359b (patch)
treeb82b0402a6b14b5238434d52539d931aac3ce86e /sound/soc/davinci
parentd75249f54577d489d1642a246d3702416daa68f9 (diff)
ASoC: davinci-mcasp: Fix rx format when more bclk is used on the bus
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>
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r--sound/soc/davinci/davinci-mcasp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 80c54ede5737..ea3ad747d092 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -490,8 +490,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
490 * both left and right channels), so it has to be divided by number of 490 * both left and right channels), so it has to be divided by number of
491 * tdm-slots (for I2S - divided by 2). 491 * tdm-slots (for I2S - divided by 2).
492 */ 492 */
493 if (mcasp->bclk_lrclk_ratio) 493 if (mcasp->bclk_lrclk_ratio) {
494 word_length = mcasp->bclk_lrclk_ratio / mcasp->tdm_slots; 494 u32 slot_length = mcasp->bclk_lrclk_ratio / mcasp->tdm_slots;
495
496 /*
497 * When we have more bclk then it is needed for the data, we
498 * need to use the rotation to move the received samples to have
499 * correct alignment.
500 */
501 rx_rotate = (slot_length - word_length) / 4;
502 word_length = slot_length;
503 }
495 504
496 /* mapping of the XSSZ bit-field as described in the datasheet */ 505 /* mapping of the XSSZ bit-field as described in the datasheet */
497 fmt = (word_length >> 1) - 1; 506 fmt = (word_length >> 1) - 1;