From 449044bb9d6c0eab097f5c464d3f71e9bbb49f9e Mon Sep 17 00:00:00 2001 From: Satish Kumar Reddy Date: Sat, 23 Feb 2019 13:06:21 +0900 Subject: [PATCH] [RAMEN9610-14248] extcon: line out support Change-Id: Ic5ea097aa97305a093076ce5ebc5e36ad926fabb Signed-off-by: Satish Kumar Reddy --- drivers/extcon/extcon-madera.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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); -- 2.20.1