From patchwork Thu Oct 29 17:03:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Valek, Andrej" X-Patchwork-Id: 11866933 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4487A14B7 for ; Thu, 29 Oct 2020 17:15:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D27420759 for ; Thu, 29 Oct 2020 17:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726177AbgJ2RPm (ORCPT ); Thu, 29 Oct 2020 13:15:42 -0400 Received: from goliath.siemens.de ([192.35.17.28]:36929 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgJ2RPm (ORCPT ); Thu, 29 Oct 2020 13:15:42 -0400 Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 09TH45pC011922 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Oct 2020 18:04:05 +0100 Received: from dev.vm7.ccp.siemens.com ([139.22.33.215]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id 09TH45WF002436; Thu, 29 Oct 2020 18:04:05 +0100 Received: from mail2.siemens.de (localhost [127.0.0.1]) by dev.vm7.ccp.siemens.com (Postfix) with ESMTP id 122DD70FF87; Thu, 29 Oct 2020 18:04:05 +0100 (CET) From: Andrej Valek To: nick@shmanahar.org, hadess@hadess.net, dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Andrej Valek Subject: [PATCH 1/3] Input: goodix - add option to disable firmware loading Date: Thu, 29 Oct 2020 18:03:11 +0100 Message-Id: <20201029170313.25529-2-andrej.valek@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201029170313.25529-1-andrej.valek@siemens.com> References: <20201029170313.25529-1-andrej.valek@siemens.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Firmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable. Add there an option to prevent firmware file loading, but keep it enabled by default. Signed-off-by: Andrej Valek --- drivers/input/touchscreen/goodix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 02c75ea385e08..44336ecd2acdf 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -941,7 +941,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts) default: if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; - ts->load_cfg_from_disk = true; + /* Prevent cfg loading for each start */ + ts->load_cfg_from_disk = !device_property_read_bool(dev, + "touchscreen-do-not-load-fw"); ts->irq_pin_access_method = IRQ_PIN_ACCESS_GPIO; } } From patchwork Thu Oct 29 17:03:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Valek, Andrej" X-Patchwork-Id: 11866931 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19B136A2 for ; Thu, 29 Oct 2020 17:15:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F2B2220759 for ; Thu, 29 Oct 2020 17:15:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725948AbgJ2RPk (ORCPT ); Thu, 29 Oct 2020 13:15:40 -0400 Received: from goliath.siemens.de ([192.35.17.28]:36929 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgJ2RPk (ORCPT ); Thu, 29 Oct 2020 13:15:40 -0400 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 09TH47WX011958 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Oct 2020 18:04:07 +0100 Received: from dev.vm7.ccp.siemens.com ([139.22.33.215]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id 09TH47uD015940; Thu, 29 Oct 2020 18:04:07 +0100 Received: from mail2.siemens.de (localhost [127.0.0.1]) by dev.vm7.ccp.siemens.com (Postfix) with ESMTP id D963270FF87; Thu, 29 Oct 2020 18:04:06 +0100 (CET) From: Andrej Valek To: nick@shmanahar.org, hadess@hadess.net, dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Andrej Valek Subject: [PATCH 2/3] dt-bindings: goodix Date: Thu, 29 Oct 2020 18:03:12 +0100 Message-Id: <20201029170313.25529-3-andrej.valek@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201029170313.25529-1-andrej.valek@siemens.com> References: <20201029170313.25529-1-andrej.valek@siemens.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add information about option how to disable FW loading for each boot. Signed-off-by: Andrej Valek --- Documentation/devicetree/bindings/input/touchscreen/goodix.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml b/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml index da5b0d87e16d0..e7d9404c86abf 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml @@ -53,6 +53,7 @@ properties: touchscreen-size-x: true touchscreen-size-y: true touchscreen-swapped-x-y: true + touchscreen-do-not-load-fw: false additionalProperties: false From patchwork Thu Oct 29 17:03:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Valek, Andrej" X-Patchwork-Id: 11866909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E1F4157C for ; Thu, 29 Oct 2020 17:09:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5693520796 for ; Thu, 29 Oct 2020 17:09:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726177AbgJ2RJw (ORCPT ); Thu, 29 Oct 2020 13:09:52 -0400 Received: from thoth.sbs.de ([192.35.17.2]:55353 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbgJ2RJw (ORCPT ); Thu, 29 Oct 2020 13:09:52 -0400 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 09TH48no018553 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Oct 2020 18:04:08 +0100 Received: from dev.vm7.ccp.siemens.com ([139.22.33.215]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id 09TH48c0016087; Thu, 29 Oct 2020 18:04:08 +0100 Received: from mail2.siemens.de (localhost [127.0.0.1]) by dev.vm7.ccp.siemens.com (Postfix) with ESMTP id 373A770FF87; Thu, 29 Oct 2020 18:04:08 +0100 (CET) From: Andrej Valek To: nick@shmanahar.org, hadess@hadess.net, dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Andrej Valek Subject: [PATCH 3/3] Input: atmel_mxt_ts - add option to disable firmware loading Date: Thu, 29 Oct 2020 18:03:13 +0100 Message-Id: <20201029170313.25529-4-andrej.valek@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201029170313.25529-1-andrej.valek@siemens.com> References: <20201029170313.25529-1-andrej.valek@siemens.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Firmware file loadind for mXT336U controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable. Add there an option to prevent firmware file loading, but keep it enabled by default. Signed-off-by: Andrej Valek --- drivers/input/touchscreen/atmel_mxt_ts.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 98f17fa3a8926..4656aaf532777 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -311,6 +311,7 @@ struct mxt_data { struct mxt_dbg dbg; struct gpio_desc *reset_gpio; bool use_retrigen_workaround; + bool cfg_loading_disabled; /* Cached parameters from object table */ u16 T5_address; @@ -2191,9 +2192,15 @@ static int mxt_initialize(struct mxt_data *data) if (error) return error; - error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME, - &client->dev, GFP_KERNEL, data, - mxt_config_cb); + /* Load firmware if enabled */ + if (!data->cfg_loading_disabled) { + error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME, + &client->dev, GFP_KERNEL, data, + mxt_config_cb); + } else { + mxt_config_cb(NULL, data); + } + if (error) { dev_err(&client->dev, "Failed to invoke firmware loader: %d\n", error); @@ -3158,6 +3165,10 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) msleep(MXT_RESET_INVALID_CHG); } + /* prevent firmware flashing for each start */ + data->cfg_loading_disabled = device_property_read_bool(&client->dev, + "touchscreen-do-not-load-fw"); + error = mxt_initialize(data); if (error) return error;