From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757698AbbJIR5o (ORCPT ); Fri, 9 Oct 2015 13:57:44 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:59177 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757256AbbJIR5k (ORCPT ); Fri, 9 Oct 2015 13:57:40 -0400 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 RFC V2 2/3] Input: goodix - use "inverted_[xy]" flags instead of "rotated_screen" Date: Fri, 9 Oct 2015 19:55:51 +0200 Message-Id: <1444413352-24529-3-git-send-email-merker@debian.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444413352-24529-1-git-send-email-merker@debian.org> References: <1444413352-24529-1-git-send-email-merker@debian.org> X-Provags-ID: V03:K0:ditJMJX8RmQL1zW5EFUzqxq8nv7u8yAzPXHX2pUQUNDWUZ5iAGP 8IPwTgYM6JmZWHowXLFtmgX3YOfTzgW15llp3ncDg9B1ZXBUmdobf8JYoCPAKCHHexD2V7o XFBT9Ag2ewhR+vGVgNwnFrw792z2sl+YHUbHP71pd9vIUKEDvbxuQZUjRx7UoRVbsjACeKL v5d2TS65U7giLMG82RUfA== X-UI-Out-Filterresults: notjunk:1;V01:K0:v6w/64YCVo0=:akgWfRYVIZ60dn8lTNldst 9VCxpfIq7hzEAcqKgY/ddyjKZF4rplykSl2VOWu96jmKQvQ7JgRQ+IGrPNJLt+ATHKxwpn5m5 k7U1ACUVBtQA9ymwin2MRF3u5t0MYObxrLVkoM417NeUVljs3VQ1aMbi9aEKZbg8qBghhGCdC zAh1j/0b5s7DfyKQIwZ30gFJqiFeYID+ujdikfIAxfSmD0bfqeB3g5EwqtPFkEUCVVcvbjFO6 p4JbDMkE1av7jZBtqbOPpVFuoIkZzbUJaBQfZqLb+W6nM/EUFcGmrc5HjBJCYfvL69uF7csRe dBd1Om8PPzh+KsFThbIuB1ceceuG/ZNTcGRcVjT6jPNeRPTz89bGiMJVsmA92J5U1pspTnS/1 mbRi4fpcKAhxaR7HmvyKHM4SoSVyLBDrwx5zUlIQSZuKJ2xRs3aIxWHi0hLr5IjIbYqBiko0M hceB4D3yQ3cXvMKBWQrlx5rwIC//7yU2t2yKvuRUfenOZEGfIYUZs9wvme6b0SikKXCXO1/mY U1Cn/DQ+bwUW2XxxPy2B6cVIoLNjsXDdW8NIIc9eX8LBrme+VOhbOHetfacKNShDlMbzJFZKX 7fpQGncVdCFhVwfpGtD3592cATk/mWsiY5AFCFpUnOpwKDY/rz9rRw+QPAg+4xmpkVAdRV3E9 5KWfr33q0fT2VDvgwRG0424JOp2UnpGgMAJF5pIru+MPq2YnYlnHWz19NLZNjWD5friw= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_y 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 a05bdad..d910b27 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -40,7 +40,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; @@ -270,11 +269,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; @@ -701,10 +695,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