|
19 | 19 | #include <linux/firmware.h> |
20 | 20 | #include <linux/i2c.h> |
21 | 21 | #include <linux/input/mt.h> |
| 22 | +#include <linux/input/touchscreen.h> |
22 | 23 | #include <linux/interrupt.h> |
23 | 24 | #include <linux/irq.h> |
24 | 25 | #include <linux/of.h> |
@@ -355,6 +356,8 @@ struct mxt_data { |
355 | 356 | enum mxt_suspend_mode suspend_mode; |
356 | 357 |
|
357 | 358 | u32 wakeup_method; |
| 359 | + |
| 360 | + struct touchscreen_properties prop; |
358 | 361 | }; |
359 | 362 |
|
360 | 363 | struct mxt_vb2_buffer { |
@@ -888,8 +891,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message) |
888 | 891 |
|
889 | 892 | /* Touch active */ |
890 | 893 | input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, 1); |
891 | | - input_report_abs(input_dev, ABS_MT_POSITION_X, x); |
892 | | - input_report_abs(input_dev, ABS_MT_POSITION_Y, y); |
| 894 | + touchscreen_report_pos(input_dev, &data->prop, x, y, true); |
893 | 895 | input_report_abs(input_dev, ABS_MT_PRESSURE, amplitude); |
894 | 896 | input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, area); |
895 | 897 | } else { |
@@ -1010,8 +1012,7 @@ static void mxt_proc_t100_message(struct mxt_data *data, u8 *message) |
1010 | 1012 | id, type, x, y, major, pressure, orientation); |
1011 | 1013 |
|
1012 | 1014 | input_mt_report_slot_state(input_dev, tool, 1); |
1013 | | - input_report_abs(input_dev, ABS_MT_POSITION_X, x); |
1014 | | - input_report_abs(input_dev, ABS_MT_POSITION_Y, y); |
| 1015 | + touchscreen_report_pos(input_dev, &data->prop, x, y, true); |
1015 | 1016 | input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, major); |
1016 | 1017 | input_report_abs(input_dev, ABS_MT_PRESSURE, pressure); |
1017 | 1018 | input_report_abs(input_dev, ABS_MT_DISTANCE, distance); |
@@ -2212,6 +2213,8 @@ static int mxt_initialize_input_device(struct mxt_data *data) |
2212 | 2213 | 0, 255, 0, 0); |
2213 | 2214 | } |
2214 | 2215 |
|
| 2216 | + touchscreen_parse_properties(input_dev, true, &data->prop); |
| 2217 | + |
2215 | 2218 | /* For T15 and T97 Key Array */ |
2216 | 2219 | if (data->T15_reportid_min || data->T97_reportid_min) { |
2217 | 2220 | for (i = 0; i < data->t15_num_keys; i++) |
|
0 commit comments