Skip to content

Commit 7aa83b9

Browse files
charleskeepaxgregkh
authored andcommitted
ASoC: wm8974: Correct PLL rate rounding
[ Upstream commit 9b17d37 ] Using a single value of 22500000 for both 48000Hz and 44100Hz audio will sometimes result in returning wrong dividers due to rounding. Update the code to use the actual value for both. Fixes: 51b2bb3 ("ASoC: wm8974: configure pll and mclk divider automatically") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20250821082639.1301453-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7ed74f2 commit 7aa83b9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sound/soc/codecs/wm8974.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,14 @@ static int wm8974_update_clocks(struct snd_soc_dai *dai)
419419
fs256 = 256 * priv->fs;
420420

421421
f = wm8974_get_mclkdiv(priv->mclk, fs256, &mclkdiv);
422-
423422
if (f != priv->mclk) {
424423
/* The PLL performs best around 90MHz */
425-
fpll = wm8974_get_mclkdiv(22500000, fs256, &mclkdiv);
424+
if (fs256 % 8000)
425+
f = 22579200;
426+
else
427+
f = 24576000;
428+
429+
fpll = wm8974_get_mclkdiv(f, fs256, &mclkdiv);
426430
}
427431

428432
wm8974_set_dai_pll(dai, 0, 0, priv->mclk, fpll);

0 commit comments

Comments
 (0)