Extcon:Don't report lineout device if mic detected
authoryaozm1 <yaozm1@lenovo.com>
Thu, 16 May 2019 02:55:04 +0000 (10:55 +0800)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:58 +0000 (20:23 +0300)
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)