From: yaozm1 Date: Thu, 16 May 2019 02:55:04 +0000 (+0800) Subject: Extcon:Don't report lineout device if mic detected X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ffbe80f2e1efdb94ce0f1235e92e10374c029082;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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)