]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ASoC: McASP: Fix data rotation for playback. Enables 24bit audio playback
authorMichal Bachraty <michal.bachraty@streamunlimited.com>
Fri, 18 Jan 2013 09:17:00 +0000 (10:17 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 27 Jan 2013 06:14:46 +0000 (14:14 +0800)
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>
sound/soc/davinci/davinci-mcasp.c

index 55e2bf652beff53d6694e3cf20d2d2e4d6f17393..9321e5c9d8c125b3d8894dda33df44d94b7068dc 100644 (file)
@@ -626,7 +626,7 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
                                       int word_length)
 {
        u32 fmt;
-       u32 rotate = (32 - word_length) / 4;
+       u32 rotate = (word_length / 4) & 0x7;
        u32 mask = (1ULL << word_length) - 1;
 
        /*