|
33 | 33 | #include <linux/slab.h>
|
34 | 34 | #include <linux/firmware.h>
|
35 | 35 | #include <linux/input/mt.h>
|
| 36 | +#include <linux/input/touchscreen.h> |
36 | 37 | #include <linux/acpi.h>
|
37 | 38 | #include <linux/of.h>
|
38 | 39 | #include <linux/gpio/consumer.h>
|
@@ -137,6 +138,7 @@ struct elants_data {
|
137 | 138 | unsigned int y_res;
|
138 | 139 | unsigned int x_max;
|
139 | 140 | unsigned int y_max;
|
| 141 | + struct touchscreen_properties prop; |
140 | 142 |
|
141 | 143 | enum elants_state state;
|
142 | 144 | enum elants_iap_mode iap_mode;
|
@@ -876,8 +878,7 @@ static void elants_i2c_mt_event(struct elants_data *ts, u8 *buf)
|
876 | 878 |
|
877 | 879 | input_mt_slot(input, i);
|
878 | 880 | input_mt_report_slot_state(input, tool_type, true);
|
879 |
| - input_event(input, EV_ABS, ABS_MT_POSITION_X, x); |
880 |
| - input_event(input, EV_ABS, ABS_MT_POSITION_Y, y); |
| 881 | + touchscreen_report_pos(input, &ts->prop, x, y, true); |
881 | 882 | input_event(input, EV_ABS, ABS_MT_PRESSURE, p);
|
882 | 883 | input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, w);
|
883 | 884 |
|
@@ -1328,6 +1329,8 @@ static int elants_i2c_probe(struct i2c_client *client,
|
1328 | 1329 | input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
|
1329 | 1330 | input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1);
|
1330 | 1331 |
|
| 1332 | + touchscreen_parse_properties(ts->input, true, &ts->prop); |
| 1333 | + |
1331 | 1334 | error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM,
|
1332 | 1335 | INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
|
1333 | 1336 | if (error) {
|
|
0 commit comments