From: Richard Fitzgerald Date: Sat, 6 Mar 2021 18:55:52 +0000 (+0000) Subject: ASoC: cs42l42: Only start PLL if it is needed X-Git-Tag: Ubuntu-5.13.0-19.19~3230^2~5^2~181^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=882589bb707ba78d25dd193beefde97e00a3da6b;p=mirror_ubuntu-jammy-kernel.git ASoC: cs42l42: Only start PLL if it is needed The PLL is only needed for sclk < 11289600 Hz and cs42l42_pll_config() will not configure it for higher rates. So it must only be enabled when it is needed. Signed-off-by: Richard Fitzgerald Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20210306185553.62053-15-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 08718fd10fb9..d7a314aa59b7 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -887,8 +887,9 @@ static int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) } else { if (!cs42l42->stream_use) { /* SCLK must be running before codec unmute */ - snd_soc_component_update_bits(component, CS42L42_PLL_CTL1, - CS42L42_PLL_START_MASK, 1); + if ((cs42l42->bclk < 11289600) && (cs42l42->sclk < 11289600)) + snd_soc_component_update_bits(component, CS42L42_PLL_CTL1, + CS42L42_PLL_START_MASK, 1); /* Mark SCLK as present, turn off internal oscillator */ regmap_multi_reg_write(cs42l42->regmap, cs42l42_to_sclk_seq,