Himanshu Aggarwal | bafe727 | 2015-07-20 19:32:49 +0530 | [diff] [blame] | 1 | #ifndef _UAPI_HBTP_INPUT_H |
| 2 | #define _UAPI_HBTP_INPUT_H |
| 3 | |
| 4 | #include <linux/input.h> |
| 5 | |
| 6 | #define HBTP_MAX_FINGER 20 |
| 7 | #define HBTP_ABS_MT_FIRST ABS_MT_TOUCH_MAJOR |
| 8 | #define HBTP_ABS_MT_LAST ABS_MT_TOOL_Y |
Alex Sarraf | 5532c00 | 2017-02-22 12:24:20 -0800 | [diff] [blame] | 9 | #define MAX_ROI_SIZE 144 |
| 10 | #define MAX_ACCEL_SIZE 128 |
Himanshu Aggarwal | bafe727 | 2015-07-20 19:32:49 +0530 | [diff] [blame] | 11 | |
Alex Sarraf | aa57dba | 2018-02-12 15:05:17 -0800 | [diff] [blame] | 12 | #define HBTP_FLAG_ACTIVE_BLOB 0x01 |
Himanshu Aggarwal | bafe727 | 2015-07-20 19:32:49 +0530 | [diff] [blame] | 13 | #define HBTP_EVENT_TYPE_DISPLAY "EVENT_TYPE=HBTP_DISPLAY" |
| 14 | |
| 15 | struct hbtp_input_touch { |
| 16 | bool active; |
| 17 | __s32 tool; |
| 18 | __s32 x; |
| 19 | __s32 y; |
| 20 | __s32 pressure; |
| 21 | __s32 major; |
| 22 | __s32 minor; |
| 23 | __s32 orientation; |
| 24 | }; |
| 25 | |
Alex Sarraf | 5532c00 | 2017-02-22 12:24:20 -0800 | [diff] [blame] | 26 | struct hbtp_sensor_data { |
| 27 | __s16 accelBuffer[MAX_ACCEL_SIZE]; |
| 28 | __s16 ROI[MAX_ROI_SIZE]; |
| 29 | }; |
| 30 | |
Himanshu Aggarwal | bafe727 | 2015-07-20 19:32:49 +0530 | [diff] [blame] | 31 | struct hbtp_input_mt { |
| 32 | __s32 num_touches; |
| 33 | struct hbtp_input_touch touches[HBTP_MAX_FINGER]; |
| 34 | struct timeval time_val; |
| 35 | }; |
| 36 | |
Alex Sarraf | aa57dba | 2018-02-12 15:05:17 -0800 | [diff] [blame] | 37 | struct hbtp_input_mt_ext { |
| 38 | __s32 num_touches; |
| 39 | struct hbtp_input_touch touches[HBTP_MAX_FINGER]; |
| 40 | struct timeval time_val; |
| 41 | __u32 flag; |
| 42 | }; |
| 43 | |
Himanshu Aggarwal | bafe727 | 2015-07-20 19:32:49 +0530 | [diff] [blame] | 44 | struct hbtp_input_absinfo { |
| 45 | bool active; |
| 46 | __u16 code; |
| 47 | __s32 minimum; |
| 48 | __s32 maximum; |
| 49 | }; |
| 50 | |
| 51 | enum hbtp_afe_power_cmd { |
| 52 | HBTP_AFE_POWER_ON, |
| 53 | HBTP_AFE_POWER_OFF, |
| 54 | }; |
| 55 | |
| 56 | struct hbtp_input_key { |
| 57 | __u32 code; |
| 58 | __s32 value; |
| 59 | }; |
| 60 | |
| 61 | enum hbtp_afe_signal { |
| 62 | HBTP_AFE_SIGNAL_ON_RESUME, |
| 63 | HBTP_AFE_SIGNAL_ON_SUSPEND, |
| 64 | }; |
| 65 | |
| 66 | enum hbtp_afe_power_ctrl { |
| 67 | HBTP_AFE_POWER_ENABLE_SYNC, |
| 68 | HBTP_AFE_POWER_ENABLE_SYNC_SIGNAL, |
| 69 | }; |
| 70 | |
| 71 | |
| 72 | /* ioctl */ |
| 73 | #define HBTP_INPUT_IOCTL_BASE 'T' |
| 74 | #define HBTP_SET_ABSPARAM _IOW(HBTP_INPUT_IOCTL_BASE, 201, \ |
| 75 | struct hbtp_input_absinfo *) |
| 76 | #define HBTP_SET_TOUCHDATA _IOW(HBTP_INPUT_IOCTL_BASE, 202, \ |
| 77 | struct hbtp_input_mt) |
| 78 | #define HBTP_SET_POWERSTATE _IOW(HBTP_INPUT_IOCTL_BASE, 203, \ |
| 79 | enum hbtp_afe_power_cmd) |
| 80 | #define HBTP_SET_KEYDATA _IOW(HBTP_INPUT_IOCTL_BASE, 204, \ |
| 81 | struct hbtp_input_key) |
| 82 | #define HBTP_SET_SYNCSIGNAL _IOW(HBTP_INPUT_IOCTL_BASE, 205, \ |
| 83 | enum hbtp_afe_signal) |
| 84 | #define HBTP_SET_POWER_CTRL _IOW(HBTP_INPUT_IOCTL_BASE, 206, \ |
| 85 | enum hbtp_afe_power_ctrl) |
Alex Sarraf | 5532c00 | 2017-02-22 12:24:20 -0800 | [diff] [blame] | 86 | #define HBTP_SET_SENSORDATA _IOW(HBTP_INPUT_IOCTL_BASE, 207, \ |
| 87 | struct hbtp_sensor_data) |
Alex Sarraf | aa57dba | 2018-02-12 15:05:17 -0800 | [diff] [blame] | 88 | #define HBTP_SET_TOUCHDATA_EXT _IOW(HBTP_INPUT_IOCTL_BASE, 208, \ |
| 89 | struct hbtp_input_mt_ext) |
Himanshu Aggarwal | bafe727 | 2015-07-20 19:32:49 +0530 | [diff] [blame] | 90 | |
| 91 | #endif /* _UAPI_HBTP_INPUT_H */ |
| 92 | |