summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-04-01 07:15:25 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-04-05 13:57:01 +0000
commit74ae18cc8a30fbc9af17c7124f71e4096274989c (patch)
tree0832457518a554851aba55f645fc2ea2924e1813 /firmware/target
parent1aed109fa8c2a9e5a788295f523642bc71269351 (diff)
downloadrockbox-74ae18cc8a30fbc9af17c7124f71e4096274989c.tar.gz
rockbox-74ae18cc8a30fbc9af17c7124f71e4096274989c.zip
fiiom3k_linux: Enable HAVE_TOUCHPAD and add in missing bits
Change-Id: I78fa5fdb3648adfaa40f6d5f3c255666a85e2761
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/fiio/button-fiio.c10
-rw-r--r--firmware/target/hosted/fiio/button-target.h6
2 files changed, 16 insertions, 0 deletions
diff --git a/firmware/target/hosted/fiio/button-fiio.c b/firmware/target/hosted/fiio/button-fiio.c
index 4acbfb0ea7..ffd2fbc454 100644
--- a/firmware/target/hosted/fiio/button-fiio.c
+++ b/firmware/target/hosted/fiio/button-fiio.c
@@ -46,6 +46,8 @@ static int key_up_delay = 0;
46static int key_down_delay = 0; 46static int key_down_delay = 0;
47static int key_f12_delay = 0; 47static int key_f12_delay = 0;
48 48
49static int tp_enabled = 1;
50
49#define NR_POLL_DESC 2 51#define NR_POLL_DESC 2
50static struct pollfd poll_fds[NR_POLL_DESC]; 52static struct pollfd poll_fds[NR_POLL_DESC];
51 53
@@ -236,6 +238,11 @@ void button_init_device(void)
236 } 238 }
237} 239}
238 240
241void touchpad_enable_device(bool en)
242{
243 tp_enabled = en;
244}
245
239int button_read_device(void) 246int button_read_device(void)
240{ 247{
241 static int button_bitmap = 0; 248 static int button_bitmap = 0;
@@ -247,6 +254,9 @@ int button_read_device(void)
247 { 254 {
248 for(int i = 0; i < NR_POLL_DESC; i++) 255 for(int i = 0; i < NR_POLL_DESC; i++)
249 { 256 {
257 if (i == 1 && !tp_enabled) /* Ignore touchpad ? */
258 continue;
259
250 /* read only if non-blocking */ 260 /* read only if non-blocking */
251 if(poll_fds[i].revents & POLLIN) 261 if(poll_fds[i].revents & POLLIN)
252 { 262 {
diff --git a/firmware/target/hosted/fiio/button-target.h b/firmware/target/hosted/fiio/button-target.h
index 7098eaf9f3..92298960f8 100644
--- a/firmware/target/hosted/fiio/button-target.h
+++ b/firmware/target/hosted/fiio/button-target.h
@@ -39,8 +39,14 @@
39#define BUTTON_LEFT BUTTON_PREV 39#define BUTTON_LEFT BUTTON_PREV
40#define BUTTON_RIGHT BUTTON_NEXT 40#define BUTTON_RIGHT BUTTON_NEXT
41 41
42#define BUTTON_TOUCHPAD (BUTTON_UP|BUTTON_DOWN|BUTTON_PREV|BUTTON_NEXT|\
43 BUTTON_HOME|BUTTON_OPTION)
44
42/* Software power-off */ 45/* Software power-off */
43#define POWEROFF_BUTTON BUTTON_POWER 46#define POWEROFF_BUTTON BUTTON_POWER
44#define POWEROFF_COUNT 25 47#define POWEROFF_COUNT 25
45 48
49void touchpad_enable_device(bool en);
50
51
46#endif /* _BUTTON_TARGET_H_ */ 52#endif /* _BUTTON_TARGET_H_ */