Extcon:Don't report lineout device if mic detected
authoryaozm1 <yaozm1@lenovo.com>
Thu, 16 May 2019 02:55:04 +0000 (10:55 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:32:04 +0000 (17:32 +0800)
We see some case device with mic reported high
impedance, and reported as un-expected lineout.

Change-Id: Ic3b16a245b2ca411bcfe277f76ca86d3a680067f
Signed-off-by: yaozm1 <yaozm1@mt.com>
Reviewed-on: https://gerrit.mot.com/1355467
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/extcon/extcon-madera.c

index ccd7db6205553b384124d1908d6db365d03e4058..32b27882773274cb95f785ce5b671d3b98f4de53 100755 (executable)
@@ -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)