From: Satish Kumar Reddy Date: Sat, 23 Feb 2019 04:06:21 +0000 (+0900) Subject: [RAMEN9610-14248] extcon: line out support X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=449044bb9d6c0eab097f5c464d3f71e9bbb49f9e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [RAMEN9610-14248] extcon: line out support Change-Id: Ic5ea097aa97305a093076ce5ebc5e36ad926fabb Signed-off-by: Satish Kumar Reddy --- diff --git a/drivers/extcon/extcon-madera.c b/drivers/extcon/extcon-madera.c index e9cabd29c547..cdab15ef5bdc 100644 --- a/drivers/extcon/extcon-madera.c +++ b/drivers/extcon/extcon-madera.c @@ -62,6 +62,7 @@ static const unsigned int madera_cable[] = { EXTCON_MECHANICAL, EXTCON_JACK_MICROPHONE, EXTCON_JACK_HEADPHONE, + EXTCON_JACK_LINE_OUT, EXTCON_NONE, }; @@ -669,6 +670,11 @@ inline void madera_extcon_report(struct madera_extcon *info, SW_MICROPHONE_INSERT, attached); break; + case EXTCON_JACK_LINE_OUT: + input_report_switch(info->input, + SW_LINEOUT_INSERT, + attached); + break; } input_sync(info->input); @@ -1854,7 +1860,11 @@ int madera_hpdet_reading(struct madera_extcon *info, int val) madera_set_headphone_imp(info, val); - madera_extcon_report(info, EXTCON_JACK_HEADPHONE, true); + /* Report high impedence cables as line outputs */ + if(val>= 5000) + madera_extcon_report(info, EXTCON_JACK_LINE_OUT, true); + else + madera_extcon_report(info, EXTCON_JACK_HEADPHONE, true); if (info->have_mic) madera_jds_set_state(info, &madera_micd_button); @@ -3409,6 +3419,9 @@ static int madera_extcon_probe(struct platform_device *pdev) input_set_capability(info->input, EV_SW, SW_JACK_PHYSICAL_INSERT); + input_set_capability(info->input, + EV_SW, + SW_LINEOUT_INSERT); } ret = input_register_device(info->input);