[PATCH 3/3] Input: stmfts - use touchscreen_report_pos() for coordinates

From: Dmitry Torokhov

Date: Tue Nov 03 2026 - 18:03:58 EST


During driver initialization, stmfts_probe() invokes
touchscreen_parse_properties() to parse axis inversion and swapping
properties into sdata->prop.

However, stmfts_report_contact_event(), stmfts5_report_contact_event(),
and stmfts_report_hover_event() continue to report coordinates directly
using input_report_abs(), ignoring any configured axis inversion or
swapping settings in sdata->prop.

Update coordinate reporting across all three functions to use
touchscreen_report_pos() with &sdata->prop so that axis inversion and
swapping transformations are properly applied.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/input/touchscreen/stmfts.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
index 25d127aa8642..f68da3e1309b 100644
--- a/drivers/input/touchscreen/stmfts.c
+++ b/drivers/input/touchscreen/stmfts.c
@@ -241,8 +241,7 @@ static void stmfts_report_contact_event(struct stmfts_data *sdata,
input_mt_slot(sdata->input, slot_id);

input_mt_report_slot_state(sdata->input, MT_TOOL_FINGER, true);
- input_report_abs(sdata->input, ABS_MT_POSITION_X, x);
- input_report_abs(sdata->input, ABS_MT_POSITION_Y, y);
+ touchscreen_report_pos(sdata->input, &sdata->prop, x, y, true);
input_report_abs(sdata->input, ABS_MT_TOUCH_MAJOR, maj);
input_report_abs(sdata->input, ABS_MT_TOUCH_MINOR, min);
input_report_abs(sdata->input, ABS_MT_PRESSURE, area);
@@ -344,8 +343,7 @@ static void stmfts5_report_contact_event(struct stmfts_data *sdata,
input_mt_slot(sdata->input, touch_id);
input_mt_report_slot_state(sdata->input, tool, true);

- input_report_abs(sdata->input, ABS_MT_POSITION_X, x);
- input_report_abs(sdata->input, ABS_MT_POSITION_Y, y);
+ touchscreen_report_pos(sdata->input, &sdata->prop, x, y, true);
input_report_abs(sdata->input, ABS_MT_TOUCH_MAJOR, maj);
input_report_abs(sdata->input, ABS_MT_TOUCH_MINOR, min);
input_report_abs(sdata->input, ABS_MT_PRESSURE, area);
@@ -375,8 +373,7 @@ static void stmfts_report_hover_event(struct stmfts_data *sdata,
u16 y = (event[3] << 4) | (event[4] & STMFTS_MASK_Y_LSB);
u8 z = event[5];

- input_report_abs(sdata->input, ABS_X, x);
- input_report_abs(sdata->input, ABS_Y, y);
+ touchscreen_report_pos(sdata->input, &sdata->prop, x, y, false);
input_report_abs(sdata->input, ABS_DISTANCE, z);

input_sync(sdata->input);
--
2.56.0.385.gac671c819a-goog