summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-03-10 19:03:00 -0500
committerSolomon Peachy <pizza@shaftnet.org>2021-03-10 21:35:44 -0500
commit87e37a4d48ada935808aa85a86526b24ea482bb6 (patch)
tree3510f9dc2177d0993480e28cceabee1e2f35861c /firmware/drivers
parenta87abdb28f929623354270f257cc63bf73b3e74c (diff)
downloadrockbox-87e37a4d48ada935808aa85a86526b24ea482bb6.tar.gz
rockbox-87e37a4d48ada935808aa85a86526b24ea482bb6.zip
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
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/audio/xduoolinux_codec.c9
1 files changed, 7 insertions, 2 deletions
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){
141 141
142#if defined(XDUOO_X20) 142#if defined(XDUOO_X20)
143 sysfs_get_int(sysfs_bal_switch, &status); 143 sysfs_get_int(sysfs_bal_switch, &status);
144 if (status) ps = 3; // balance 144 if (status) ps = 3; // balanced output
145#endif 145#endif
146 146
147 xduoo_set_output(ps); 147 xduoo_set_output(ps);
@@ -159,7 +159,12 @@ void xduoo_set_output(int ps)
159 /* Output port switch */ 159 /* Output port switch */
160 last_ps = ps; 160 last_ps = ps;
161 alsa_controls_set_ints("Output Port Switch", 1, &last_ps); 161 alsa_controls_set_ints("Output Port Switch", 1, &last_ps);
162 audiohw_set_volume(vol_l_hw, vol_r_hw); 162 audiohw_set_volume(vol_l_hw, vol_r_hw);
163
164#if defined(XDUOO_X3II)
165 /* Enable/disable headphone remote ADC */
166 sysfs_set_string("/sys/devices/platform/earpods_adc.0/earpods_adc/earpods_adc_sw", (ps == 2) ? "on" : "off");
167#endif
163 } 168 }
164} 169}
165 170