[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241106081826.1211088-26-claudiu.beznea.uj@bp.renesas.com>
Date: Wed, 6 Nov 2024 10:18:20 +0200
From: Claudiu <claudiu.beznea@...on.dev>
To: geert+renesas@...der.be,
mturquette@...libre.com,
sboyd@...nel.org,
robh@...nel.org,
krzk+dt@...nel.org,
conor+dt@...nel.org,
biju.das.jz@...renesas.com,
prabhakar.mahadev-lad.rj@...renesas.com,
lgirdwood@...il.com,
broonie@...nel.org,
magnus.damm@...il.com,
linus.walleij@...aro.org,
support.opensource@...semi.com,
perex@...ex.cz,
tiwai@...e.com,
p.zabel@...gutronix.de,
Adam.Thomson.Opensource@...semi.com
Cc: linux-renesas-soc@...r.kernel.org,
linux-clk@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-sound@...r.kernel.org,
linux-gpio@...r.kernel.org,
Hao Bui <hao.bui.yg@...esas.com>,
Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: [PATCH 25/31] ASoC: da7213: Avoid setting PLL when closing audio stream
From: Hao Bui <hao.bui.yg@...esas.com>
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 <hao.bui.yg@...esas.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
---
sound/soc/codecs/da7213.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c
index 01c78f8032c4..af38b2b5e174 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);
--
2.39.2
Powered by blists - more mailing lists