aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
diff options
context:
space:
mode:
authorMichal Bachraty <michal.bachraty@streamunlimited.com>2013-01-18 04:17:00 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-27 01:14:46 -0500
commitdde109fb46256f61642ba9bf0199418dfaaca12b (patch)
tree04a0070b28b0a817752aa67e31ec7eb3112335a3 /sound/soc/davinci
parent949db153b6466c6f7cad5a427ecea94985927311 (diff)
ASoC: McASP: Fix data rotation for playback. Enables 24bit audio playback
u32 rotate = (32 - word_length) / 4; This implementation is wrong, but it works only for 16, or 32 bit audio data. (rotation for 16 or 32 bit is same as in code I present) Mcasp rotated data in 4 bits (max value 0x7)and then masks them . That data are sended to i2s bus. For 24 bit or 20 bit or other data formats, this code rotates data badly and you hear somethink like noise. You need to use u32 rotate = (word_length / 4) & 0x7; to proper data rotation. Signed-off-by: Michal Bachraty <michal.bachraty@streamunlimited.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r--sound/soc/davinci/davinci-mcasp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 55e2bf652bef..9321e5c9d8c1 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -626,7 +626,7 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
626 int word_length) 626 int word_length)
627{ 627{
628 u32 fmt; 628 u32 fmt;
629 u32 rotate = (32 - word_length) / 4; 629 u32 rotate = (word_length / 4) & 0x7;
630 u32 mask = (1ULL << word_length) - 1; 630 u32 mask = (1ULL << word_length) - 1;
631 631
632 /* 632 /*