Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: goodix - use "inverted_[xy]" flags instead of "rotated_screen"

The goodix touchscreen driver uses a "rotated_screen" flag for
systems on which the touchscreen is mounted rotated by 180
degrees with respect to the display. With the addition of
support for the dt properties "touchscreen-inverted-x" and
"touchscreen-inverted-y", a separate "rotated_screen" flag
is not necessary anymore. This patch replaces it by setting
the inverted_x and inverted_y flags instead.

Signed-off-by: Karsten Merker <merker@debian.org>
Reviewed-by: Irina Tirdea <irina.tirdea@intel.com>
Tested-by: Bastien Nocera <hadess@hadess.net>
Acked-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Karsten Merker and committed by
Dmitry Torokhov
57c80e8e ad48cf5e

+4 -8
+4 -8
drivers/input/touchscreen/goodix.c
··· 41 41 bool inverted_y; 42 42 unsigned int max_touch_num; 43 43 unsigned int int_trigger_type; 44 - bool rotated_screen; 45 44 int cfg_len; 46 45 struct gpio_desc *gpiod_int; 47 46 struct gpio_desc *gpiod_rst; ··· 232 233 int input_x = get_unaligned_le16(&coor_data[1]); 233 234 int input_y = get_unaligned_le16(&coor_data[3]); 234 235 int input_w = get_unaligned_le16(&coor_data[5]); 235 - 236 - if (ts->rotated_screen) { 237 - input_x = ts->abs_x_max - input_x; 238 - input_y = ts->abs_y_max - input_y; 239 - } 240 236 241 237 /* Inversions have to happen before axis swapping */ 242 238 if (ts->inverted_x) ··· 515 521 ts->max_touch_num = GOODIX_MAX_CONTACTS; 516 522 } 517 523 518 - ts->rotated_screen = dmi_check_system(rotated_screen); 519 - if (ts->rotated_screen) 524 + if (dmi_check_system(rotated_screen)) { 525 + ts->inverted_x = true; 526 + ts->inverted_y = true; 520 527 dev_dbg(&ts->client->dev, 521 528 "Applying '180 degrees rotated screen' quirk\n"); 529 + } 522 530 } 523 531 524 532 /**