diff options
author | Jerome Brunet <jbrunet@baylibre.com> | 2019-06-13 13:42:32 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-26 09:10:26 +0200 |
commit | e05a270a707a9e67bb41a38eeaab840fd3df6ffa (patch) | |
tree | 970af6502dab625666f43c822f0a326dd38c2e11 /sound | |
parent | 80e78141245be288f1125be8bbb319d22d7c5fa2 (diff) | |
download | linux-stable-e05a270a707a9e67bb41a38eeaab840fd3df6ffa.tar.gz linux-stable-e05a270a707a9e67bb41a38eeaab840fd3df6ffa.tar.bz2 linux-stable-e05a270a707a9e67bb41a38eeaab840fd3df6ffa.zip |
ASoC: meson: axg-tdm: fix sample clock inversion
[ Upstream commit cb36ff785e868992e96e8b9e5a0c2822b680a9e2 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/meson/axg-tdm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/meson/axg-tdm.h b/sound/soc/meson/axg-tdm.h index e578b6f40a07..5774ce0916d4 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)); } |