Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: meson: axg-tdm: fix sample clock inversion

The content of SND_SOC_DAIFMT_FORMAT_MASK is a number, not a bitfield,
so the test to check if the format is i2s is wrong. Because of this the
clock setting may be wrong. For example, the sample clock gets inverted
in DSP B mode, when it should not.

Fix the lrclk invert helper function

Fixes: 1a11d88f499c ("ASoC: meson: add tdm formatter base driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jerome Brunet and committed by
Mark Brown
cb36ff78 7e0d7d0f

+1 -1
+1 -1
sound/soc/meson/axg-tdm.h
··· 40 40 41 41 static inline bool axg_tdm_lrclk_invert(unsigned int fmt) 42 42 { 43 - return (fmt & SND_SOC_DAIFMT_I2S) ^ 43 + return ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) ^ 44 44 !!(fmt & (SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_NB_IF)); 45 45 } 46 46