Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760932AbbKUNc1 (ORCPT ); Sat, 21 Nov 2015 08:32:27 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:61874 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760441AbbKUNbq (ORCPT ); Sat, 21 Nov 2015 08:31:46 -0500 From: Karsten Merker To: Bastien Nocera , Dmitry Torokhov , Irina Tirdea , Aleksei Mamlin , linux-input@vger.kernel.org, Ian Campbell Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , Karsten Merker Subject: [PATCH V4 2/3] Input: goodix - use "inverted_[xy]" flags instead of "rotated_screen" Date: Sat, 21 Nov 2015 14:30:21 +0100 Message-Id: <1448112622-2062-3-git-send-email-merker@debian.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448112622-2062-1-git-send-email-merker@debian.org> References: <1448112622-2062-1-git-send-email-merker@debian.org> X-Provags-ID: V03:K0:tQ2a61P4BAvXsdCq/zGAFLaa+H9iAu4crRNKT5VfxVOZnR4FhvD qbztPXmZRtrAZgWWqyjW85PtCVGj6MCaIWMItrk77GN7GjbhPBIulljANvHceDs7JHIQJLv edNIiT51JYUt3Q7bZJPCaRpk57t1lPaJuLROGIBrpIRo2Ue+XVb3S7Qt5QvbEkODQ1ztE4E x0cDt+dll7gm+VsgZ4HJg== X-UI-Out-Filterresults: notjunk:1;V01:K0:J2m1sIgEVkM=:HvfoW3QvvuOshg/I5fw1O9 FurmWQqXVrVeCUIS3QoPI/0TEJi2RENOR7Qtr/ozdrS4rpg0zNvX1nOVn77/pOGNEHVubXH/e KL4ZteU2bPeh49hu5cvpzG+UDoHXQR2h/zVt1ALKh+08dMiAyrK6La8nQ8uo2X7e6qrODD+VW vvNdDFgz7Xn0SXwG/81Tu7qbm2/r7FwMJp0/jdoSC0e4tyNAzQbcRt05EbgwTc02S9Iu6Z7b4 GgkJ0w6xJuEZW62X+U5iMr9LJ6coQ1nXzaV0Y3c1CDiwH2USuOWBsL41zorsxP+hxq8Hnt/QO dh4c/K2W/F01n7Sykr4AgX/Cig246a7Cg7G25HAzoewnARzjtbILumj1C9RluTk6ZdEvhrkcA fgihItBV6ckqU7cxe0pYuCkkY3Eb1k2fpRUFXow+C9GGajExOK6l4hnf2zOFO8u/uLaClEExJ L7UIBkHpZPcUE4vlPFBX8XD1imFGGKgrAz484ljmpyRhBq6mKT8p9h5QlUtV0oXfFISD8IDZJ QNa0BJBnTdxsgZsiDsex+EfEVvzNT8fJFS/1XJ+20Lqj48YD2/YYcj/++x6hf70bW0KQdUo1t uUqn4UsCnpidIUwaEhrr/RCbUtDC/8kC60QU8zXa/Q1cWPky5bVXA9uBOIzV8l41mWILgMkNP GJU/0tSN3UB7/BFo3kvfoQNUqMOSJ1bMQvn9ASWXeFFdyGS9F/ku2agqKTcYQqpnUXpM= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2212 Lines: 63 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 Reviewed-by: Irina Tirdea Tested-by: Bastien Nocera Acked-by: Bastien Nocera --- drivers/input/touchscreen/goodix.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 6985d72..2d888ea 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -39,7 +39,6 @@ struct goodix_ts_data { int abs_y_max; unsigned int max_touch_num; unsigned int int_trigger_type; - bool rotated_screen; int cfg_len; struct gpio_desc *gpiod_int; struct gpio_desc *gpiod_rst; @@ -267,11 +266,6 @@ static void goodix_ts_report_touch(struct goodix_ts_data *ts, u8 *coor_data) int input_y = get_unaligned_le16(&coor_data[3]); int input_w = get_unaligned_le16(&coor_data[5]); - if (ts->rotated_screen) { - input_x = ts->abs_x_max - input_x; - input_y = ts->abs_y_max - input_y; - } - /* Inversions have to happen before axis swapping */ if (ts->inverted_x) input_x = ts->abs_x_max - input_x; @@ -708,10 +702,12 @@ static void goodix_read_config(struct goodix_ts_data *ts) ts->max_touch_num = GOODIX_MAX_CONTACTS; } - ts->rotated_screen = dmi_check_system(rotated_screen); - if (ts->rotated_screen) + if (dmi_check_system(rotated_screen)) { + ts->inverted_x = true; + ts->inverted_y = true; dev_dbg(&ts->client->dev, "Applying '180 degrees rotated screen' quirk\n"); + } } /** -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/