]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: wm8960: Fix wrong bclk and lrclk with pll enabled for some chips
authorShengjiu Wang <shengjiu.wang@nxp.com>
Fri, 19 Mar 2021 10:48:46 +0000 (18:48 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 23 Mar 2021 17:14:33 +0000 (17:14 +0000)
commit9ca2c42178f3fe937ed32ab7296346a6bf2a34be
tree9f13afc06870e0369f85c299473a0da0e206c454
parent769e5c4f903363ae888abf8b8f2a2ca39eca51e4
ASoC: wm8960: Fix wrong bclk and lrclk with pll enabled for some chips

The input MCLK is 12.288MHz, the desired output sysclk is 11.2896MHz
and sample rate is 44100Hz, with the configuration pllprescale=2,
postscale=sysclkdiv=1, some chip may have wrong bclk
and lrclk output with pll enabled in master mode, but with the
configuration pllprescale=1, postscale=2, the output clock is correct.

>From Datasheet, the PLL performs best when f2 is between
90MHz and 100MHz when the desired sysclk output is 11.2896MHz
or 12.288MHz, so sysclkdiv = 2 (f2/8) is the best choice.

So search available sysclk_divs from 2 to 1 other than from 1 to 2.

Fixes: e42f37a02448 ("ASoC: codec: wm9860: Refactor PLL out freq search")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1616150926-22892-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm8960.c