From b5719eeb90ac26f20d0469a9c19eaebc047a8204 Mon Sep 17 00:00:00 2001 From: yaozm1 Date: Thu, 16 May 2019 10:55:04 +0800 Subject: [PATCH] Extcon:Don't report lineout device if mic detected We see some case device with mic reported high impedance, and reported as un-expected lineout. Change-Id: Ic3b16a245b2ca411bcfe277f76ca86d3a680067f Signed-off-by: yaozm1 Reviewed-on: https://gerrit.mot.com/1355467 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- drivers/extcon/extcon-madera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/extcon/extcon-madera.c b/drivers/extcon/extcon-madera.c index ccd7db620555..32b278827732 100755 --- a/drivers/extcon/extcon-madera.c +++ b/drivers/extcon/extcon-madera.c @@ -1830,9 +1830,9 @@ int madera_hpdet_reading(struct madera_extcon *info, int val) madera_set_headphone_imp(info, val); /* Report high impedence cables as line outputs */ - if(val>= 500000) + if(!info->have_mic && val>= 500000) madera_extcon_report(info, EXTCON_JACK_LINE_OUT, true); - else + else madera_extcon_report(info, EXTCON_JACK_HEADPHONE, true); if (info->have_mic) -- 2.20.1