From: yaozm1 Date: Thu, 16 May 2019 02:55:04 +0000 (+0800) Subject: Extcon:Don't report lineout device if mic detected X-Git-Tag: MMI-RSBS31.Q1-48-36-26~167 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a0de0a197f61035510644b9c3e67766bd657c44f;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 --- 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)