From patchwork Fri Aug 16 08:35:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11097267 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 3908114DB for ; Fri, 16 Aug 2019 08:38:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 280BA289CA for ; Fri, 16 Aug 2019 08:38:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B35F289DC; Fri, 16 Aug 2019 08:38: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=-7.9 required=2.0 tests=BAYES_00,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 B5E41289CA for ; Fri, 16 Aug 2019 08:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727444AbfHPIi5 (ORCPT ); Fri, 16 Aug 2019 04:38:57 -0400 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:1980 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727026AbfHPIi4 (ORCPT ); Fri, 16 Aug 2019 04:38:56 -0400 IronPort-SDR: aqFHjrVGMWe/JZC1rW3Y9bUIQzHtg12F1JVq8lvDLqmiLcNibf1Df+mBACKpqyCDpnFL0fu5ll JQnqz3akg2NJ2yCvxEpQFdeSWbrTCwwZeoUB2ioTFz+SY1RBJUxG0OC6RQMRbRAp/aOzB8YaKI o8uD0h/hp24or5u4VUZv3QI/t646Fx+ynJx3hONdTCS6Ub/48HH0upLdCH6wWVllj9SfFrQymD mt3Tn6tAfyAGZhOyATqRuMa1EkUS7oCzJET7INHecP4KEOWHronzNA7n17qPX1Oz6fv62Gr6Fi c0w= X-IronPort-AV: E=Sophos;i="5.64,391,1559548800"; d="scan'208";a="40484322" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 16 Aug 2019 00:35:50 -0800 IronPort-SDR: Uoz8Nmj8PKRr0iC7DA17jGPArsoTJUpEBaYLSNQtgnO1JJcivu8D0JAZnFjQz6yk1KMTcjJYjy Olbq1V0wHIruiDEoBI20en8YSNt7LFRFOShnWdgUJGysaAeJKP07pheAKTZLqfJMWB2lgawJa1 6TfNXPWJGDEh2NLRZg7N0oJzy6XhGXvq2a7hWocTnFaEHZeD1aYEP+vVlcKRUEnDkwcAZqBzmd +00p5sqaelyfE497ihFyvWwiQDDuIUAi9HfRxyyATp/xRKuFAYu4ApOkrv95EyIvrv1U85XUOQ jtA= From: Jiada Wang To: , CC: , , , Subject: [PATCH v1 40/63] input: atmel_mxt_ts: Add Missing Delay for reset handling of Atmel touch panel controller in detachable displays. Date: Fri, 16 Aug 2019 17:35:35 +0900 Message-ID: <20190816083558.19189-1-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) 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 From: keerthikumarp In case of attached display, the touchpanel reset is controlled via imx gpio's from atmel driver and the delay between touchpanel reset and the time at which the chip becomes capable to communicate with the host processor, has be taken care. However in case of detachable displays, the touchpanel reset is controlled via a deserializer gpio which is triggered just before the atmel driver is probed.The delay between touchpanel reset and the time at which the chip becomes capable to communicate (as specified in datasheet) was not being accounted for. This patch introduces that delay. Signed-off-by: keerthikumarp Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 3b9544c0a209..bc94adec6631 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -4407,6 +4407,10 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) msleep(MXT_RESET_GPIO_TIME); gpiod_set_value(data->reset_gpio, 1); msleep(MXT_RESET_INVALID_CHG); + } else { + dev_dbg(&client->dev, + "atmel reset pin not found in device tree"); + msleep(MXT_RESET_TIME); } error = sysfs_create_group(&client->dev.kobj, &mxt_fw_attr_group); From patchwork Fri Aug 16 08:35:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11097293 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 A267A1395 for ; Fri, 16 Aug 2019 08:39:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91CC7289CA for ; Fri, 16 Aug 2019 08:39:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85CF3289DC; Fri, 16 Aug 2019 08:39:56 +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=-7.9 required=2.0 tests=BAYES_00,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 28FD5289CA for ; Fri, 16 Aug 2019 08:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbfHPIjv (ORCPT ); Fri, 16 Aug 2019 04:39:51 -0400 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:1980 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727351AbfHPIi5 (ORCPT ); Fri, 16 Aug 2019 04:38:57 -0400 IronPort-SDR: B/UKMTMgL1V3rYDOf1AD4z2OH5lmZBsv5s71Z6ieqgVwAO1DuonYMGPPwqgXSJJrn7cQ+xrOon QeMav4V4xhwz07wJHFaZXWS9G+qecRUysuL+XLBK6kPtOT2iM75cTYxcXFK9mHVzT82sNEpffD +V82Gbta25bEQQf00Ch8Ob6HQVofk1oL9ZWibtAvTJEWNI+KvhJfxrFVleRL/Pfy9+T5hz4oL/ AVInmdMkLxWsHk3hDEUhs9A9lRPf2c7NKjW435v+mlRwpZCmApuqpD6nUeVxZmb4gvkK47xLXl ELo= X-IronPort-AV: E=Sophos;i="5.64,391,1559548800"; d="scan'208";a="40484323" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 16 Aug 2019 00:35:53 -0800 IronPort-SDR: 3LRlwUxcL/PU660HasXBGP8vJSlmCapd5ni4O/SblKBQMfOfu1EQj3pcmuJsV60kUMntA6Tc6J zCfPvv3u/vSyf1s1bObTqvPCtYW2y4gzGfDvYPxjTKZE0ETQZKb5qKcfQIFQnAhVQgHbyBEgjC oy3Qc67pxN3FvQk+G4/7xM2gd8kEpSpzqn80XS1gXo6WxC1EVpZ0hHb5XUp1wtzCIQI6lFBX1G KBHuGu/rCN3E9Bg8WmnWali7wgmNFpFUWICp2Vukg4BzdtoI64b5jEZ8PS7kbnYvVLa6t1194s +po= From: Jiada Wang To: , CC: , , , Subject: [PATCH v1 41/63] Input: touchscreen: Atmel: Enable IRQ_DISABLE_UNLAZY flag for interrupt Date: Fri, 16 Aug 2019 17:35:36 +0900 Message-ID: <20190816083558.19189-2-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190816083558.19189-1-jiada_wang@mentor.com> References: <20190816083558.19189-1-jiada_wang@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) 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 From: Bhuvanesh Surachari The de-/serializer driver has defined only irq_mask "ds90ub927_irq_mask" and irq_unmask "ds90ub927_irq_unmask" callback functions. And de-/serializer driver doesn't implement the irq_disable and irq_enable callback functions. Hence inorder to invoke irq_mask callback function when disable_irq_nosync is called the IRQ_DISABLE_UNLAZY interrupt flag should be set. If not the disable_irq_nosync will just increment the depth field in the irq descriptor only once as shown below. disable_irq_nosync __disable_irq_nosync __disable_irq (desc->depth++) irq_disable if irq_disable present -----------> if IRQ_DISABLE_UNLAZYflag set | no | yes | yes | | | desc->irq_data.chip->irq_disable desc->irq_data.chip->irq_unmask (ds90ub927_irq_mask) disable_irq __disable_irq_nosync __disable_irq (desc->depth++) But the enable_irq will try to decrement the depth field twice which generates the backtrace stating "Unbalanced enable for irq 293". This is because there is no IRQ_DISABLE_UNLAZY flag check while calling irq_unmask callback function of the "ds90ub927_irq_unmask" de-/serializer via enable_irq. enable_irq __enable_irq (desc->depth--) irq_enable if irq_enable present -------------> desc->irq_data.chip->irq_unmask | no (ds90ub927_irq_unmask) yes | enable_irq | __enable_irq (desc->depth--) (desc->irq_data.chip->irq_enable) Signed-off-by: Bhuvanesh Surachari Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index bc94adec6631..c6ba061098c0 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -4349,6 +4349,8 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) snprintf(data->phys, sizeof(data->phys), "i2c-%u-%04x/input0", client->adapter->nr, client->addr); + irq_set_status_flags(client->irq, IRQ_DISABLE_UNLAZY); + data->client = client; i2c_set_clientdata(client, data); @@ -4434,6 +4436,8 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) sysfs_remove_link(&client->dev.kobj, "reset"); gpiod_unexport(data->reset_gpio); } + if (data->irq) + irq_clear_status_flags(data->irq, IRQ_DISABLE_UNLAZY); return error; } @@ -4449,6 +4453,8 @@ static int mxt_remove(struct i2c_client *client) } mxt_debug_msg_remove(data); mxt_sysfs_remove(data); + if (data->irq) + irq_clear_status_flags(data->irq, IRQ_DISABLE_UNLAZY); mxt_free_input_device(data); mxt_free_object_table(data); From patchwork Fri Aug 16 08:35:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11097271 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 C53311395 for ; Fri, 16 Aug 2019 08:39:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3BEA289D4 for ; Fri, 16 Aug 2019 08:39:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7027289CA; Fri, 16 Aug 2019 08:39:10 +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=-7.9 required=2.0 tests=BAYES_00,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 35727289CA for ; Fri, 16 Aug 2019 08:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727044AbfHPIjB (ORCPT ); Fri, 16 Aug 2019 04:39:01 -0400 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:1982 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727471AbfHPIjA (ORCPT ); Fri, 16 Aug 2019 04:39:00 -0400 IronPort-SDR: hWubHu6auLGcK6N4LbDE7yZ1xo4CvOgf8ipO4opVAAl28D5jJkyIyqw7xP7Uq19NH6YErmj7Ku AbOBNIX7yOrmu+fD41MndrbLDx3B2uhkWF4I0sXD/YzHqO6bFZCgwYJMexUwM6FoFp1QHbg3LV I2SItEEvpq0AagOnDAf82XeXF9w+HYYV+LZ1gpXw+DL0H5KucHvyzBFVAhIIkwVQgrjU1GaxER Go8lPT2yfUqKSsipuQAO9IAZIkE7zDd+T+aAmFSrmCjySMFcdSL3sH2f8bn52Rqk0b9RtaJF1D I/M= X-IronPort-AV: E=Sophos;i="5.64,391,1559548800"; d="scan'208";a="40484324" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 16 Aug 2019 00:35:56 -0800 IronPort-SDR: RLpmb9MVfpAydiwFlcLgOLBYRumCb0/Vgb0tow8qsmoC5UziuHoDTmem4YB7mQ7p8iSUQDqdvo KCQU4NGv6fveiXK+Wrv7fbK+vXBBy7mF1OjVJC/+ra21zd58Loi5ZKIkUI+10LB8hOd/8lIVWP 3HSheNWXZfBkTn6fbPfjIztLk7iCUbwn6PnYpxSuckwMqB8JJnqVdIdmff689Joaijka577dlw ZDIDPUBfWGm1RmEpR1t2OOmhZlA+bWzP5fvolOLmzNp6xQbF8kKn0UqzuplBKLIjX+TX0aSHWf wYs= From: Jiada Wang To: , CC: , , , Subject: [PATCH v2 42/63] Input: atmel_mxt_ts: Limit the max bytes transferred in an i2c transaction Date: Fri, 16 Aug 2019 17:35:37 +0900 Message-ID: <20190816083558.19189-3-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190816083558.19189-1-jiada_wang@mentor.com> References: <20190816083558.19189-1-jiada_wang@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) 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 From: Balasubramani Vivekanandan In mxt_process_messages_until_invalid() function, driver tries to read all possible reportid in a single i2c transaction. Number of bytes read is limited by the max_reportid parameter. If the max_reportid is a very large value, then a large chunk of bytes will be requested from the controller in a single i2c transaction. This transaction can fail due to timeout. This is visible when the Atmel controller is connected to the SOC via a i2c mux hardware. New property 'atmel,mtu' is created. This property limits the maximum number of bytes that can read/transferred in an i2c transcation Signed-off-by: Balasubramani Vivekanandan Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- .../bindings/input/atmel,maxtouch.txt | 3 +++ drivers/input/touchscreen/atmel_mxt_ts.c | 26 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt index 7afe12a93202..a7f9a8e551f7 100644 --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt @@ -45,6 +45,8 @@ Optional properties for main touchpad device: - atmel,gpios: Specify the GPIO input pins whose status will be read via the /sys/class/input/input/backlight_error sysfs entries. +- atmel,mtu: Maximum number of bytes that can read/transferred in an i2c transaction + Example: touch@4b { @@ -52,6 +54,7 @@ Example: reg = <0x4b>; interrupt-parent = <&gpio>; interrupts = ; + atmel,mtu = <200> atmel,gpios { backlight_error1 { diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index c6ba061098c0..e315ad3a8d2a 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -421,6 +421,7 @@ struct mxt_data { unsigned long gpio_input_pin_status; struct attribute_group gpio_attrs; unsigned long gpio_input_pin_status_default; + unsigned int mtu; bool t25_status; }; @@ -1522,13 +1523,30 @@ static irqreturn_t mxt_process_messages_t44(struct mxt_data *data) return IRQ_HANDLED; } +static u8 mxt_max_msg_read_count(struct mxt_data *data) +{ + u8 count_limit = data->mtu / data->T5_msg_size; + + if (!data->mtu) + return data->max_reportid; + + if (data->mtu < data->T5_msg_size) { + WARN(1, "mtu set is lesser than the T5 message size\n"); + /* Return count of 1, as fallback */ + return 1; + } + + return min(count_limit, data->max_reportid); +} + static int mxt_process_messages_until_invalid(struct mxt_data *data) { struct device *dev = &data->client->dev; int count, read; - u8 tries = 2; + int tries; - count = data->max_reportid; + count = mxt_max_msg_read_count(data); + tries = (data->max_reportid / count) + 1; /* Read messages until we force an invalid */ do { @@ -4290,6 +4308,10 @@ static int mxt_parse_device_properties(struct mxt_data *data) of_node_put(np_gpio); } + device_property_read_u32(dev, "atmel,mtu", &data->mtu); + if (data->mtu) + dev_dbg(dev, "mtu is set as %d\n", data->mtu); + return 0; err_gpios_property_put: From patchwork Fri Aug 16 08:35:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11097269 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 D0BAD1395 for ; Fri, 16 Aug 2019 08:39:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEB35289CA for ; Fri, 16 Aug 2019 08:39:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFF22289DC; Fri, 16 Aug 2019 08:39:09 +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=-7.9 required=2.0 tests=BAYES_00,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 64170289CA for ; Fri, 16 Aug 2019 08:39:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727052AbfHPIjE (ORCPT ); Fri, 16 Aug 2019 04:39:04 -0400 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:1982 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727041AbfHPIjE (ORCPT ); Fri, 16 Aug 2019 04:39:04 -0400 IronPort-SDR: rnwDgqUG3xmR0wtwdABN0hMygBAECTJ1UT2q0lb+Idy2CdgQiBsYLctuAmGMBXP196e7amLRSL 1XlbcrdNfo8/pbdB7GVOQFoFVu+k58GUFbQQ2uWPMNFDG55z3mZfcNKN3Nm4nLpdqCHleu0ZLl Oh8s/xvMq6i0EhEmMpgIiUl5kYEP1Leg2Wsh12Gee8Gooc29M5RUO8mo9X205yHFR0T/To5WxV 2rf6rYRdvnlSgezb+RLrXRnqT299J8h9IjL9XDFA5c+Y1F8eaBRqiM6DDXJmMxXO+0sKln2mnv fwo= X-IronPort-AV: E=Sophos;i="5.64,391,1559548800"; d="scan'208";a="40484326" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 16 Aug 2019 00:35:59 -0800 IronPort-SDR: /ANvxHRvxgDKA6tGt6y914PfrODrzSoMNWY4pUS4PGVl2eB8WiWGX2K9lRd/A7A1tF3DDVzMnm SzNq9bebixDf2eMsBFi8yGXmgjRhzGVccAUgBE6Q+r61WniA+yUW7zUa+Iy0paFEHOHUAA+QXZ puXX71G+YdwmgVV9Py8FcUZj4OdEVHN4fd/WEH9JHQE1wIucKWWSaU4n4zSeejTqiGZ772/ZgA 4VdZKzOJLhiNaI/KV6FuHtHfShOLhCGJ9CkHTezU07IgRwq3hms0s6ApiO0CLW95/9NLW+1Y4N IzQ= From: Jiada Wang To: , CC: , , , Subject: [PATCH v1 43/63] Input: atmel_mxt_ts: update stale use_retrigen_workaround flag Date: Fri, 16 Aug 2019 17:35:38 +0900 Message-ID: <20190816083558.19189-4-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190816083558.19189-1-jiada_wang@mentor.com> References: <20190816083558.19189-1-jiada_wang@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) 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 From: Balasubramani Vivekanandan If after configuration update, retrigen status is enabled, the mxt_check_retrigen() function, called after configuration update, does not clear the use_retrigen_workaround flag, if it was previously set. Signed-off-by: Balasubramani Vivekanandan Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index e315ad3a8d2a..b3d40390abb6 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1857,6 +1857,8 @@ static int mxt_check_retrigen(struct mxt_data *data) int error; int val; + data->use_retrigen_workaround = false; + if (irq_get_trigger_type(data->irq) & IRQF_TRIGGER_LOW) return 0; From patchwork Fri Aug 16 08:35:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11097273 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 6C7331395 for ; Fri, 16 Aug 2019 08:39:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B92E289CA for ; Fri, 16 Aug 2019 08:39:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FFA8289DC; Fri, 16 Aug 2019 08:39:14 +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=-7.9 required=2.0 tests=BAYES_00,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 EF0F6289CA for ; Fri, 16 Aug 2019 08:39:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbfHPIjJ (ORCPT ); Fri, 16 Aug 2019 04:39:09 -0400 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:1982 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727042AbfHPIjE (ORCPT ); Fri, 16 Aug 2019 04:39:04 -0400 IronPort-SDR: /WgcQufq0UnD4IkzvHbzwsgL0ldP0dSORU93PeD1tsHU2SA1wrP+GjPe6hzGiUm+cEn3bqYIiq cvM4sXeKtTlF7RTc8qOwpkbS8F7liw4MFi+LS0jxoEB18y6rPJn0aR7kn2rvA1clVqHIgdYUYc kXXncZDPZ9UAShnE7y5mfcmwL7tAqm8CbcCuazpq07QVsXJumP//LfvUzgssSk6gUqjkP59yWc B5kCQkk9IP8vMNIs/S/2oonMrB9Rj1TabJnkbQR7MgqvkgsZPChkSd/YGa+Wk+nd0dp0H4EW/9 mVQ= X-IronPort-AV: E=Sophos;i="5.64,391,1559548800"; d="scan'208";a="40484327" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 16 Aug 2019 00:36:02 -0800 IronPort-SDR: hS5dIKkLQR0nnEiyMntKgyyRj9f4vJ9xOQw/VT9czNqRZmsmAT6q5m3LadHoLcHqQJg75FvjuO nzO6Mk0KxFQBacgS1wrMvW8Xsx36cVjEr0oIy6/UWxkkM1qQVamMILwWluozXhLl/ImfYzmjdU tqIGWkukIzSCb+AKvtt9We9xNqov9aMG3LRXdnNHiLw6j2oNH14vQrRDw3+jE8OkkhElKPjqyC EXCbTmLuuizl8cLHE2VYcUkXRgGzPoRXWXBgj/ADQJAbJuam5e2MlG9PtuUo6FdSQLbTP91XCC cbg= From: Jiada Wang To: , CC: , , , Subject: [PATCH v1 44/63] Input: atmel_mxt_ts: return error from mxt_process_messages_until_invalid() Date: Fri, 16 Aug 2019 17:35:39 +0900 Message-ID: <20190816083558.19189-5-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190816083558.19189-1-jiada_wang@mentor.com> References: <20190816083558.19189-1-jiada_wang@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) 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 From: Dean Jenkins mxt_process_messages_until_invalid() failed to propagate the error code from mxt_read_and_process_messages() so return the error code. Signed-off-by: Dean Jenkins Signed-off-by: Deepak Das Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index b3d40390abb6..ed5b98c067e8 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1551,6 +1551,8 @@ static int mxt_process_messages_until_invalid(struct mxt_data *data) /* Read messages until we force an invalid */ do { read = mxt_read_and_process_messages(data, count); + if (read < 0) + return read; if (read < count) return 0; } while (--tries);