From: Hao Bui Date: Wed, 6 Nov 2024 08:18:20 +0000 (+0200) Subject: ASoC: da7213: Avoid setting PLL when closing audio stream X-Git-Tag: v6.13-rc1~123^2~2^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e1a2ef95b571825ca9c0113f6bef51e9cec98b0;p=thirdparty%2Fkernel%2Flinux.git ASoC: da7213: Avoid setting PLL when closing audio stream When audio stream is closing, audio frequency is set to 0 by ALSA but codec driver DA7213 does not handle properly in this case. This patch adds checking of 0Hz frequency to da7213_set_component_sysclk() and avoid unnecessary PLL settings. Signed-off-by: Hao Bui Signed-off-by: Claudiu Beznea Link: https://patch.msgid.link/20241106081826.1211088-26-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index 01c78f8032c4d..af38b2b5e1744 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c @@ -1555,6 +1555,10 @@ static int da7213_set_component_sysclk(struct snd_soc_component *component, if ((da7213->clk_src == clk_id) && (da7213->mclk_rate == freq)) return 0; + /* Maybe audio stream is closing. */ + if (freq == 0) + return 0; + if (((freq < 5000000) && (freq != 32768)) || (freq > 54000000)) { dev_err(component->dev, "Unsupported MCLK value %d\n", freq);