From patchwork Tue Nov 10 18:15:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Valek, Andrej" X-Patchwork-Id: 11895015 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 2624E16C1 for ; Tue, 10 Nov 2020 18:16:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1203B207D3 for ; Tue, 10 Nov 2020 18:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726690AbgKJSQh (ORCPT ); Tue, 10 Nov 2020 13:16:37 -0500 Received: from thoth.sbs.de ([192.35.17.2]:52719 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbgKJSQh (ORCPT ); Tue, 10 Nov 2020 13:16:37 -0500 Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 0AAIGQgJ021454 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Nov 2020 19:16:26 +0100 Received: from dev.vm7.ccp.siemens.com ([167.87.14.175]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id 0AAIGQVM032432; Tue, 10 Nov 2020 19:16:26 +0100 Received: from mail3.siemens.de (localhost [127.0.0.1]) by dev.vm7.ccp.siemens.com (Postfix) with ESMTP id 1102870BAB5; Tue, 10 Nov 2020 19:16:26 +0100 (CET) From: Andrej Valek To: robh@kernel.org, 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 v4 3/4] Input: atmel_mxt_ts - add option to disable firmware loading Date: Tue, 10 Nov 2020 19:15:49 +0100 Message-Id: <20201110181550.23853-4-andrej.valek@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201029170313.25529-4-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..491d5088d2826 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, + "atmel,do-not-load-fw"); + error = mxt_initialize(data); if (error) return error;