Skip to content

Commit 69b4141

Browse files
lgs2513broonie
authored andcommitted
ASoC: adau1372: Clear PLL_EN on failed PLL lock without reset GPIO
The PLL lock failure path in adau1372_set_power() unwinds by putting the regmap back in cache-only mode, asserting the optional power-down GPIO and disabling mclk. adau1372_enable_pll() enables CLK_CTRL.PLL_EN before polling the PLL lock bit. If the lock fails on a board without a power-down GPIO, the error path disables mclk and returns an error, but leaves PLL_EN set in the hardware register. The normal power-off path already handles the no-GPIO case by explicitly clearing PLL_EN. Mirror that cleanup in the PLL lock failure path and clear PLL_EN while the regmap is still live, before switching it back to cache-only mode. Fixes: bfe6a26 ("ASoC: adau1372: Fix clock leak on PLL lock failure") Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com> Link: https://patch.msgid.link/20260604125520.1428905-1-lgs201920130244@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7165d13 commit 69b4141

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

sound/soc/codecs/adau1372.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,11 @@ static int adau1372_set_power(struct adau1372 *adau1372, bool enable)
813813
if (adau1372->use_pll) {
814814
ret = adau1372_enable_pll(adau1372);
815815
if (ret) {
816+
if (!adau1372->pd_gpio)
817+
regmap_update_bits(adau1372->regmap,
818+
ADAU1372_REG_CLK_CTRL,
819+
ADAU1372_CLK_CTRL_PLL_EN,
820+
0);
816821
regcache_cache_only(adau1372->regmap, true);
817822
if (adau1372->pd_gpio)
818823
gpiod_set_value(adau1372->pd_gpio, 1);

0 commit comments

Comments
 (0)