From c11ffbb93bf0814b4d1c7647acb576b8c837414d Mon Sep 17 00:00:00 2001 From: Prasad Kumpatla Date: Tue, 28 Mar 2023 00:16:54 +0530 Subject: [PATCH] asoc: adc: check the interrupt status bit for hs_ins usbc USCI event gets called and removal is reported, where bit 0 of mbhc->intr_status i.e. (WCD_MBHC_ELEC_HS_INS) will be set to 0. So in adc_hs_ins_irq() we can check if the WCD_MBHC_ELEC_HS_INS bit is 0 or not, if 0 we just ignore the and return. Change-Id: I5a7753a077f53c5cd26c8ad199899ff9c81ef7b8 Signed-off-by: Prasad Kumpatla --- asoc/codecs/wcd-mbhc-adc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/asoc/codecs/wcd-mbhc-adc.c b/asoc/codecs/wcd-mbhc-adc.c index 0ec5b157ea..5e0abfaa52 100644 --- a/asoc/codecs/wcd-mbhc-adc.c +++ b/asoc/codecs/wcd-mbhc-adc.c @@ -1138,6 +1138,11 @@ static irqreturn_t wcd_mbhc_adc_hs_ins_irq(int irq, void *data) } while (--clamp_retry); WCD_MBHC_RSC_LOCK(mbhc); + + if (!(test_bit(WCD_MBHC_ELEC_HS_INS, &mbhc->intr_status))) { + WCD_MBHC_RSC_UNLOCK(mbhc); + return IRQ_HANDLED; + } /* * If current plug is headphone then there is no chance to * get ADC complete interrupt, so connected cable should be