Skip to contentSkip to conversation

ASoC: rt5682: disable MICBIAS and Vref2 widget in default

PATCH New [email protected] 1 participant 1 message Jul 17, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ASoC: rt5682: disable MICBIAS and Vref2 widget in default

From: Shuming Fan <[email protected]>

The pin status of the widget was connected after the sound card registered. The rt5682_headset_detect function will use the pin status of these two widgets to decide the certain register setting on/off.
Therefore this patch disables the pin of these two widgets in the codec probe. This patch could avoid the misjudgment.

---
 sound/soc/codecs/rt5682.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/soc/codecs/rt5682.c +4 -0
index c06f5763573c..a4713bd6508d 100644
@@ -2847,6 +2847,7 @@ static int rt5682_probe(struct snd_soc_component *component)
 	struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
 	struct sdw_slave *slave;
 	unsigned long time;
+	struct snd_soc_dapm_context *dapm = &component->dapm;
 
 #ifdef CONFIG_COMMON_CLK
 	int ret;
@@ -2884,6 +2885,9 @@ static int rt5682_probe(struct snd_soc_component *component)
 #endif
 	}
 
+	snd_soc_dapm_disable_pin(dapm, "MICBIAS");
+	snd_soc_dapm_disable_pin(dapm, "Vref2");
+	snd_soc_dapm_sync(dapm);
 	return 0;
 }
 
Signature · 1 line
2.27.0