From patchwork Thu Aug 30 12:46:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sergei A. Trusov" X-Patchwork-Id: 10581695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9268E920 for ; Thu, 30 Aug 2018 12:45:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F8742B9AC for ; Thu, 30 Aug 2018 12:45:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71F352BA1F; Thu, 30 Aug 2018 12:45:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFFEC2B9AC for ; Thu, 30 Aug 2018 12:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728853AbeH3Qrz (ORCPT ); Thu, 30 Aug 2018 12:47:55 -0400 Received: from forward105j.mail.yandex.net ([5.45.198.248]:38440 "EHLO forward105j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728713AbeH3Qrz (ORCPT ); Thu, 30 Aug 2018 12:47:55 -0400 Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward105j.mail.yandex.net (Yandex) with ESMTP id E62471814D7; Thu, 30 Aug 2018 15:45:53 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id OfVqfechXA-jrCKosA4; Thu, 30 Aug 2018 15:45:53 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1535633153; bh=BCMF+uQsKVe44YhTj0asx03/j3TMvnCM+ih3Ijx7v0M=; h=From:Subject:To:Cc:Message-ID:Date; b=XiCUre/sdtlGABIIFz9aqPtW4rddnJJTL8CgR+JCL/24vEEgnrnf+sf9D5aB+UeBD AR/IjAkw2IBpuyVeBq7yprlosQhwjpWoCDlJsRynFopnmW5lLjiXMkbmLW1IXrt60W PHXc91fjV+MpPp8ovFMDTjgkNldOBXTCq6cy/wsw= Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id SCUYLk2Fdv-jqc0jSxL; Thu, 30 Aug 2018 15:45:53 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1535633153; bh=BCMF+uQsKVe44YhTj0asx03/j3TMvnCM+ih3Ijx7v0M=; h=From:Subject:To:Cc:Message-ID:Date; b=XiCUre/sdtlGABIIFz9aqPtW4rddnJJTL8CgR+JCL/24vEEgnrnf+sf9D5aB+UeBD AR/IjAkw2IBpuyVeBq7yprlosQhwjpWoCDlJsRynFopnmW5lLjiXMkbmLW1IXrt60W PHXc91fjV+MpPp8ovFMDTjgkNldOBXTCq6cy/wsw= Authentication-Results: smtp4j.mail.yandex.net; dkim=pass header.i=@ya.ru From: "Sergei A. Trusov" Subject: [PATCH] Input: goodix: fix touch coordinates on Cube I15-TC To: Bastien Nocera , Dmitry Torokhov , linux-input@vger.kernel.org Cc: "Sergei A. Trusov" Message-ID: <8971de4a-74fc-d931-ca18-70e9e8836b35@ya.ru> Date: Thu, 30 Aug 2018 22:46:09 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The touchscreen on the Cube I15-TC don't match the default display, with 0,0 touches being reported when touching at the upper left of the screen. Add a quirk to invert the x coordinate. Reported-and-tested-by: Arkadiy Cc: Hans de Goede Signed-off-by: Sergei A. Trusov --- drivers/input/touchscreen/goodix.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index f2d9c2c41885..00b6eb09cee3 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -145,6 +145,24 @@ 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. * @@ -709,6 +727,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) {