[PATCH] ASoC: nau8822: reprogram PLL after it has been disabled

From: Matheus Barbosa

Date: Tue Dec 01 2026 - 09:17:50 EST


From: Matheus Barbosa <matheus.barbosa@xxxxxxxxxxx>

A playback started within the DAPM power-down delay fails with
"aplay: pcm_write:2191: write error: Input/output error" when the codec
is clock provider and its clock comes from the PLL.

Setting the sysclk to 0 on stream shutdown disables the PLL but keeps
the cached PLL frequencies, so on the next stream nau8822_set_pll()
returns early and never enables the PLL again. Within the delay, DAPM
still considers the "PLL" supply widget powered and does not set PLL_EN
either.

A playback started after the delay (5 seconds by default) works because
DAPM has powered down the "PLL" supply widget, and powering it up again
for the next stream sets PLL_EN. The PLL registers still hold valid
values, so the early return is harmless in that case.

Clear the cached frequencies when disabling the PLL.

Fixes: 3ae190edc5f6 ("ASoC: nau8822: Don't reconfigure PLL to the same values")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Matheus Barbosa <matheus.barbosa@xxxxxxxxxxx>
---
sound/soc/codecs/nau8822.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c
index 17b8ee0ab22c..9814d3b88724 100644
--- a/sound/soc/codecs/nau8822.c
+++ b/sound/soc/codecs/nau8822.c
@@ -727,6 +727,8 @@ static int nau8822_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
dev_dbg(component->dev, "PLL disabled\n");
snd_soc_component_update_bits(component,
NAU8822_REG_POWER_MANAGEMENT_1, NAU8822_PLL_EN_MASK, NAU8822_PLL_OFF);
+ pll_param->freq_in = 0;
+ pll_param->freq_out = 0;
return 0;
}


---
base-commit: 8cb402ec2c746f32b17e1aab14e900e7e45cb025
change-id: 20261130-nau8822-sequential-play-954b940be60b

Best regards,
--
Matheus Barbosa <matheus.barbosa@xxxxxxxxxxx>