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
This commit is contained in:
Solomon Peachy 2021-03-10 19:03:00 -05:00
parent a87abdb28f
commit 87e37a4d48
6 changed files with 68 additions and 30 deletions

View file

@ -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
}
}