소스 검색

asoc: mbhc: enable l_det_en bit

enable l_det_en bit while detecting the HS.

Issue: While removing HS some additional electrical interrupts
are triggered and reporting different events to userspace, which is
cause issues. To avoid this electrical interrupt flow, there is
a check in adc_hs_rem_irq for wcd_swch_level_remove() to check
for l_det_en bit status. Depends on this it will return from the
adc_hs_rem_irq() without going further.

Solution: Enabling the l_det_en bit will helps to avoid serving
electrical interrupt flow to further in adc_hs_rem_irq().So this
will helps to stop reporting different/unwanted events to user space.

Change-Id: I29d72b65ebb59969b69f3f8c7f4c7eb2debb0f1c
Signed-off-by: Prasad Kumpatla <[email protected]>
Prasad Kumpatla 2 년 전
부모
커밋
1399d39839
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      asoc/codecs/wcd-mbhc-v2.c

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

@@ -1696,7 +1696,7 @@ static int wcd_mbhc_usbc_ana_event_handler(struct notifier_block *nb,
 #endif
 		if (mbhc->mbhc_cb->clk_setup)
 			mbhc->mbhc_cb->clk_setup(mbhc->component, true);
-
+		WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_L_DET_EN, 1);
 
 #if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C)
 		if (unlikely((mbhc->mbhc_cb->lock_sleep(mbhc, true)) == false))
@@ -1713,8 +1713,6 @@ static int wcd_mbhc_usbc_ana_event_handler(struct notifier_block *nb,
 		WCD_MBHC_REG_READ(WCD_MBHC_MECH_DETECTION_TYPE, detection_type);
 		if ((mode == TYPEC_ACCESSORY_NONE) && !detection_type) {
 			wcd_usbss_switch_update(WCD_USBSS_AATC, WCD_USBSS_CABLE_DISCONNECT);
-			/* removal detected, disable L_DET_EN */
-			WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_L_DET_EN, 0);
 			if (unlikely((mbhc->mbhc_cb->lock_sleep(mbhc, true)) == false))
 				pr_warn("%s: failed to hold suspend\n", __func__);
 			else {