blob: 8bc189f195b7aa1d011e9be30eb6bd74048cfd12 [file] [log] [blame]
Himanshu Aggarwalbafe7272015-07-20 19:32:49 +05301#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 Sarraf5532c002017-02-22 12:24:20 -08009#define MAX_ROI_SIZE 144
10#define MAX_ACCEL_SIZE 128
Himanshu Aggarwalbafe7272015-07-20 19:32:49 +053011
Alex Sarrafaa57dba2018-02-12 15:05:17 -080012#define HBTP_FLAG_ACTIVE_BLOB 0x01
Himanshu Aggarwalbafe7272015-07-20 19:32:49 +053013#define HBTP_EVENT_TYPE_DISPLAY "EVENT_TYPE=HBTP_DISPLAY"
14
15struct 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 Sarraf5532c002017-02-22 12:24:20 -080026struct hbtp_sensor_data {
27 __s16 accelBuffer[MAX_ACCEL_SIZE];
28 __s16 ROI[MAX_ROI_SIZE];
29};
30
Himanshu Aggarwalbafe7272015-07-20 19:32:49 +053031struct hbtp_input_mt {
32 __s32 num_touches;
33 struct hbtp_input_touch touches[HBTP_MAX_FINGER];
34 struct timeval time_val;
35};
36
Alex Sarrafaa57dba2018-02-12 15:05:17 -080037struct 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 Aggarwalbafe7272015-07-20 19:32:49 +053044struct hbtp_input_absinfo {
45 bool active;
46 __u16 code;
47 __s32 minimum;
48 __s32 maximum;
49};
50
51enum hbtp_afe_power_cmd {
52 HBTP_AFE_POWER_ON,
53 HBTP_AFE_POWER_OFF,
54};
55
56struct hbtp_input_key {
57 __u32 code;
58 __s32 value;
59};
60
61enum hbtp_afe_signal {
62 HBTP_AFE_SIGNAL_ON_RESUME,
63 HBTP_AFE_SIGNAL_ON_SUSPEND,
64};
65
66enum 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 Sarraf5532c002017-02-22 12:24:20 -080086#define HBTP_SET_SENSORDATA _IOW(HBTP_INPUT_IOCTL_BASE, 207, \
87 struct hbtp_sensor_data)
Alex Sarrafaa57dba2018-02-12 15:05:17 -080088#define HBTP_SET_TOUCHDATA_EXT _IOW(HBTP_INPUT_IOCTL_BASE, 208, \
89 struct hbtp_input_mt_ext)
Himanshu Aggarwalbafe7272015-07-20 19:32:49 +053090
91#endif /* _UAPI_HBTP_INPUT_H */
92