[PATCH 2/4] ASoC: wm8962: Don't disable SYSCLK if it's enabled via DAPM

Sebastian Krzyszkowiak posted 4 patches 2 days, 20 hours ago
There is a newer version of this series
[PATCH 2/4] ASoC: wm8962: Don't disable SYSCLK if it's enabled via DAPM
Posted by Sebastian Krzyszkowiak 2 days, 20 hours ago
If SYSCLK pin is enabled via DAPM, wm8962_configure_bclk may turn it off
behind DAPM's back, making it assume that the clock is still enabled even
if it actually isn't, which can end up with it not being enabled for
playback or capture when it's needed.

Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
---
 sound/soc/codecs/wm8962.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 1040740fc80f..843b8c6b40a4 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2520,7 +2520,8 @@ static void wm8962_configure_bclk(struct snd_soc_component *component)
 	usleep_range(500, 1000);
 	dspclk = snd_soc_component_read(component, WM8962_CLOCKING1);
 
-	if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_ON)
+	if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_ON
+	    && !snd_soc_dapm_get_pin_status(dapm, "SYSCLK"))
 		snd_soc_component_update_bits(component, WM8962_CLOCKING2,
 				WM8962_SYSCLK_ENA_MASK, 0);
 

-- 
2.52.0