[PATCH] ASoC: max9867: Clear stale rate constraints when changing sysclk

From: Haowen Tu

Date: Tue Dec 01 2026 - 21:16:09 EST


max9867_set_dai_sysclk() selects a rate constraint list for clocks that
are multiples of 44.1 kHz or 48 kHz, but leaves the previous list in place
when a subsequent valid clock belongs to neither family.

For example, changing sysclk from 11.2896 MHz to 13 MHz leaves the
44.1 kHz list installed. max9867_startup() then applies that stale list
to the next stream, excluding rates such as 8 kHz that would not be
restricted when starting with a 13 MHz clock.

Clear the constraint pointer before selecting a list for the new clock.
Do this after validating the frequency so rejected clock settings leave
the previous configuration intact.

Fixes: 715ee1916b95 ("ASoC: max9867: Calculate LRCLK divider")
Signed-off-by: Haowen Tu <tuhaowen@xxxxxxxxxxxxx>
---
sound/soc/codecs/max9867.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c
index 1e99fbd8aca2..224c195d95f3 100644
--- a/sound/soc/codecs/max9867.c
+++ b/sound/soc/codecs/max9867.c
@@ -449,6 +449,7 @@ static int max9867_set_dai_sysclk(struct snd_soc_dai *codec_dai,
freq);
return -EINVAL;
}
+ max9867->constraints = NULL;
if (freq % 48000 == 0)
max9867->constraints = &max9867_constraints_48k;
else if (freq % 44100 == 0)
--
2.50.1