Skip to content

Commit 8b19c81

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 cbeccd0 commit 8b19c81

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sound/soc/codecs/wm8974.c

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

429429
f = wm8974_get_mclkdiv(priv->mclk, fs256, &mclkdiv);
430-
431430
if (f != priv->mclk) {
432431
/* The PLL performs best around 90MHz */
433-
fpll = wm8974_get_mclkdiv(22500000, fs256, &mclkdiv);
432+
if (fs256 % 8000)
433+
f = 22579200;
434+
else
435+
f = 24576000;
436+
437+
fpll = wm8974_get_mclkdiv(f, fs256, &mclkdiv);
434438
}
435439

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

0 commit comments

Comments
 (0)