summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/aigo/button-erosq.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/aigo/button-erosq.c')
-rw-r--r--firmware/target/hosted/aigo/button-erosq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/hosted/aigo/button-erosq.c b/firmware/target/hosted/aigo/button-erosq.c
index 2735c48c71..db7f7e24e5 100644
--- a/firmware/target/hosted/aigo/button-erosq.c
+++ b/firmware/target/hosted/aigo/button-erosq.c
@@ -38,7 +38,7 @@
38#include "backlight-target.h" 38#include "backlight-target.h"
39#include "erosqlinux_codec.h" 39#include "erosqlinux_codec.h"
40 40
41#define NR_POLL_DESC 3 41#define NR_POLL_DESC 2
42static struct pollfd poll_fds[NR_POLL_DESC]; 42static struct pollfd poll_fds[NR_POLL_DESC];
43 43
44static int button_map(int keycode) 44static int button_map(int keycode)
@@ -82,18 +82,18 @@ static int button_map(int keycode)
82 82
83void button_init_device(void) 83void button_init_device(void)
84{ 84{
85 const char * const input_devs[] = { 85 const char * const input_devs[NR_POLL_DESC] = {
86 "/dev/input/event0", // Rotary encoder 86 "/dev/input/event0", // Rotary encoder
87 "/dev/input/event1" // Keys 87 "/dev/input/event1" // Keys
88 }; 88 };
89 89
90 for(int i = 0; i < NR_POLL_DESC; i++) 90 for(int i = 0; i < NR_POLL_DESC; i++)
91 { 91 {
92 int fd = open(input_devs[i], O_RDWR | O_CLOEXEC); 92 int fd = open(input_devs[i], O_RDONLY | O_CLOEXEC);
93 93
94 if(fd < 0) 94 if(fd < 0)
95 { 95 {
96 panicf("Cannot open input device: %s\n", input_devs[i]); 96 panicf("Cannot open input device: %s (%d)\n", input_devs[i], errno);
97 } 97 }
98 98
99 poll_fds[i].fd = fd; 99 poll_fds[i].fd = fd;