aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisael Lopez Cruz2013-06-28 01:31:19 -0500
committerMisael Lopez Cruz2013-07-22 14:43:20 -0500
commit29485e4cd6b4adac3816c5e1809f7998afe633e5 (patch)
treec9dba3ba1c4a63219fb0c4653e5484c94c25fe15
parent54cf9b418df25c633319a92779f74c77b2696d2e (diff)
downloadkernel-audio-29485e4cd6b4adac3816c5e1809f7998afe633e5.tar.gz
kernel-audio-29485e4cd6b4adac3816c5e1809f7998afe633e5.tar.xz
kernel-audio-29485e4cd6b4adac3816c5e1809f7998afe633e5.zip
ASoC: davinci-mcasp: Fix receive right-rotation value
Receive right-rotation (RROT) for I2S/TDM falls in the MSB-first, left-aligned streams whose suggested rotation value is slot size - word size. Change-Id: I53ac6a0a9c02cf78cc4a2f37c34b6dbc4f9a0bcc Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
-rw-r--r--sound/soc/davinci/davinci-mcasp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 0072cfa26818..818732de0f75 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -667,8 +667,9 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
667{ 667{
668 u32 fmt; 668 u32 fmt;
669 u32 tx_rotate = (word_length / 4) & 0x7; 669 u32 tx_rotate = (word_length / 4) & 0x7;
670 u32 rx_rotate = (32 - word_length) / 4; 670 u32 rx_rotate;
671 u32 mask = (1ULL << word_length) - 1; 671 u32 mask = (1ULL << word_length) - 1;
672 u32 slot_length;
672 673
673 /* 674 /*
674 * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv() 675 * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()
@@ -680,10 +681,14 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
680 * tdm-slots (for I2S - divided by 2). 681 * tdm-slots (for I2S - divided by 2).
681 */ 682 */
682 if (dev->bclk_lrclk_ratio) 683 if (dev->bclk_lrclk_ratio)
683 word_length = dev->bclk_lrclk_ratio / dev->tdm_slots; 684 slot_length = dev->bclk_lrclk_ratio / dev->tdm_slots;
685 else
686 slot_length = word_length;
684 687
685 /* mapping of the XSSZ bit-field as described in the datasheet */ 688 /* mapping of the XSSZ bit-field as described in the datasheet */
686 fmt = (word_length >> 1) - 1; 689 fmt = (slot_length >> 1) - 1;
690
691 rx_rotate = (slot_length - word_length) / 4;
687 692
688 if (dev->op_mode != DAVINCI_MCASP_DIT_MODE) { 693 if (dev->op_mode != DAVINCI_MCASP_DIT_MODE) {
689 mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, 694 mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,