Selaa lähdekoodia

Revert "audio-kernel: wcd: Disable 1M Pull-up resistor"

This reverts commit f868a71537cbfc24a4d25d82a7843d1cd7b5de41.

Signed-off-by: V S Ganga VaraPrasad (VARA) Adabala <[email protected]>
V S Ganga VaraPrasad (VARA) Adabala 1 vuosi sitten
vanhempi
sitoutus
fc7bf21cb2

+ 3 - 11
asoc/codecs/wcd-mbhc-v2.c

@@ -963,15 +963,10 @@ static bool wcd_mbhc_moisture_detect(struct wcd_mbhc *mbhc, bool detection_type)
 	return ret;
 }
 
-static void wcd_mbhc_set_hsj_connect(struct wcd_mbhc *mbhc, bool connect)
+static void wcd_mbhc_set_hsj_connect(struct snd_soc_component *component, bool connect)
 {
-	struct snd_soc_component *component = mbhc->component;
-
 #if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C)
 	if (connect) {
-		if (mbhc->mbhc_cb && mbhc->mbhc_cb->zdet_leakage_resistance)
-			mbhc->mbhc_cb->zdet_leakage_resistance(mbhc, false); /* enable 1M pull-up */
-
 		if (of_find_property(component->card->dev->of_node,
 					"qcom,usbss-hsj-connect-enabled", NULL))
 			wcd_usbss_switch_update(WCD_USBSS_HSJ_CONNECT, WCD_USBSS_CABLE_CONNECT);
@@ -979,9 +974,6 @@ static void wcd_mbhc_set_hsj_connect(struct wcd_mbhc *mbhc, bool connect)
 		if (of_find_property(component->card->dev->of_node,
 					"qcom,usbss-hsj-connect-enabled", NULL))
 			wcd_usbss_switch_update(WCD_USBSS_HSJ_CONNECT, WCD_USBSS_CABLE_DISCONNECT);
-
-		if (mbhc->mbhc_cb && mbhc->mbhc_cb->zdet_leakage_resistance)
-			mbhc->mbhc_cb->zdet_leakage_resistance(mbhc, true); /* disable 1M pull-up */
 	}
 #endif
 }
@@ -1027,7 +1019,7 @@ static void wcd_mbhc_swch_irq_handler(struct wcd_mbhc *mbhc)
 	if ((mbhc->current_plug == MBHC_PLUG_TYPE_NONE) &&
 	    detection_type) {
 
-		wcd_mbhc_set_hsj_connect(mbhc, 1);
+		wcd_mbhc_set_hsj_connect(component, 1);
 		/* If moisture is present, then enable polling, disable
 		 * moisture detection and wait for interrupt
 		 */
@@ -1143,7 +1135,7 @@ static void wcd_mbhc_swch_irq_handler(struct wcd_mbhc *mbhc)
 				mbhc->mbhc_cb->mbhc_moisture_detect_en(mbhc,
 									false);
 		}
-		wcd_mbhc_set_hsj_connect(mbhc, 0);
+		wcd_mbhc_set_hsj_connect(component, 0);
 
 	} else if (!detection_type) {
 		/* Disable external voltage source to micbias if present */

+ 0 - 12
asoc/codecs/wcd939x/wcd939x-mbhc.c

@@ -1344,17 +1344,6 @@ static void wcd939x_surge_reset_routine(struct wcd_mbhc *mbhc)
 	regcache_sync(wcd939x->regmap);
 }
 
-static void wcd939x_mbhc_zdet_leakage_resistance(struct wcd_mbhc *mbhc,
-							bool enable)
-{
-	if (enable)
-		snd_soc_component_update_bits(mbhc->component, WCD939X_ZDET_BIAS_CTL,
-				0x80, 0x80); /* disable 1M pull-up */
-	else
-		snd_soc_component_update_bits(mbhc->component, WCD939X_ZDET_BIAS_CTL,
-				0x80, 0x00); /* enable 1M pull-up */
-}
-
 static const struct wcd_mbhc_cb mbhc_cb = {
 	.request_irq = wcd939x_mbhc_request_irq,
 	.irq_control = wcd939x_mbhc_irq_control,
@@ -1381,7 +1370,6 @@ static const struct wcd_mbhc_cb mbhc_cb = {
 	.mbhc_moisture_detect_en = wcd939x_mbhc_moisture_detect_en,
 	.bcs_enable = wcd939x_mbhc_bcs_enable,
 	.surge_reset_routine = wcd939x_surge_reset_routine,
-	.zdet_leakage_resistance = wcd939x_mbhc_zdet_leakage_resistance,
 };
 
 static int wcd939x_get_hph_type(struct snd_kcontrol *kcontrol,

+ 0 - 5
asoc/codecs/wcd939x/wcd939x.c

@@ -443,11 +443,6 @@ static int wcd939x_init_reg(struct snd_soc_component *component)
 	if (wcd939x->version != WCD939X_VERSION_2_0)
 		snd_soc_component_write(component, WCD939X_CFG0, 0x05);
 
-	/*
-	 * Disable 1M pull-up by default during boot by writing 0b1 to bit[7].
-	 * This gets re-enabled when headset is inserted.
-	 */
-	snd_soc_component_update_bits(component, WCD939X_ZDET_BIAS_CTL, 0x80, 0x80);
 	return 0;
 }
 

+ 0 - 1
include/asoc/wcd-mbhc-v2.h

@@ -531,7 +531,6 @@ struct wcd_mbhc_cb {
 	void (*mbhc_moisture_polling_ctrl)(struct wcd_mbhc *mbhc, bool enable);
 	void (*mbhc_moisture_detect_en)(struct wcd_mbhc *mbhc, bool enable);
 	void (*surge_reset_routine)(struct wcd_mbhc *mbhc);
-	void (*zdet_leakage_resistance)(struct wcd_mbhc *mbhc, bool enable);
 };
 
 struct wcd_mbhc_fn {