Skip to content

Commit fd321a8

Browse files
clamor-sdtor
authored andcommitted
Input: atmel_mxt_ts - add support for generic touchscreen configurations
This provides support for generic touchscreen configuration options like swapped-x-y, min-x, min-y, size-x, size-y, etc. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Link: https://lore.kernel.org/r/20250909054903.11519-3-clamor95@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent b90d027 commit fd321a8

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/firmware.h>
2020
#include <linux/i2c.h>
2121
#include <linux/input/mt.h>
22+
#include <linux/input/touchscreen.h>
2223
#include <linux/interrupt.h>
2324
#include <linux/irq.h>
2425
#include <linux/of.h>
@@ -355,6 +356,8 @@ struct mxt_data {
355356
enum mxt_suspend_mode suspend_mode;
356357

357358
u32 wakeup_method;
359+
360+
struct touchscreen_properties prop;
358361
};
359362

360363
struct mxt_vb2_buffer {
@@ -888,8 +891,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
888891

889892
/* Touch active */
890893
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);
893895
input_report_abs(input_dev, ABS_MT_PRESSURE, amplitude);
894896
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, area);
895897
} else {
@@ -1010,8 +1012,7 @@ static void mxt_proc_t100_message(struct mxt_data *data, u8 *message)
10101012
id, type, x, y, major, pressure, orientation);
10111013

10121014
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);
10151016
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, major);
10161017
input_report_abs(input_dev, ABS_MT_PRESSURE, pressure);
10171018
input_report_abs(input_dev, ABS_MT_DISTANCE, distance);
@@ -2212,6 +2213,8 @@ static int mxt_initialize_input_device(struct mxt_data *data)
22122213
0, 255, 0, 0);
22132214
}
22142215

2216+
touchscreen_parse_properties(input_dev, true, &data->prop);
2217+
22152218
/* For T15 and T97 Key Array */
22162219
if (data->T15_reportid_min || data->T97_reportid_min) {
22172220
for (i = 0; i < data->t15_num_keys; i++)

0 commit comments

Comments
 (0)