| From e0a1eef1da9cd09a541de492019afd0e14099579 Mon Sep 17 00:00:00 2001 |
| From: "Sergei A. Trusov" <sergei.a.trusov@ya.ru> |
| Date: Thu, 5 Mar 2020 19:53:06 -0800 |
| Subject: [PATCH] Input: goodix - fix touch coordinates on Cube I15-TC |
| |
| commit 1dd5ddc125b4625c3beb8e644ae872445d739bbc upstream. |
| |
| The touchscreen on the Cube I15-TC don't match the default display, |
| with 0,0 touches being reported when touching at the top-right of |
| the screen. |
| |
| Add a quirk to invert the x coordinate. |
| |
| Reported-and-tested-by: Arkadiy <arkan49@yandex.ru> |
| Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru> |
| Reviewed-by: Bastien Nocera <hadess@hadess.net> |
| Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c |
| index b99ace9b9a0e..ab18cc298d76 100644 |
| --- a/drivers/input/touchscreen/goodix.c |
| +++ b/drivers/input/touchscreen/goodix.c |
| @@ -153,6 +153,22 @@ static const struct dmi_system_id rotated_screen[] = { |
| {} |
| }; |
| |
| +/* |
| + * Those tablets have their x coordinate inverted |
| + */ |
| +static const struct dmi_system_id inverted_x_screen[] = { |
| +#if defined(CONFIG_DMI) && defined(CONFIG_X86) |
| + { |
| + .ident = "Cube I15-TC", |
| + .matches = { |
| + DMI_MATCH(DMI_SYS_VENDOR, "Cube"), |
| + DMI_MATCH(DMI_PRODUCT_NAME, "I15-TC") |
| + }, |
| + }, |
| +#endif |
| + {} |
| +}; |
| + |
| /** |
| * goodix_i2c_read - read data from a register of the i2c slave device. |
| * |
| @@ -739,6 +755,12 @@ static int goodix_configure_dev(struct goodix_ts_data *ts) |
| "Applying '180 degrees rotated screen' quirk\n"); |
| } |
| |
| + if (dmi_check_system(inverted_x_screen)) { |
| + ts->prop.invert_x = true; |
| + dev_dbg(&ts->client->dev, |
| + "Applying 'inverted x screen' quirk\n"); |
| + } |
| + |
| error = input_mt_init_slots(ts->input_dev, ts->max_touch_num, |
| INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); |
| if (error) { |
| -- |
| 2.27.0 |
| |