From patchwork Wed Sep 30 22:29:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karsten Merker X-Patchwork-Id: 7303071 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7A63B9F1D5 for ; Wed, 30 Sep 2015 22:31:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81C6320718 for ; Wed, 30 Sep 2015 22:31:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1EB72055A for ; Wed, 30 Sep 2015 22:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754934AbbI3WbE (ORCPT ); Wed, 30 Sep 2015 18:31:04 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:54887 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754360AbbI3Wa7 (ORCPT ); Wed, 30 Sep 2015 18:30:59 -0400 Received: from excalibur.cnev.de ([81.173.231.248]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0LgcCX-1aT77T3c4z-00o1ND; Thu, 01 Oct 2015 00:30:46 +0200 Received: from localhost ([127.0.0.1] helo=excalibur.cnev.de) by excalibur.cnev.de with esmtp (Exim 4.84) (envelope-from ) id 1ZhPtb-0001rM-OV; Thu, 01 Oct 2015 00:30:43 +0200 From: Karsten Merker To: Bastien Nocera , Dmitry Torokhov , Irina Tirdea Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , Karsten Merker Subject: [PATCH 2/2] Input: goodix - use "inverted_[xy]" flags instead of "rotated_screen" Date: Thu, 1 Oct 2015 00:29:55 +0200 Message-Id: <1443652195-7104-3-git-send-email-merker@debian.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443652195-7104-1-git-send-email-merker@debian.org> References: <1443652195-7104-1-git-send-email-merker@debian.org> X-Provags-ID: V03:K0:0gNQ55Yor+SzOgH0fKqK+tzZ52qVwdrAZm4TOUVUdpRg9ltxUtu PQsDuJ2jW+1zZICjQS0PZL1gWw8xDfUK9Oehj3qIsDQzrNwBQ5DUIGuEQcrL7V+Lru+z8K2 +jnKcT/QsQ/A1t2mMe2E5xrxQS7nJ6OKbkTxuIeOtaMojxZZ9uC/QvseBMjAnTIUwbKO8SI ilrkBo6PmnYsFLuU8p1ag== X-UI-Out-Filterresults: notjunk:1; V01:K0:d67s16lpLA0=:5dBMrTxqQW7eQrp1kMOHg3 jdsJ2EvAiyQn2SUDkddXrcxI/nq8qoMueD/ZL8pu12513tL0KvuIPm/M56mGXhSpWKgaUKmOq WPvUOMR6zg818di+w4wPKfyLMpslXQSLt1iaZx6ivPN/WbxAbAW1ytYqnG8Mgg1JVYQ9YcKBJ PGlm556bmI3xIiIkddvJy4Nu3H4OeEv1P2q+Eba+k52Ph6MlNTBiyBz1F53tWX9uUeg4mhGOC PnWJSQDGfFQd3zMl5Lzm3/E1Nchis6J7AHrh71ntJ7aIrOcaXOmWAM7obH/ZvwXQepbWhHcZY qSebC/b5/Mse1oxm+wsuH+hfWerVfp/h7pbpYRwgiiN9auUPILHt0BmOY6op2FbCeujVVx87l nlXqPUQgDO25s+RXklDsfXI9dnySfwPQaDCk1GmLBWIUOnORK76eUE6tkLnDZXOlrJmRyYGEt qzzwquv42Ta4HN5BDKstQA3oH8ZxU7x4h/7GUeu4jMBgnW5dH5dSH5YUyLuZI+k8/f/geY0bd f/hyJvcF0uxIvqNHjhxk82kzNrnZxf0SaWG9aZTPMbkvDoXTk6B3RU5sk9QLRXAIDduXVNZRq LUhX1uf5TJjeardiWCwZ0qTKS9QqMe8zCwU4kHR/7eKsDCLflNOVaiiZc9KMJv2UVKqIeWUFI q6Cl1guWQLJ6l4Weo47O5F/TtJFq++izJPOi4Q56rexqPdNHSQ8wxfxhqWvsY+4bkmfY= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 any more. This patch replaces it by setting the inverted-x and inverted-x flags instead. Signed-off-by: Karsten Merker --- 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 f2b1590..6ce909c 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; @@ -261,11 +260,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; @@ -705,10 +699,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"); + } } /**