Skip to content

Commit

Permalink
ASoC: meson: axg-tdm: fix sample clock inversion
Browse files Browse the repository at this point in the history
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: 1a11d88 ("ASoC: meson: add tdm formatter base driver")
Signed-off-by: Jerome Brunet <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
jbrun3t authored and broonie committed Jun 13, 2019
1 parent 7e0d7d0 commit cb36ff7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/meson/axg-tdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit cb36ff7

Please sign in to comment.