[PATCH 5/7] ASoC: nau8810: Do not configure the PLL if freq_out is zero

From: Mehmet Fide

Date: Thu Dec 03 2026 - 07:48:06 EST


From: Mehmet Fide <mehmet.fide@xxxxxxxxxxxxxxxxxx>

When a stream ends, the PLL or, with a later change, the system clock
may be set to zero. nau8810_set_pll() then fails with "Unsupported input
clock". Return early, as nau8822 does, but leave the PLL power to its
supply widget, which already powers the PLL down.

Signed-off-by: Mehmet Fide <mehmet.fide@xxxxxxxxxxxxxxxxxx>
---
sound/soc/codecs/nau8810.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c
index b5b18994ebaa..1a309d5c7454 100644
--- a/sound/soc/codecs/nau8810.c
+++ b/sound/soc/codecs/nau8810.c
@@ -561,6 +561,11 @@ static int nau8810_set_pll(struct snd_soc_dai *codec_dai, int pll_id,
struct nau8810_pll *pll_param = &nau8810->pll;
int ret, fs;

+ if (freq_out == 0) {
+ dev_dbg(nau8810->dev, "PLL disabled\n");
+ return 0;
+ }
+
fs = freq_out / 256;
ret = nau8810_calc_pll(freq_in, fs, pll_param);
if (ret < 0) {
--
2.56.0