fiiom3k_linux: Enable HAVE_TOUCHPAD and add in missing bits

Change-Id: I78fa5fdb3648adfaa40f6d5f3c255666a85e2761
This commit is contained in:
Solomon Peachy 2021-04-01 07:15:25 -04:00
parent 1aed109fa8
commit 74ae18cc8a
3 changed files with 19 additions and 0 deletions

View file

@ -51,6 +51,9 @@
#define HAVE_BUTTON_LIGHT #define HAVE_BUTTON_LIGHT
#define HAVE_BUTTONLIGHT_BRIGHTNESS #define HAVE_BUTTONLIGHT_BRIGHTNESS
/* We have a touchpad */
#define HAVE_TOUCHPAD
/* Main LCD backlight brightness range and defaults: the backlight driver /* Main LCD backlight brightness range and defaults: the backlight driver
* has levels from 0 to 32. But 0 is off so start at 1. * has levels from 0 to 32. But 0 is off so start at 1.
*/ */

View file

@ -46,6 +46,8 @@ static int key_up_delay = 0;
static int key_down_delay = 0; static int key_down_delay = 0;
static int key_f12_delay = 0; static int key_f12_delay = 0;
static int tp_enabled = 1;
#define NR_POLL_DESC 2 #define NR_POLL_DESC 2
static struct pollfd poll_fds[NR_POLL_DESC]; static struct pollfd poll_fds[NR_POLL_DESC];
@ -236,6 +238,11 @@ void button_init_device(void)
} }
} }
void touchpad_enable_device(bool en)
{
tp_enabled = en;
}
int button_read_device(void) int button_read_device(void)
{ {
static int button_bitmap = 0; static int button_bitmap = 0;
@ -247,6 +254,9 @@ int button_read_device(void)
{ {
for(int i = 0; i < NR_POLL_DESC; i++) for(int i = 0; i < NR_POLL_DESC; i++)
{ {
if (i == 1 && !tp_enabled) /* Ignore touchpad ? */
continue;
/* read only if non-blocking */ /* read only if non-blocking */
if(poll_fds[i].revents & POLLIN) if(poll_fds[i].revents & POLLIN)
{ {

View file

@ -39,8 +39,14 @@
#define BUTTON_LEFT BUTTON_PREV #define BUTTON_LEFT BUTTON_PREV
#define BUTTON_RIGHT BUTTON_NEXT #define BUTTON_RIGHT BUTTON_NEXT
#define BUTTON_TOUCHPAD (BUTTON_UP|BUTTON_DOWN|BUTTON_PREV|BUTTON_NEXT|\
BUTTON_HOME|BUTTON_OPTION)
/* Software power-off */ /* Software power-off */
#define POWEROFF_BUTTON BUTTON_POWER #define POWEROFF_BUTTON BUTTON_POWER
#define POWEROFF_COUNT 25 #define POWEROFF_COUNT 25
void touchpad_enable_device(bool en);
#endif /* _BUTTON_TARGET_H_ */ #endif /* _BUTTON_TARGET_H_ */