From 87e37a4d48ada935808aa85a86526b24ea482bb6 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 10 Mar 2021 19:03:00 -0500 Subject: xduoo_x3ii: Improvements in the meymappings! * PREV/NEXT now swapped so they do what is expected in most contexts * List and setting context retains prior behavior * Enable the ADC that reads the headset remote and map the keys. * As ADC-based remote "events" arrive as press/release pairs, delay the button release. Change-Id: I22d4eac3bfe1573b50eca795cf377bdafdeb5336 --- firmware/drivers/audio/xduoolinux_codec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'firmware/drivers') diff --git a/firmware/drivers/audio/xduoolinux_codec.c b/firmware/drivers/audio/xduoolinux_codec.c index 3ce35aa62a..c78864db2c 100644 --- a/firmware/drivers/audio/xduoolinux_codec.c +++ b/firmware/drivers/audio/xduoolinux_codec.c @@ -141,7 +141,7 @@ int xduoo_get_outputs(void){ #if defined(XDUOO_X20) sysfs_get_int(sysfs_bal_switch, &status); - if (status) ps = 3; // balance + if (status) ps = 3; // balanced output #endif xduoo_set_output(ps); @@ -159,7 +159,12 @@ void xduoo_set_output(int ps) /* Output port switch */ last_ps = ps; alsa_controls_set_ints("Output Port Switch", 1, &last_ps); - audiohw_set_volume(vol_l_hw, vol_r_hw); + audiohw_set_volume(vol_l_hw, vol_r_hw); + +#if defined(XDUOO_X3II) + /* Enable/disable headphone remote ADC */ + sysfs_set_string("/sys/devices/platform/earpods_adc.0/earpods_adc/earpods_adc_sw", (ps == 2) ? "on" : "off"); +#endif } } -- cgit v1.2.3