From: Jerome Brunet Date: Thu, 13 Jun 2019 11:42:32 +0000 (+0200) Subject: ASoC: meson: axg-tdm: fix sample clock inversion X-Git-Tag: v5.3-rc1~168^2~7^2~2^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb36ff785e868992e96e8b9e5a0c2822b680a9e2;p=thirdparty%2Flinux.git 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 Signed-off-by: Mark Brown --- diff --git a/sound/soc/meson/axg-tdm.h b/sound/soc/meson/axg-tdm.h index e578b6f40a07b..5774ce0916d40 100644 --- a/sound/soc/meson/axg-tdm.h +++ b/sound/soc/meson/axg-tdm.h @@ -40,7 +40,7 @@ struct axg_tdm_iface { static inline bool axg_tdm_lrclk_invert(unsigned int fmt) { - return (fmt & SND_SOC_DAIFMT_I2S) ^ + return ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) ^ !!(fmt & (SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_NB_IF)); }