0001
0002
0003
0004
0005
0006
0007 #ifndef _RMI_2D_SENSOR_H
0008 #define _RMI_2D_SENSOR_H
0009
0010 enum rmi_2d_sensor_object_type {
0011 RMI_2D_OBJECT_NONE,
0012 RMI_2D_OBJECT_FINGER,
0013 RMI_2D_OBJECT_STYLUS,
0014 RMI_2D_OBJECT_PALM,
0015 RMI_2D_OBJECT_UNCLASSIFIED,
0016 };
0017
0018 struct rmi_2d_sensor_abs_object {
0019 enum rmi_2d_sensor_object_type type;
0020 int mt_tool;
0021 u16 x;
0022 u16 y;
0023 u8 z;
0024 u8 wx;
0025 u8 wy;
0026 };
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 struct rmi_2d_sensor {
0044 struct rmi_2d_axis_alignment axis_align;
0045 struct input_mt_pos *tracking_pos;
0046 int *tracking_slots;
0047 bool kernel_tracking;
0048 struct rmi_2d_sensor_abs_object *objs;
0049 int dmax;
0050 u16 min_x;
0051 u16 max_x;
0052 u16 min_y;
0053 u16 max_y;
0054 u8 nbr_fingers;
0055 u8 *data_pkt;
0056 int pkt_size;
0057 int attn_size;
0058 bool topbuttonpad;
0059 enum rmi_sensor_type sensor_type;
0060 struct input_dev *input;
0061 struct rmi_function *fn;
0062 char input_phys[32];
0063 u8 report_abs;
0064 u8 report_rel;
0065 u8 x_mm;
0066 u8 y_mm;
0067 enum rmi_reg_state dribble;
0068 enum rmi_reg_state palm_detect;
0069 };
0070
0071 int rmi_2d_sensor_of_probe(struct device *dev,
0072 struct rmi_2d_sensor_platform_data *pdata);
0073
0074 void rmi_2d_sensor_abs_process(struct rmi_2d_sensor *sensor,
0075 struct rmi_2d_sensor_abs_object *obj,
0076 int slot);
0077
0078 void rmi_2d_sensor_abs_report(struct rmi_2d_sensor *sensor,
0079 struct rmi_2d_sensor_abs_object *obj,
0080 int slot);
0081
0082 void rmi_2d_sensor_rel_report(struct rmi_2d_sensor *sensor, int x, int y);
0083
0084 int rmi_2d_sensor_configure_input(struct rmi_function *fn,
0085 struct rmi_2d_sensor *sensor);
0086 #endif