Skip to content

Commit 1e1a2ef

Browse files
haobui-rvcbroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Claudiu Beznea <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 431e040 commit 1e1a2ef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/codecs/da7213.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,10 @@ static int da7213_set_component_sysclk(struct snd_soc_component *component,
15551555
if ((da7213->clk_src == clk_id) && (da7213->mclk_rate == freq))
15561556
return 0;
15571557

1558+
/* Maybe audio stream is closing. */
1559+
if (freq == 0)
1560+
return 0;
1561+
15581562
if (((freq < 5000000) && (freq != 32768)) || (freq > 54000000)) {
15591563
dev_err(component->dev, "Unsupported MCLK value %d\n",
15601564
freq);

0 commit comments

Comments
 (0)