ASoC: stm32: i2s: fix 16 bit format support
authorOlivier Moysan <olivier.moysan@st.com>
Tue, 26 Feb 2019 13:51:05 +0000 (14:51 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 26 Feb 2019 15:36:43 +0000 (15:36 +0000)
I2S supports 16 bits data in 32 channel length.
However the expected driver behavior, is to
set channel length to 16 bits when data format is 16 bits.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/stm/stm32_i2s.c

index 339cd47..7d4c674 100644 (file)
@@ -501,7 +501,7 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai,
        switch (format) {
        case 16:
                cfgr = I2S_CGFR_DATLEN_SET(I2S_I2SMOD_DATLEN_16);
-               cfgr_mask = I2S_CGFR_DATLEN_MASK;
+               cfgr_mask = I2S_CGFR_DATLEN_MASK | I2S_CGFR_CHLEN;
                break;
        case 32:
                cfgr = I2S_CGFR_DATLEN_SET(I2S_I2SMOD_DATLEN_32) |