aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
diff options
context:
space:
mode:
authorMichal Bachraty <michal.bachraty@streamunlimited.com>2013-04-19 09:28:44 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-23 09:50:30 -0400
commitd486fea6babfe3ff0c382c9e4baf18f535fcee7d (patch)
treeebe7a30d63d4f26389c928b0f5bc271ff1a085a3 /sound/soc/davinci
parent7c21a78104d7f2c155e2c12279282f659d773d05 (diff)
ASoC: davinci-mcasp: Add Support BCLK-to-LRCLK ratio for TDM modes
For TDM mode, BCLK-to-LCLK ratio is computed as (tdm_slots) x (word_length). I2S mode is only subset of TDM mode with specific tdm_slots = 2 channels. Also bclk_lrclk_ratio can be greater than 255, therefore u16 need to be used. Signed-off-by: Michal Bachraty <michal.bachraty@streamunlimited.com> Acked-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r--sound/soc/davinci/davinci-mcasp.c7
-rw-r--r--sound/soc/davinci/davinci-mcasp.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 59143373afc6..8b85049daab0 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -636,11 +636,12 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
636 * callback, take it into account here. That allows us to for example 636 * callback, take it into account here. That allows us to for example
637 * send 32 bits per channel to the codec, while only 16 of them carry 637 * send 32 bits per channel to the codec, while only 16 of them carry
638 * audio payload. 638 * audio payload.
639 * The clock ratio is given for a full period of data (both left and 639 * The clock ratio is given for a full period of data (for I2S format
640 * right channels), so it has to be divided by 2. 640 * both left and right channels), so it has to be divided by number of
641 * tdm-slots (for I2S - divided by 2).
641 */ 642 */
642 if (dev->bclk_lrclk_ratio) 643 if (dev->bclk_lrclk_ratio)
643 word_length = dev->bclk_lrclk_ratio / 2; 644 word_length = dev->bclk_lrclk_ratio / dev->tdm_slots;
644 645
645 /* mapping of the XSSZ bit-field as described in the datasheet */ 646 /* mapping of the XSSZ bit-field as described in the datasheet */
646 fmt = (word_length >> 1) - 1; 647 fmt = (word_length >> 1) - 1;
diff --git a/sound/soc/davinci/davinci-mcasp.h b/sound/soc/davinci/davinci-mcasp.h
index 0edd3b5a37fd..a9ac0c11da71 100644
--- a/sound/soc/davinci/davinci-mcasp.h
+++ b/sound/soc/davinci/davinci-mcasp.h
@@ -38,7 +38,7 @@ struct davinci_audio_dev {
38 u8 num_serializer; 38 u8 num_serializer;
39 u8 *serial_dir; 39 u8 *serial_dir;
40 u8 version; 40 u8 version;
41 u8 bclk_lrclk_ratio; 41 u16 bclk_lrclk_ratio;
42 42
43 /* McASP FIFO related */ 43 /* McASP FIFO related */
44 u8 txnumevt; 44 u8 txnumevt;