1
2
3
4
5
6
7
8
9
10#ifndef _RMI_2D_SENSOR_H
11#define _RMI_2D_SENSOR_H
12
13enum rmi_2d_sensor_object_type {
14 RMI_2D_OBJECT_NONE,
15 RMI_2D_OBJECT_FINGER,
16 RMI_2D_OBJECT_STYLUS,
17 RMI_2D_OBJECT_PALM,
18 RMI_2D_OBJECT_UNCLASSIFIED,
19};
20
21struct rmi_2d_sensor_abs_object {
22 enum rmi_2d_sensor_object_type type;
23 int mt_tool;
24 u16 x;
25 u16 y;
26 u8 z;
27 u8 wx;
28 u8 wy;
29};
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46struct rmi_2d_sensor {
47 struct rmi_2d_axis_alignment axis_align;
48 struct input_mt_pos *tracking_pos;
49 int *tracking_slots;
50 bool kernel_tracking;
51 struct rmi_2d_sensor_abs_object *objs;
52 int dmax;
53 u16 min_x;
54 u16 max_x;
55 u16 min_y;
56 u16 max_y;
57 u8 nbr_fingers;
58 u8 *data_pkt;
59 int pkt_size;
60 int attn_size;
61 bool topbuttonpad;
62 enum rmi_sensor_type sensor_type;
63 struct input_dev *input;
64 struct rmi_function *fn;
65 char input_phys[32];
66 u8 report_abs;
67 u8 report_rel;
68 u8 x_mm;
69 u8 y_mm;
70 enum rmi_reg_state dribble;
71 enum rmi_reg_state palm_detect;
72};
73
74int rmi_2d_sensor_of_probe(struct device *dev,
75 struct rmi_2d_sensor_platform_data *pdata);
76
77void rmi_2d_sensor_abs_process(struct rmi_2d_sensor *sensor,
78 struct rmi_2d_sensor_abs_object *obj,
79 int slot);
80
81void rmi_2d_sensor_abs_report(struct rmi_2d_sensor *sensor,
82 struct rmi_2d_sensor_abs_object *obj,
83 int slot);
84
85void rmi_2d_sensor_rel_report(struct rmi_2d_sensor *sensor, int x, int y);
86
87int rmi_2d_sensor_configure_input(struct rmi_function *fn,
88 struct rmi_2d_sensor *sensor);
89#endif
90