Input: tsc200x - add axis inversion and swapping support

Since Commit ed7c9870c9 ("Input: of_touchscreen - add support for
inverted / swapped axes"), the of_touchscreen interface supports axis
inverting and swapping through device tree properties. Make use of this
feature.

Signed-off-by: Yunus Bas <y.bas@phytec.de>
Link: https://lore.kernel.org/r/20220209223933.1672782-1-y.bas@phytec.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Yunus Bas 2022-02-09 16:59:12 -08:00 committed by Dmitry Torokhov
parent e3217f5e73
commit e511fc5807

View File

@ -88,6 +88,8 @@ struct tsc200x {
int in_z1;
int in_z2;
struct touchscreen_properties prop;
spinlock_t lock;
struct timer_list penup_timer;
@ -113,8 +115,7 @@ static void tsc200x_update_pen_state(struct tsc200x *ts,
int x, int y, int pressure)
{
if (pressure) {
input_report_abs(ts->idev, ABS_X, x);
input_report_abs(ts->idev, ABS_Y, y);
touchscreen_report_pos(ts->idev, &ts->prop, x, y, false);
input_report_abs(ts->idev, ABS_PRESSURE, pressure);
if (!ts->pen_down) {
input_report_key(ts->idev, BTN_TOUCH, !!pressure);
@ -533,7 +534,7 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
input_set_abs_params(input_dev, ABS_PRESSURE,
0, MAX_12BIT, TSC200X_DEF_P_FUZZ, 0);
touchscreen_parse_properties(input_dev, false, NULL);
touchscreen_parse_properties(input_dev, false, &ts->prop);
/* Ensure the touchscreen is off */
tsc200x_stop_scan(ts);