Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (c) 2011-2016 Synaptics Incorporated
0004  * Copyright (c) 2011 Unixphere
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  * @axis_align - controls parameters that are useful in system prototyping
0030  * and bring up.
0031  * @max_x - The maximum X coordinate that will be reported by this sensor.
0032  * @max_y - The maximum Y coordinate that will be reported by this sensor.
0033  * @nbr_fingers - How many fingers can this sensor report?
0034  * @data_pkt - buffer for data reported by this sensor.
0035  * @pkt_size - number of bytes in that buffer.
0036  * @attn_size - Size of the HID attention report (only contains abs data).
0037  * position when two fingers are on the device.  When this is true, we
0038  * assume we have one of those sensors and report events appropriately.
0039  * @sensor_type - indicates whether we're touchscreen or touchpad.
0040  * @input - input device for absolute pointing stream
0041  * @input_phys - buffer for the absolute phys name for this sensor.
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 /* _RMI_2D_SENSOR_H */