From patchwork Mon Jan 18 20:43:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 365753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 466AFC433E6 for ; Mon, 18 Jan 2021 20:48:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EFC522DFB for ; Mon, 18 Jan 2021 20:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394374AbhARUrh (ORCPT ); Mon, 18 Jan 2021 15:47:37 -0500 Received: from mail-mw2nam10on2067.outbound.protection.outlook.com ([40.107.94.67]:64404 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2437508AbhARUp1 (ORCPT ); Mon, 18 Jan 2021 15:45:27 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNz23Z0nEyFkXW3uIzXoWXpCkH4GjwoO/y+PQoQ823r71k+vIkkUVqZk08fmds7lpJGqlTiZ2YiBJzJM3DtkTpgZVq7SZebxdK1nd4H8TutBVxcWaeriBvfg0P4G3YOY7fAHi9iVJ9pSaXT+IfajdDPWbPVm4beFTK9wx4C3p61GGtWGoA+JRvkf2m/WvzDKogdPQG8s2uY8FHD/YI/mihdCR9RzJizmWmZHvMa3+wyTXuIoOaS8u/BHJuy0Eumf3Lx0GwTOR+y7fvmYd59jWMr/Hvr7TH2U+U+jvf3sYPgHUT1Me2NO7F+6uimnUehkP0A7CKBrp5si67nrVILXng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Op8kCt3yku8I7EPb7J3l/Go44Px7QPKFf011iDvwjXA=; b=PgBi7cE7df9Py+LHcRCjVqBISdWZ+zYVUfltRvXfLxDXKmc4h5l98WHShi1rOecZ6BuBW8kkGOH3Z0vxtplQjWXV1gLabmeluU2MV5yMa4+sY1qY3u6eDcPfdTuu6E3UWweQ98ZI0+vG5j5vMPPBLkThIHcy7QS7xZt+wcu+Bh73uXGU2kXb9wvV4Cn1fD8rVr4cFhN6aNIJeETL6GyPmwy5DINdc3gwjivxrZ2HSlK3wcMGo0dHdTOnW9p3BX/Vaw2mg8rjum85kMDw2cUwqzNNJBhzz4Tv+CpkFC3AWKVf8hj/q1f6P0O6G+LyrWKcl85fMOhXNFjSSNHoQRAMDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Op8kCt3yku8I7EPb7J3l/Go44Px7QPKFf011iDvwjXA=; b=nA08StiKALIOvcMckF+un0bCTppV/mj7IHjS3anuChePfuR/WrejfAUFZBpLfn28DsL07eoYlNOd6mDu4ACniGy6hhIL7RdpHbAPP830/6GaS1Lw3FPqpssCBaL6ECM6wt3vhOoZLrKTSlxcJgdqrC0XG8hBtgr46KLTrDw3/Wk= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:07 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:07 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 01/10] input: iqs5xx: Minor cosmetic improvements Date: Mon, 18 Jan 2021 14:43:37 -0600 Message-Id: <1611002626-5889-2-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 98d6cac3-e51f-4a67-6237-08d8bbf1ccb2 X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e6fVFPmbFigpdIWEiSBpJF+wMxltO/A3oGms548bia9OiVJBzKyHSBNUcSMU4sFzZ0kMf0wzJ9ymqFmbCgXyqEFFeTm/xVw5wL7p0chPlcRNt3mXTt21U3Uts4cbzSX72viXmm+UIDiZwyvj853WqfDDE1xDDIZxC6pAz0e7tZ9tpt6QEAtW40MWSnwZdOyo+lKOTG/UV3qzwD+4KJ7lHAe44DABbb2zn48KLPuLOKrh3xCDC3Cpdn+lqnjWt2iTtjuzhjCEX+HvAFBu7bAupqNfS95m0QHK914PgENTmNK+etrDLythRyflfdZmQRQOfkbiAvYfeBqpIDPExy1WhoIIYi/V/OxzOoZ4IAx1weOYH0XrDUEJjGUyHXFVzX7HsTyQNCi47sftIBkqI0wKhWbrkjwzkCwRpgWTYubJH1str7OpsjNocOxCL2FaeyJ5zI+G7TP3gNZjyIQ/JfunYURWgai9LxqU9JntCbx0yDA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ClsoSGsuMMy4oiLT2HcLhpWmSpuJrmmkpm1LiciKOznDiEaLxLq1fq/7DFGLefpykYY6XJ1CnI4eshsTawux9l/Lo52ptcp0xoWSvEbDMj8VPviLMy5yeQIa8/yAWm6wimHsSXP0/mKgl9ZEPbSBDw6E2pUQEefaWQjBCE2fcgYVazrPsrqZjKvOOFIevxTSuMlk6QNVWjmCKB/hf0b9+d2XP18FHdukRtGVFwI67FNttu9bEmaco94twUb2u5uXUEwRcSMGXMFTcFjWBjkcKiv58x3M7VIMNRb1HhV40BK9WkqRGn2N6v1Xk1YJZJXdmLRQ5KAmlbj/x7++mUy5viczVoNkFSxtVZ245xpMFMXlC5wi6d0t9evtQNqoOWSREjaXcF3q925B+1o2HGvySTVkdHq4Fuh4HrE7Q0WILPQsanXRj525Uc7FzeNkHAxsI2ofT+uS4CM46/whaGxM462Yg2wuqbY/ypnY9NPx4kWSJHSv4JC93XnpKWZUU8mbgyuMtxXoFCXiXh4Empnpce4NgBj7t0dUlxu8bKp7Z4/VZ+SogUKjMd3POXfkJz3aF/gv+9rVZOOefTbqU61Q+Szz6Zvv7SoEyxf6/nGLKhjbub5zC8tM49wN1Xco4YrVStbg2v48TyMVmutr/Iyn8W185D9nsuKCcp+0sAmjEZ+hMvRJDLoRe624H6CvlEon06MOVTKWkTQvNChWR54s7QwOyqU/RDUfCzKRF6byJ8og1SIv+iVq16lUpc8JEblwEz3N0jfQo9EKALI/YPFwaZyQiJShmDeZWzZV/gbcAwXo6E+JU9/XqnIpB4cxVrrTHELbziJHdT3sc/Wah2+iNr1e8/myspFGC5ntQyEuNYJ4jk7wCUaK37rOKusYFlZW7z7WqAWsdPsSdTXgPA61Hx+ZrFkCyy+Z4JEKdEeQ/OGScm3e/xBvCOqoV9XqHKBvmFvZ+R6DN79efJpt8Z1HJF+eWntBvGbtf3j6Q4tK3zyQ0Vz6ToJ01IYgVvFOMkbq X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98d6cac3-e51f-4a67-6237-08d8bbf1ccb2 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:06.9838 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eempRyx1yXBwUB59+8Ue2ADpy8/UlMKy6O7BR3ow1I53sARhOZpATPAcmMe7BGQLUClkj2cpQMTCPn66Do1RZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Copyrights are generally followed by the name of a person or a company (i.e. the copyright holder) but that was not done here. Fix this by squashing the 'copyright' and 'author' lines. Also, trim some leading whitespace ahead of the parameters for the fw_file_store() function and re-align them for readability. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 4fd21bc..08e79d6 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -2,8 +2,7 @@ /* * Azoteq IQS550/572/525 Trackpad/Touchscreen Controller * - * Copyright (C) 2018 - * Author: Jeff LaBundy + * Copyright (C) 2018 Jeff LaBundy * * These devices require firmware exported from a PC-based configuration tool * made available by the vendor. Firmware files may be pushed to the device's @@ -952,8 +951,9 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) return error; } -static ssize_t fw_file_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t fw_file_store(struct device *dev, + struct device_attribute *attr, const char *buf, + size_t count) { struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); struct i2c_client *client = iqs5xx->client; From patchwork Mon Jan 18 20:43:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 366475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6B8FC433E6 for ; Mon, 18 Jan 2021 20:51:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87220229C6 for ; Mon, 18 Jan 2021 20:51:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394283AbhARUrG (ORCPT ); Mon, 18 Jan 2021 15:47:06 -0500 Received: from mail-mw2nam12on2082.outbound.protection.outlook.com ([40.107.244.82]:41600 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394332AbhARUp5 (ORCPT ); Mon, 18 Jan 2021 15:45:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YjjaLQxPPe4Zg7RqMbE6H+sB+evHd8zoc/Pj+FX0/3kQSojZsum2CBgdJUQA8RXztylHchaWBKwfnn+DhPeK8KXvhHCoen7AZ5a7zEceHKm0lw3AcP0txQhY7Fc3JOpVgXLj9PR2x5kauQ+FyAsRKtMQhNnmSbYz0pzs2xsVBTbby69TupdeISCgbFhH5C9MlIz1OEW3Z4Zli1jOqTOIRsfIDo9qNQ5wbk+y8AjXJCVu9vp9HQzfW5kcHatBX4W69gzTwpsOgljC5Ds6mJX25ADsx7D+ieKWP0tPLCadnJ9i923Hl6M0bKPAVg1HqMdlHNGxX7u17r008ge3jZvidQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qGHAMRWkUrPKcrmiCFU5zMqZS0nnqTcyN8A732J/qdw=; b=MDBX8Wh1W8cy5xuHzvTTZyLzMV3rTlhL9O6MAAEzBc/bBJ3hMGpMi0A2M7F07uYzqIBAxJ0Z29e7Vw0srAKjiBrhHMFELGcIyvNiJ60Ci5MzfpfXFfaJgtwWpn1VzUfdKxgEUPqYzesEoqyHB/SiP8yVKLOHpUNsuAF/1HEIDnJ6epY/acXGh0Gyw4+imZq1uRzCK+Nuw/ImfU+n2p86psrnwXs0ZfyaRk1UOmo+upO63lzlMETDovnAImQlguhs++RhdKvngxqCHQFqFoLKVQeRmku7YeSfC1qWMn+H1v3crDzqFEe7LAQYXasEUccz86ZPD9ScnqVX1lI7fweJPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qGHAMRWkUrPKcrmiCFU5zMqZS0nnqTcyN8A732J/qdw=; b=gahTXvCz4LRUXN2noU+3K0CE+5R7rlQ7nC75YTF2Zui5FnPYI692y2XrYsmePpihmfZEkLbkCHmkitkyZ3mt2KDfHzAY9AVobF2npLskuFrNuAL3v5uFWrIjgo4FjA3chD1KTjH7tKz4OySjEoeJEjEwpGw9/IkaJtu2MRUZRcE= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:14 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:14 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 02/10] input: iqs5xx: Preserve bootloader errors Date: Mon, 18 Jan 2021 14:43:38 -0600 Message-Id: <1611002626-5889-3-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6035ea82-cfdd-4de6-a952-08d8bbf1d0dd X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fWukdIoYZIL9NT6HSl5NyfebBiuP3W0InFASJeHsPPlfFxr3ZjEbirYUYkpYRoLrgmakfGJLfwN2fLBEPNxiF9NeDqDDKRfrNoGnpdyEHW8F22vrfOR4G5IrPktFF9i+TQJU7nxCgtHNvrzJV5ruPrV/vT0kmmSsQt59DOuU7j53mflIh8GvCOmENbYpKy9ttPAYhOu+d3t4lYJWWCNiwmMrO1yivqkPLQ99UMATvHMoz9sRXf5mySVA9iHdwzUFv5BtmWhdmU2DqpC7arME5sUwsojfp4yLm4kia/O17vpLuU2YOhR+eYcqXHcjaeR37mIasPXr3fG+OLJ4rbNtLsuK38KHjQSfM4CC4Ef9IGeWXiRz47PTlG1LU914RhbcAiCqDUiFv7vQgbGKXxI/jrhS919TJzwiWHbvfe2cyg5RGpuKDjsFfrkLYoGy+/h9FA0V7YRemIUHovI6S7+B4t7luHmooZhemroSX4b6q6A= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: RlTDzlmg0/KojfpAYYuGwR+YRKut5np579zwMRRbVmuERm+NkbUJK6HI27q9Mpdfm7A8FyPM6o8oOZdzvFfGr6Uy5vFTDFbxqDYolHt5SAXlxZI4YLjk+b4xlUUtvoYkAFzgeg81quXl9i7kAr6Snhs6HbC8OAco/v20ezMh/yRxVhjQ28LCnQNffj2CulbV3M9qSC8Lx0Epk6U7Y7KJS3lq+HimjZ0zjHlGszrsca+siuhqk6tV572uIBnhvRNKlunu7Duirn51Upjy3e7xrqYipXaZNKGkqrsuK7rRPH7MJz2ysjzFQ5PqfHyjqEoyU9QdExQpmhx56ucfZMx09wqgHSgZhd0YNZs9P3KfFmG9SDcnzw8DTAX3JFKVYSVjgPyKVF65Tq/kzf5xcWEwH5ouNT2MzUVOx5AQ/I3+m2aqqOYWhqtpAYcYgOwJsKPNpiIsYU0eRhM7w0hX1ysbqrR9fjlb0HTFS+QUF0A2swSaQOS7U3K9/li2Jr9tUechR/8U3YBc+osHo3iiNsRhanTUuJldszCJbSfTMvctHMPQIjakh8Xz3WT9fatD5p9a9orjCdR0z8iwyn04W8XOAqsNUT2LXJ1YpLhe5LRKR5pLNwIP1mS+ZztutfWrXddgjqGA55NTthg3ghORh3aR/ogqqRY4NCi5gAz5LSPLaqZ0tq/t8hm2GSyy+dneYRrZpE/7LAZuBDKnhzzKoMOAFF+lPGLEF4M8U5E9wxHwrX1qamrmzXCtJiu2hxvIH7R9sLKuX6PlP2RdHVAeuQ18LRbNqhi1X41hXxR2TdBFMeI+3kbTw3BZg2c0AITxrSBOdSXTG7kG7PiHlzH3Tr8L+AuOwBzftaZiOI73dPy4/1CMBzEv/+wOsnszsMpcpP9yYAZwoBXoD0Y9mFefoTiM8Cac7eY7tm8pDyVa738mRllJ3cYyDQSVtBUdKvxtJTGm4ZjokFOhYuxZ902tgWyqFRDKi185Jcun8L0Xp0XtXPMu9etlEy488nJPVnKxz0by X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6035ea82-cfdd-4de6-a952-08d8bbf1d0dd X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:13.9738 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pKdYeSpPl+2vFjwi/rBvNmlYZyMd9mZ4wCGQpmvs74/h3I+9d+LHBRYSqNcmyQ2BMC8zjJoFcgB7JAALcVpf8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org After user space writes the fw_file attribute to push new firmware to the device, the driver calls iqs5xx_dev_init() to re-initialize the device with the updated firmware or recover the device in case the update failed. In the case of the latter, however, iqs5xx_fw_file_write() returns zero (success) so long as iqs5xx_dev_init() does not fail, and any error encountered during the update process is lost. Solve this by saving the error before calling iqs5xx_dev_init(). Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 08e79d6..ff0a0e9 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -883,7 +883,7 @@ static int iqs5xx_fw_file_parse(struct i2c_client *client, static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) { struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client); - int error; + int error, error_bl; u8 *pmap; if (iqs5xx->bl_status == IQS5XX_BL_STATUS_NONE) @@ -937,6 +937,7 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) usleep_range(10000, 10100); } + error_bl = error; error = iqs5xx_dev_init(client); if (!error && iqs5xx->bl_status == IQS5XX_BL_STATUS_RESET) error = -EINVAL; @@ -948,6 +949,9 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) err_kfree: kfree(pmap); + if (error_bl) + return error_bl; + return error; } From patchwork Mon Jan 18 20:43:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 366474 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45AC4C433DB for ; Mon, 18 Jan 2021 20:54:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20D2322D08 for ; Mon, 18 Jan 2021 20:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388346AbhARUqo (ORCPT ); Mon, 18 Jan 2021 15:46:44 -0500 Received: from mail-mw2nam12on2046.outbound.protection.outlook.com ([40.107.244.46]:61569 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390080AbhARUpu (ORCPT ); Mon, 18 Jan 2021 15:45:50 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nZ5FGconSIWH3VmM0SKD++B0BDGVeVJWMaCLzkny+c939OJxJFYpVJkEqtkT6k7x9IpNj8oJ/llsg8XSKPZCF3jgi4JJaZ28KeriysKQtwxnWsar2gM+bcu+RmO69GrC2xZyAMdPpHt9A9/rFg5TlOK+IU2T8xdSh7if51AGlAmcJIJcw4GnIpSUrezll6RMMX84WoaZjT7OdQMRDFfcW7ncpEKBu4sA4Rmfg4gyUZSC337CIASOVaPjJrOCiLO+bn5dB9OV8zO/cs60iNUt1F4mRQklmwIgyzDV57TKlcZ7HfLWyyqgHtAoQirlqwAScohxkzDgBe1+hI42Pwf7mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eWmQjg9gvgv+AX3U5twkHWmIY3cURw5FH5XfGTZanjA=; b=eAn3e6nF6EzAT/4TaRJWLwfzb/I4BfHPidAeqsRVjcM1PlP2gdih37VMcYE5VQmGI5sBPYg7kzFFXbm/l2WUVjuQbpb+3qXIP4IQiBFm4KdWZ6ZGlYzwWZc+TcoMNQ86RNsY4/PV3O/v+Ue+s707jYamZijn8lSyuTaxI+pLVvC32UV4ccRUBF+rRoL3Ux8ZeaORdP7NI2Nzfj2JkKa5k/aMrrTo4YN4pEsrwqpq1oNXmKtaREf7viS54qR+s/BQocU+ZPxHsSqRryGQPdQdBrVdLTG1bbOTg5CruMJbVTkOPLu2KWdbVLeLepXiHrRozxTd8RifvTPxByM8CCNncw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eWmQjg9gvgv+AX3U5twkHWmIY3cURw5FH5XfGTZanjA=; b=RuDU4iYNwly9cImWrFti9CT+85wGjcDzmSJvClOlI56v26/HDKYDqaQUMbdEgaCNrDJdx0G7eFwGQUAP9vFQ/pPhx2Th9GrYEMtTxTDLGnZYFK5dbiG8dmcDmghvbmvaNpdiW7Rj/cVu2eSrSPECYGdqawUc9tVdZOM7zJGv+DY= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:20 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:20 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 03/10] input: iqs5xx: Accommodate bootloader latency Date: Mon, 18 Jan 2021 14:43:39 -0600 Message-Id: <1611002626-5889-4-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 967985c2-0338-4b3e-5e9b-08d8bbf1d492 X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m/V4k/KnSSnIvakwlkcY09Zg8UDXl/NnE+GOw1pW+AYJB+zYWFLep6fgPfGy9mQwcFdfo+ld6QDjltBodksLMKYh+qGP1+379GPAOKdY9CreiyuDgBacYt9/dRQAJx7rBtp0kx8k8tH3Notsfpcf5ygc8lj+rHTiyI9qIo72Tffb9zpKytrtKX3y+BweHOgUjtuImDm5P5pz+KPOq8KQkv04uqpTweu5KKgAqkcIT7VJFguhmIYeIrJ9O0RJOYAMOhWYHMk4kJ6Fs22Wv4vJbALun/J3YF6z6rUDJBqdZpZ/g/+uBnDq/YdSSTmXslNQDsBBK+/J1Z43bKDF9vDATAkf8ojPbZL4wFqfLBX7FQkkvV/rWvFgMtlsCxE1VOxPbk/HPwqYf8VUjKBMHjCyX5pHQ3p8N/sBK1395fXFoZh0osjff31uuO5s3psuS41EXykMbNTYW/buCZOoSwgoaJXSHpRvVrgpxRyP3Ill2dc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: jWSybaJVzZvz/+FQAFG7El5EnXLwxat0AEt3WcZJHxh3hLaEizh3wrZtPJUu9cVkkCNWYau06U1JJfNbbR79OKJKfK5ezKvZ+5bO0gujdpX3l7i+TwXSfGY+hWmo8lBbT8P3mEjCfd90HX3jjNlE/Q3SXTB81xzubX9OsA19ixsgcn3G1cgVWkp7uI4IkVNK0SxaBp0KKcxwrPAqqH1f7B/kTya9mtBgiZVneVb2c8028gP750dEsOh5v7eofNlWeVeUJwnyvfJQj4B1a6iPA5S/kbJRpcTIi3EBV9HH1fedZsaaYKqWbPpJu4tKtHKckURKy4SGamIcGtZVOUye3haXfOHkXZ8b7LOtAUf6wrnFAUsxISU5NL2sTXcq3AcRKmChXazbL5LR7DkWC1HgxWxPXYvvLjfhqwErEByORCS9wEkIWYKbRsxjPJVfHnEdQC9RsUROwXwk2xF6Lg/uyIUomfKrvp6LidGShckHwhwx/aEURADVS+1ftCFEIt9GdHxIV6Ej5WJoUFwRMKXd+EZEY/7BnjOH5SI/KSy8m/lB3SARuj/KH5hXhm5SgJ9+w/fOpqfpLarGRGlZD17PVyzRJNPJRljvp8Z7rExM+Zdbwjw/LwoSBlfGpL9/dOMt9RL+iMqqRhznPhIg/w3UmsdG6IWClAIcgqntO8+vsU8aCFuDur7zFOFcmuanxJq2y55RnFqgKSjmsc41UkpO/0gMdKz1vavZ0zqSCpvzNtn6GDCbt+1ie2ElOoEe9Su8kxuy5ZfXlW56no7Dw3kuvy+VyY/vNz6r4IsFTPKYXmlSDz4LVI7K0DaT6z5NAWtxLMVt3XVV3QSmuzjt9QOvhn7Sj5xPU55/nODK32fTNYpw8AfOe+J4MSsb1TcuaNUM0C4fJFhjXpwFEuDCwdYINZgPSyApwqbytws098lbt/N1DWZPyZeHpB8DFCvXmzw5XEKPXUOcxXct51DSLBcbZ9ZZ/JAU9Cp9Fr76p2B+gqNQHRb39OJw77A2kqKLr+RE X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 967985c2-0338-4b3e-5e9b-08d8bbf1d492 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:20.1887 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +qh2UbzYvPInhEKne5l91590aNTLMYeYdLBkbIf6tfmkEv0L2HFnggaFghh/UTBtC3Bpfvosexrc7z4Oq5qiTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The bootloader NAK's all I2C communication after the first 64-byte bulk write if the bus frequency is equal to 400 kHz. This prevents the platform from pushing updated firmware to the device. The vendor's USB bootloader programming dongle appears to insert a delay between the "open" command and the first 64-byte bulk write. Adding a similar delay to the driver seems to eliminate the issue. Furthermore, the dongle does not access the bootloader immediately after powering up the device. Follow suit by adding a delay before the "open" command to avoid wasted retries at 400 kHz. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index ff0a0e9..b2de8c67 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -336,11 +336,16 @@ static int iqs5xx_bl_open(struct i2c_client *client) */ for (i = 0; i < IQS5XX_BL_ATTEMPTS; i++) { iqs5xx_reset(client); + usleep_range(350, 400); for (j = 0; j < IQS5XX_NUM_RETRIES; j++) { error = iqs5xx_bl_cmd(client, IQS5XX_BL_CMD_VER, 0); - if (!error || error == -EINVAL) - return error; + if (!error) + usleep_range(10000, 10100); + else if (error != -EINVAL) + continue; + + return error; } } From patchwork Mon Jan 18 20:43:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 366478 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36343C433DB for ; Mon, 18 Jan 2021 20:47:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0255322B39 for ; Mon, 18 Jan 2021 20:47:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390080AbhARUrA (ORCPT ); Mon, 18 Jan 2021 15:47:00 -0500 Received: from mail-mw2nam10on2067.outbound.protection.outlook.com ([40.107.94.67]:64404 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394283AbhARUp6 (ORCPT ); Mon, 18 Jan 2021 15:45:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l2tlLl7/vhUoSt2KYWT1d9XovfghOgUvEnoYNXTNavs4YegLCqLqOgVHrIRyP3BSuEOKK1/QEfmlgBQQj0D7IOZTpgU0l9ZKwzkgeQdgaTL8ow+62Fi9k4f6LuOgAo95emlUVoqx+Gwm7Ud6I4zVz+HOpLOBQzqVp3Ey3bPSUUaplz/f8iEoebisHy8lyf+tJ0W3aKwlkWK7yHqHWuyHz0iCn5GUpiA+wLDkD0JehWaPx5ZN2wK3XzpmTNdE/fB8BLhP4AUzp/s7XW7tqph9gEkUFPV3cfQScoPNcvca7lNOM8+OMxrRpmqIm0MPhJhxEEoi3j1NliXvcZv6puoSAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=faJchSHOgwqpo/+zc0XigYXJZBc/BVdBLocNSyIDUM4=; b=EADcJIwaE+gMr9lvShlBDWgDkCzrpDXJVYiBulzPYDXYTJQxEOzLJVK9EIvtpGncko1NA9HemhTI2EEDpe0iuHrOL/oOFhM1H9yYz1NGsHgFBmiAO9cQslMfNuaMrpiZjwmpbnnCbYh+VID+BKpa/w9jF/CpaczOxqBtefoVjDQEC2uz2WZQ4sewvejEuhkkY/dHypPrzLlhFCaFr2DrqcQnqe9sLyWVfp9wbbbGEjJazxNt1/y3F14wlFU0iGTBLmnxOWHGbG4cnQPRPpSiOKyn7zDr02WkIlN5az9byDe83j/JFQbU9Rg8XIlZo+ml0OcurszppB6erNOj+tfSzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=faJchSHOgwqpo/+zc0XigYXJZBc/BVdBLocNSyIDUM4=; b=tGbM691eZBUtHLPDRTdKAWnrmm/xGOsHWkPymk9R3qIUg6VgFnq33IEZTv98YX4PTn4FXozMrwVFjZVcm/CfRsU+VwHmtqWHyGGFeHSpfX+ZK2XmZ1tXKtEuRSauWKaBl1kanJMG5e+dUqi5daHrdsvIcJe5aMTcZjorGMqvd6M= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:26 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:26 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 04/10] input: iqs5xx: Expose firmware revision to user space Date: Mon, 18 Jan 2021 14:43:40 -0600 Message-Id: <1611002626-5889-5-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3bfb8b5c-7407-450b-8554-08d8bbf1d876 X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vuBmpdzvTAPoGbAnPCO8jK4ESWOLAwhoCPdRztGF0OYGZeEYCtek/DsSMNh1mOcBcv3EarUN9OwJ+So9RKSnnNm4DNmWihemx4FD5zPLa+zPxoEFyVd7Ony2wgndc6T5T6KprkuYPIcQRqz78vt9gdd1GqlHYnhYWw2EUJ0PdAt4FTBepZUzQV0hIv8+OI1wIueg7odAer+/Xo3E4prIbwmoYwrsAdDoDoqDSSx1zlRzddsC6KeVKV6fTUYISug7RCdCf3hf0uH6y+UezcM1r1YBuO/hLxmkrsXC9kGmn7x17OMNcdVilFE7W9G7w4ZGe5sIyBvlxm315IQeusoiQRmZvQnuuMhDAyA0FQwmRUyqaxrLIiUkNzWPqnVtybnfHm9UMdg8b5LcGSFz0MEB+5msPsEmDYEc9R6ltc4LoxXeVSeiMxqgqLZi5MPfv4d26H1aaggS49eIVInJ430Buw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EnIq6cpC1f64XThWSgwPj+yloZ36cJTkGFmiCXNBYP61D3Vo0Y0xd+gCuRh/d6mNGbI6JLDRD6foTcgR2xLsSVx3J6+qYBrInD9AqhmrVbnu/OBaarmFRDiMCaUyIVsPmOsU8J8iEaQIWJAzAu3pKs8A5GbZu9nIoLG+zIboyQ1oc964PqQR5HXt79kyYaB7/A5lFtU61FDfbrXWLhCh7a8eg+RgqpNRwwz53sZIcS7+JIc/1iJGtP/MgijMIBjREo4WrQa8SoTLKpN6WyTtPnHtlho93IJXR/9F+OM6W047THimnFdoOZ1qrEo7+3NL3GQpfcdD7VTCONnW0b1FQawvMU7LeJBvPtSKIz/hpKLsDYVF6NlEPV+XNU4QLUAMt3S7Q6aO6yA2ZmqMYGDHO20SL7/XLx5VYz3f9r6TglMcNWcMFhaO4YFz/B1cR+YEYAEJRbmTu5NkQAqGf6EIjmGwz434n0Bh0i/3T3RBFue+da6aiC3XoYquDNJ/lXiRQ5PuWNNZmAb0rIz5O/DAVRki7CPe41zFiHiZ4FFJ6zGXJvY2ebYPersxG8JZMt4snj3sXUn3hxfjUKf2bqQ10e0qXWCyG1XKaYIkyZdgPy39NEVoFXUKX9kirwijn2WeQymzlwNQBiJ7AYlEHdRqeEFqzGQHGQDN6qM6OPLlwlOYLoimyQLp3PsV/3qRUzUbvbc0DF4Ud+JjSOeohrm5u/4N4En2NN+6ex3ylKrFB2wQDEtSsPXjauiCljNJFpzS7U5hyCYySYUGJZ3TSG0Dp6CYCoMj03wowVbrCa3atUPqsDsFVsvPm1yoHtQRyQe74zklRMT9EbYOLac3TZkCf3NY9+/lJqdU5RAh9oxg78RfMx1X51ntmXKtrIhkD8vwjSEMxqvkOLHXTsV3b305b/mSP/IjzPmM76ZhlMePrYrlc2cgSsCojxLJhxHR5fq3l+/9eGKPSC8ZVetgeYUwf/kbtozBXLGIFdPDkVvRS8KkPCvRBwW+ZTL7slsK6+Ln X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3bfb8b5c-7407-450b-8554-08d8bbf1d876 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:26.7271 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /hAVoV9sfpHbLyS8QBMp56DmzaLfj8dkQ+N7kWDNqolTgcJ7p4HfbZx/PzCyIFbpzDM0UQ8OlZC2U4tPXqknvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The device's firmware accommodates a revision field that customers can assign when firmware is exported from the vendor's development tool. Having the ability to read this field from user space can be useful during development. As such, promote the fw_file attribute from W/O to R/W. Writing to the attribute pushes firmware to the device as normal, but reading from it will now return the customer-assigned revision field as an unsigned integer (e.g. 256 = 1.0, 257 = 1.1 and so on). Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index b2de8c67..5ee22ab 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -64,6 +64,7 @@ #define IQS5XX_XY_CFG0 0x0669 #define IQS5XX_X_RES 0x066E #define IQS5XX_Y_RES 0x0670 +#define IQS5XX_EXP_FILE 0x0677 #define IQS5XX_CHKSM 0x83C0 #define IQS5XX_APP 0x8400 #define IQS5XX_CSTM 0xBE00 @@ -99,6 +100,7 @@ struct iqs5xx_private { struct input_dev *input; struct gpio_desc *reset_gpio; struct mutex lock; + u16 exp_file; u8 bl_status; }; @@ -666,6 +668,10 @@ static int iqs5xx_dev_init(struct i2c_client *client) return -EINVAL; } + error = iqs5xx_read_word(client, IQS5XX_EXP_FILE, &iqs5xx->exp_file); + if (error) + return error; + error = iqs5xx_axis_init(client); if (error) return error; @@ -1004,7 +1010,15 @@ static ssize_t fw_file_store(struct device *dev, return count; } -static DEVICE_ATTR_WO(fw_file); +static ssize_t fw_file_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%u\n", iqs5xx->exp_file); +} + +static DEVICE_ATTR_RW(fw_file); static struct attribute *iqs5xx_attrs[] = { &dev_attr_fw_file.attr, From patchwork Mon Jan 18 20:43:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 365754 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A680C433E0 for ; Mon, 18 Jan 2021 20:47:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAF4022CAD for ; Mon, 18 Jan 2021 20:47:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394440AbhARUrR (ORCPT ); Mon, 18 Jan 2021 15:47:17 -0500 Received: from mail-mw2nam12on2046.outbound.protection.outlook.com ([40.107.244.46]:61569 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394477AbhARUqT (ORCPT ); Mon, 18 Jan 2021 15:46:19 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aPypcKjw3Fw4h1v4pCZHy7ALnyJ3tBp/KXdbzky1mlKEuXG9FB0PFHBTDO3JUV1VwcBbgNpB42JpV86iHoFXHYbGEx3JC28CbLTQ5lRNMQwIQAf+YB4j10Xg5Kx2PH6QQnSovtIuNacFJY+Oxp7rT/Cp5esQd2LNWjsX7/irDauJOAQEKXKUCd1xv+BhFaN6KEbsL02shY5oGQZ1I2pvi6+uZtYp89m6HlOVrKdQ0dz/PSfYn7mYsed24fZMcvyfgfAjJReIeZF5Bre5rHi1j6n13A915kVj6h9XEIGSGLX6DWjiNf7SFwvP/VPA6XJwnFrOGce3kXihvQ6vpuK8aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kZ01RHokEiRP8Y7Xo84pfFxsa8XvVbhYj9GqvMpcTpI=; b=SpKNu5hcjwIJmhsgZvTd7d9MMlb9M8Fp14RgJ3GyKla8PHErGZt6snKZoe3GrjJ2DS+kt+hokCWdk8p733BgImHHsw5mCVjiSc4OYs/YGkBrpzm8+bGlQtlwIfyKEt340ffsEd58RlZJ+kivsypSvcyQ3mYaYE30YbvI5DkoflZDwCctJNAe8G33ORMfOjF1UQh6SRud48bJ0pbUp07WYK2EriCx/8BxdUaRTYdheNBKNB71hWIK+lush5X3yAoKifUJyCLO+r2QnSVVYMXZIh6Wyq7isHVrWJGanXFzfJnMZXc5KnUXok/6gP4LQwZIcRVIANHV2BsK7nf+j4OiHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kZ01RHokEiRP8Y7Xo84pfFxsa8XvVbhYj9GqvMpcTpI=; b=VRq6caHy+s3AHY04jRaVn5AsCpyWwP8gv1lZpokJKByXLhLyqjPny1ld9PNRPhCudNzB059OYWtGCc70C/5+6pqJLm/06sP4HEdeSv8j/B3CS/UDl6JzMHzi/UbURX+BepL1obYrICFi29HcNvTsRXXX8jgk31vzNWu3tAh+RL4= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:33 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:33 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 05/10] input: iqs5xx: Re-initialize device upon warm reset Date: Mon, 18 Jan 2021 14:43:41 -0600 Message-Id: <1611002626-5889-6-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8810707-73d2-447e-e686-08d8bbf1dc5a X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KimiJg7yhm+K1I3zk8lkLG7J3eeJOH+U2798jPLq7gE2kI+193OU49bxtklJNsPoFIE8GffzIYHg+3mana4706OaduH4q7ozRrV6Qxak7OprYWC86e/1kVLUqfG1Xxvk8eCWxOZRGS6bpv3PZJg5NBcVpHFV6gH1C4xusMGd+2DJ98Ibj6wXMTKsiKHIYOXv6m6Nt0GwxwlhYFvQOq0LNwVsoq2V6Mmdb116h1CfG+T4aczaOwlVi08+s7m4MHdTApj/368PYHfVJShXhrbic6CW6mNqLnDTRx5H7nTCLbw5tNWM3LDP1ae9f+a3jSjPG5Mb+BND5nZvLr8TgBGStZ4LD3vAWZyUQEt4b+D0vn4S/U5PDeAqRgKGBLgpI6SYQ9stPUf3ChViqhqeh6PjeexOHl/VF3t8vh0giioyakhf82pPmfy7hreG2MT0v6iU9qX9qONeykCJCRIHGgZ86w7SPg2JxvErCDy+3aotTDI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZUsv09sqgoA5IEodzV8CI7f82OvGcr06uVz7NP0UEHY3xbKuxaqMQzD/2qyV5JZOeOa5mpzQ7TMGtUq+w71bOb2pMS4UIzESWtGLgzuvaq+ioPPjs6TH1iSusyYmv0HMz56GMIJNeB+uzHV4AsrVNA2I3wUmxNVUd7Bc+sVCWMyp0OkkFWXdBql1Bur2qjrNQg3QQGmowCLGHbvq9zGysiBEI6uBrKvISVVV4V1PCoKomCWBN4J068lw9lnm7j0+nvMpIoMo/MKivyXdg0CQvIHXHJd0TcJ2ht5/iq59YICESLjmQjcXKbCWoicbl67Vf/JP5BJV88UBWZ00MIANT4ai9r5FG5q6X/WfijkDdCvoOUbLtREbanvpIgUA0iPksyOBqGBMEgyd1jeIwbVejrw5EayXQ+k6MWDcilMNppJWIPqjMdEcvhoigCqH+ueKTj30Pauq48SebDBePq9fwtumM2jveITVs1v8COsXRko9rq4ztyJMS4V2+NdZx2Krz819fqMeKvSOBZOG2LYCs3pHJjlRowQalPKsajNhcr8y6rA3DPSdamsXNKvt4rC8fJ8BizPv3+QLx2NpaBpDkpne1rlN5FMPQMGwwUcyraxCVwI/lH7edEseONVSd7QH7tmg3UyA09DlXad5371W+wkfgcNBeKIJXC3H/me2dTfkQWl74fIV6bCfst0rmeTYXk6wMHV9kW+E9Qp8WxJOgS6xkjUQhlhQV3IxBGznIpDaX/3cxMBn6gK33c8Ay52NOM0Dk9TZJehVmp0i32oqx4lqw8HpQlUn6YeIMZcAZHB1+ebvIlJYvcWZN9oSD0kxOMUx//EdnaEOMLylI75/Fq9UOjXNmZuT7UDPTenRQt85+EFhIbxQPBktGE0DAa1/TKRpV1OfGoAEOnn5NFstD0zQymfrrhIZJWhHIGCyHqnUzJ160DfzoCPnLsaHnP9OOsRsUX9+jxLyozNIycHYta/TdKVHW6HHXoBNj9Xj8vqKu3qWErW9EQ3zR2BsCVO6 X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8810707-73d2-447e-e686-08d8bbf1dc5a X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:33.2515 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HbW2zAJ3+rQbSbkZTn+oMNUrSIyQr5KkAirvOTJGZUqy2LCl/+9kF22BdDt4U1W3yYkfkEcRiSDSJdfqYUoG3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The device may be inadvertently reset during runtime in the event of ESD strike, etc. To protect against this case, acknowledge the SHOW_RESET interrupt and re-initialize the device. To facilitate this change, expand the range of registers that are read in the interrupt handler to include the system status fields. Also, update the unrelated (but nearby) SUSPEND register field to use the BIT() macro. The remaining register fields are cleaned up in another patch. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 51 ++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 5ee22ab..9412fb8 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -40,8 +40,11 @@ #define IQS5XX_PROJ_NUM_B000 15 #define IQS5XX_MAJOR_VER_MIN 2 -#define IQS5XX_RESUME 0x00 -#define IQS5XX_SUSPEND 0x01 +#define IQS5XX_SHOW_RESET BIT(7) +#define IQS5XX_ACK_RESET BIT(7) + +#define IQS5XX_SUSPEND BIT(0) +#define IQS5XX_RESUME 0 #define IQS5XX_SW_INPUT_EVENT 0x10 #define IQS5XX_SETUP_COMPLETE 0x40 @@ -53,8 +56,8 @@ #define IQS5XX_SWITCH_XY_AXIS 0x04 #define IQS5XX_PROD_NUM 0x0000 -#define IQS5XX_ABS_X 0x0016 -#define IQS5XX_ABS_Y 0x0018 +#define IQS5XX_SYS_INFO0 0x000F +#define IQS5XX_SYS_INFO1 0x0010 #define IQS5XX_SYS_CTRL0 0x0431 #define IQS5XX_SYS_CTRL1 0x0432 #define IQS5XX_SYS_CFG0 0x058E @@ -127,6 +130,14 @@ struct iqs5xx_touch_data { u8 area; } __packed; +struct iqs5xx_status { + u8 sys_info[2]; + u8 num_active; + __be16 rel_x; + __be16 rel_y; + struct iqs5xx_touch_data touch_data[IQS5XX_NUM_CONTACTS]; +} __packed; + static int iqs5xx_read_burst(struct i2c_client *client, u16 reg, void *val, u16 len) { @@ -676,6 +687,10 @@ static int iqs5xx_dev_init(struct i2c_client *client) if (error) return error; + error = iqs5xx_write_byte(client, IQS5XX_SYS_CTRL0, IQS5XX_ACK_RESET); + if (error) + return error; + error = iqs5xx_read_byte(client, IQS5XX_SYS_CFG0, &val); if (error) return error; @@ -712,7 +727,7 @@ static int iqs5xx_dev_init(struct i2c_client *client) static irqreturn_t iqs5xx_irq(int irq, void *data) { struct iqs5xx_private *iqs5xx = data; - struct iqs5xx_touch_data touch_data[IQS5XX_NUM_CONTACTS]; + struct iqs5xx_status status; struct i2c_client *client = iqs5xx->client; struct input_dev *input = iqs5xx->input; int error, i; @@ -725,21 +740,35 @@ static irqreturn_t iqs5xx_irq(int irq, void *data) if (iqs5xx->bl_status == IQS5XX_BL_STATUS_RESET) return IRQ_NONE; - error = iqs5xx_read_burst(client, IQS5XX_ABS_X, - touch_data, sizeof(touch_data)); + error = iqs5xx_read_burst(client, IQS5XX_SYS_INFO0, + &status, sizeof(status)); if (error) return IRQ_NONE; - for (i = 0; i < ARRAY_SIZE(touch_data); i++) { - u16 pressure = be16_to_cpu(touch_data[i].strength); + if (status.sys_info[0] & IQS5XX_SHOW_RESET) { + dev_err(&client->dev, "Unexpected device reset\n"); + + error = iqs5xx_dev_init(client); + if (error) { + dev_err(&client->dev, + "Failed to re-initialize device: %d\n", error); + return IRQ_NONE; + } + + return IRQ_HANDLED; + } + + for (i = 0; i < ARRAY_SIZE(status.touch_data); i++) { + struct iqs5xx_touch_data *touch_data = &status.touch_data[i]; + u16 pressure = be16_to_cpu(touch_data->strength); input_mt_slot(input, i); if (input_mt_report_slot_state(input, MT_TOOL_FINGER, pressure != 0)) { input_report_abs(input, ABS_MT_POSITION_X, - be16_to_cpu(touch_data[i].abs_x)); + be16_to_cpu(touch_data->abs_x)); input_report_abs(input, ABS_MT_POSITION_Y, - be16_to_cpu(touch_data[i].abs_y)); + be16_to_cpu(touch_data->abs_y)); input_report_abs(input, ABS_MT_PRESSURE, pressure); } } From patchwork Mon Jan 18 20:43:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 365752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BC81C433DB for ; Mon, 18 Jan 2021 20:48:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6351F22CAD for ; Mon, 18 Jan 2021 20:48:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388277AbhARUr7 (ORCPT ); Mon, 18 Jan 2021 15:47:59 -0500 Received: from mail-mw2nam12on2082.outbound.protection.outlook.com ([40.107.244.82]:41600 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394483AbhARUqY (ORCPT ); Mon, 18 Jan 2021 15:46:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AwdTqKdMyI1Ns2VjzuI+HWDVjZFILl75XTurc/7Rhug2sUbeJOa4Fo1tOxFvgN/pwG47WdhJKWO4/sr+IRjnaMyUmXWmA6NDWDJlM4/dST5+8uOUXFxqzD/J7f0v10tzk0QXg91T0TOOvGkkwmme8T4tI+xRAeTb8GO66L1kHQn+j5aQKsB9cE6D+dEm2+DrfZ1tH/3Uqj6+PzaiFlT6M+WTjzd40zpqQ9TQK/E+pZf6Tf/N2R7Me1vgjdlHev6KqgBQKUoqFs/oxL1iDS6kT69tHflrJg9i85jxPgGj+coeu+0nig/7pepKFJqf8upqIlB88U5BZufsrH/do/kQmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CUridO1pWSagq+mshaPJT8NiSFHaoKUQniS96dKd72c=; b=MMMqyHod/Qx+SqVfoLlUHlJtFqCbTfxZrWLw+9Cj/S21XEIjsoatjqSsIKEA6/t2FACNRo84mbg0+dXhp+X8SmNW7ssl3PrQa7nsx5nCwt5tedg+xgQAPflcIt/+28u3B/fQm/LHj779OxcWvwrykAaDV5h5Ex/XR7BwF/ye//sT0AGmIIyTtS9POh/flgL3yQfC/ow3f28qCzKgTyjgPjCnOjanuc6uZYH0fRswPQQ3NPXRDGxEywGqKhkDbgCObLblRj4yOupQhO+aAcU7ifhmWJ5dzf0Q7nsid3yMI0TwGFQQVTIMkpqSaZk19/djQwvr8axTbiOVo4VYf7jifg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CUridO1pWSagq+mshaPJT8NiSFHaoKUQniS96dKd72c=; b=RK4P/CI2d7ul9rkYyUVlIsV0pzexTJ2gKJOgmNtBs61BSl11gzEJ+EusAP2WFWdfSGuaJS6Ldn7cu3vx6xvCX6DknyY0xuxGOw810g0c0J+3PcA++yZBHeh61x9k/KK3Yj75DEbN1b4+RjA1iyCDHZcUXk5M257JmGZebVM5JmQ= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:39 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:39 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 06/10] input: iqs5xx: Simplify axis setup logic Date: Mon, 18 Jan 2021 14:43:42 -0600 Message-Id: <1611002626-5889-7-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e2cdf368-e13a-4442-fed3-08d8bbf1e016 X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QIcrzr+8rHzmQU4uSO3GdVT/eaVm8ZeqQ/5AQxUYluCQuy/YPLrHt5dpWhvx96qSARHKUNJeVFN5GnLmddYtP1BANRGjGGaAJpXQkl6yTKD0W6W++qzcJFiIh7fW0CbGR9Rq9cP9X7Ikls5DTHfnQRMEpSHrIoCyYXWzh+n0mQoQGo2UIDkEAvz1hTp86v6N/OR+psmHxupeUhrIJ7wriHa59xvjhaf3WmmgxCMTi4hR7ebIn5Rtk8qIOfnVUbgNYce73KmSL/Cd/jmWheavJppgKaNyAlyJF2Zq2o5JWGSliJBoslMBeJlITtKrc3uNvGG7PHHSc1hfzhsXMWEhoer7QOb52Z7DpgPhnw9V5luM9bdBCiMGGOkB1TfqH91Jggsy/2FjFjyvGOb6yJYK1LT16UQYL+arkzxNK6TRIi39Ewu3mawXC9CzgwW/5RVjAZBHlgavJ0/WeH+JPfCFiKg+VXDRDzoqtOkqq4zxE9A= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZPfvfUBYnlGM/LZzXm/bh0TFLwu+ULlAYtlZK52Lw80EJ/eI3SuJWcxviULCTyR0ruzNH/OSE9DTXAy/exkas+dfcsGrvzeFopttBfOxtHVkpHBXD0WAE0/aJreMm5fpp0wAsGb2nToqAJY7LzWOA4Q4JMcsqyUE4PyVMKFxYzAG99WPrsl+CiiVCEujxCcxpiJ90xmcd14XU/JVsjt7NoRki5ASRtJxDFYe4fpQCzGwB5+2AxbsZVhuuGNxISYqn7dpU+Nq7BAvsJja3uOZVTMue73Ln3HAFfD00KofabOKK+igBV9o0XipU+hJ0ham6fUtYWsO3Wj3UgGNDoM0hyAoc95DRdqPWia1aJBJHMlhTLt9Vyfj9flQ4nwsIac/xvgHUJi1FyKsSNyFEGkQUH6+lgbGlTNqeYv8AgDDu55HIc4UmOlYr3AIsiuAaMkRAFTKY2yYlT5en1MoaV9YKxWk8NQSothvF9hLDMD5v1iv3XXv5A85mzi8Oqte3VDAga3wMI9PsdxWZMsiVj3mb9ZpghN7wDSJcStLsyR9mEQEa41CUgDDnC95WvK6E/vZRmpetZHsvBrr77dAJq8TKPGIeG9QbjPzEUHMOlikkSePhUbWCBXU4gPkWxjyA04H0IpI51Q2u1TCHTfQzVqYU63Uo33cwUjI3GNl195USxdadfyrY8NCwALb16VmeL3/y6KhVXiY2ZEIGkFeDq17KrQdlC81uGo+yTD/UNMRvNgZ2Ep0yE1zXjkrFM54shTP6nvT+8e0Z4geG+o8j84KqiJ4xUiTGRh15vFgrv43pxTChqIXHhr0gUs1+mQ1oQNUR7CtIk93K6g4NqUuh6cg7lmC5UdZskTNm3ykpnV84oqe6SfiA2L+oDfNNb0+wtMyf0SNISupbyTp2XLQrTfsq1XkF6xcl7M1t2UUtZT3zREQwIz6MVwJeLyW9Xw9SsAUF937v0C//zjGUORl17IrVMbCmF4+cjsL1DDBmQ8/gdkznr2TkWBF56deLOZ8PU18 X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2cdf368-e13a-4442-fed3-08d8bbf1e016 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:39.5228 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DqG7qMHgkfMIiUnbere6oxfwZU2kVCoCEKx2m619fXbwJsr+DO1dRwVAURYcRM3C4sOUcTbkST1Vwhcs90+D4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The present implementation manipulates axis swap and inversion fields in the device to more or less duplicate what touchscreen_report_pos() does. The resulting logic is convoluted and difficult to follow. Instead report the maximum X and Y coordinates in earnest as they are read from the device, then let touchscreen_parse_properties() fix the axes up as necessary. Finally, use touchscreen_report_pos() to report the transformed coordinates. Last but not least, the maximum X and Y coordinates are not functions of the number of rows/columns that comprise the touch surface. Either coordinate is simply limited to 1 below what is reported for absolute X or Y coordinates when no fingers are present (0xFFFF). Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 100 ++++++++----------------------------- 1 file changed, 21 insertions(+), 79 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 9412fb8..d802cee 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -29,9 +29,9 @@ #define IQS5XX_FW_FILE_LEN 64 #define IQS5XX_NUM_RETRIES 10 -#define IQS5XX_NUM_POINTS 256 #define IQS5XX_NUM_CONTACTS 5 #define IQS5XX_WR_BYTES_MAX 2 +#define IQS5XX_XY_RES_MAX 0xFFFE #define IQS5XX_PROD_NUM_IQS550 40 #define IQS5XX_PROD_NUM_IQS572 58 @@ -51,10 +51,6 @@ #define IQS5XX_EVENT_MODE 0x01 #define IQS5XX_TP_EVENT 0x04 -#define IQS5XX_FLIP_X 0x01 -#define IQS5XX_FLIP_Y 0x02 -#define IQS5XX_SWITCH_XY_AXIS 0x04 - #define IQS5XX_PROD_NUM 0x0000 #define IQS5XX_SYS_INFO0 0x000F #define IQS5XX_SYS_INFO1 0x0010 @@ -62,9 +58,6 @@ #define IQS5XX_SYS_CTRL1 0x0432 #define IQS5XX_SYS_CFG0 0x058E #define IQS5XX_SYS_CFG1 0x058F -#define IQS5XX_TOTAL_RX 0x063D -#define IQS5XX_TOTAL_TX 0x063E -#define IQS5XX_XY_CFG0 0x0669 #define IQS5XX_X_RES 0x066E #define IQS5XX_Y_RES 0x0670 #define IQS5XX_EXP_FILE 0x0677 @@ -102,6 +95,7 @@ struct iqs5xx_private { struct i2c_client *client; struct input_dev *input; struct gpio_desc *reset_gpio; + struct touchscreen_properties prop; struct mutex lock; u16 exp_file; u8 bl_status; @@ -498,12 +492,10 @@ static void iqs5xx_close(struct input_dev *input) static int iqs5xx_axis_init(struct i2c_client *client) { struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client); - struct touchscreen_properties prop; + struct touchscreen_properties *prop = &iqs5xx->prop; struct input_dev *input; + u16 max_x, max_y; int error; - u16 max_x, max_x_hw; - u16 max_y, max_y_hw; - u8 val; if (!iqs5xx->input) { input = devm_input_allocate_device(&client->dev); @@ -523,89 +515,39 @@ static int iqs5xx_axis_init(struct i2c_client *client) iqs5xx->input = input; } - touchscreen_parse_properties(iqs5xx->input, true, &prop); - - error = iqs5xx_read_byte(client, IQS5XX_TOTAL_RX, &val); - if (error) - return error; - max_x_hw = (val - 1) * IQS5XX_NUM_POINTS; - - error = iqs5xx_read_byte(client, IQS5XX_TOTAL_TX, &val); + error = iqs5xx_read_word(client, IQS5XX_X_RES, &max_x); if (error) return error; - max_y_hw = (val - 1) * IQS5XX_NUM_POINTS; - error = iqs5xx_read_byte(client, IQS5XX_XY_CFG0, &val); + error = iqs5xx_read_word(client, IQS5XX_Y_RES, &max_y); if (error) return error; - if (val & IQS5XX_SWITCH_XY_AXIS) - swap(max_x_hw, max_y_hw); - - if (prop.swap_x_y) - val ^= IQS5XX_SWITCH_XY_AXIS; + input_abs_set_max(iqs5xx->input, ABS_MT_POSITION_X, max_x); + input_abs_set_max(iqs5xx->input, ABS_MT_POSITION_Y, max_y); - if (prop.invert_x) - val ^= prop.swap_x_y ? IQS5XX_FLIP_Y : IQS5XX_FLIP_X; + touchscreen_parse_properties(iqs5xx->input, true, prop); - if (prop.invert_y) - val ^= prop.swap_x_y ? IQS5XX_FLIP_X : IQS5XX_FLIP_Y; - - error = iqs5xx_write_byte(client, IQS5XX_XY_CFG0, val); - if (error) - return error; - - if (prop.max_x > max_x_hw) { + if (prop->max_x > IQS5XX_XY_RES_MAX) { dev_err(&client->dev, "Invalid maximum x-coordinate: %u > %u\n", - prop.max_x, max_x_hw); + prop->max_x, IQS5XX_XY_RES_MAX); return -EINVAL; - } else if (prop.max_x == 0) { - error = iqs5xx_read_word(client, IQS5XX_X_RES, &max_x); + } else if (prop->max_x != max_x) { + error = iqs5xx_write_word(client, IQS5XX_X_RES, prop->max_x); if (error) return error; - - input_abs_set_max(iqs5xx->input, - prop.swap_x_y ? ABS_MT_POSITION_Y : - ABS_MT_POSITION_X, - max_x); - } else { - max_x = (u16)prop.max_x; } - if (prop.max_y > max_y_hw) { + if (prop->max_y > IQS5XX_XY_RES_MAX) { dev_err(&client->dev, "Invalid maximum y-coordinate: %u > %u\n", - prop.max_y, max_y_hw); + prop->max_y, IQS5XX_XY_RES_MAX); return -EINVAL; - } else if (prop.max_y == 0) { - error = iqs5xx_read_word(client, IQS5XX_Y_RES, &max_y); + } else if (prop->max_y != max_y) { + error = iqs5xx_write_word(client, IQS5XX_Y_RES, prop->max_y); if (error) return error; - - input_abs_set_max(iqs5xx->input, - prop.swap_x_y ? ABS_MT_POSITION_X : - ABS_MT_POSITION_Y, - max_y); - } else { - max_y = (u16)prop.max_y; } - /* - * Write horizontal and vertical resolution to the device in case its - * original defaults were overridden or swapped as per the properties - * specified in the device tree. - */ - error = iqs5xx_write_word(client, - prop.swap_x_y ? IQS5XX_Y_RES : IQS5XX_X_RES, - max_x); - if (error) - return error; - - error = iqs5xx_write_word(client, - prop.swap_x_y ? IQS5XX_X_RES : IQS5XX_Y_RES, - max_y); - if (error) - return error; - error = input_mt_init_slots(iqs5xx->input, IQS5XX_NUM_CONTACTS, INPUT_MT_DIRECT); if (error) @@ -765,10 +707,10 @@ static irqreturn_t iqs5xx_irq(int irq, void *data) input_mt_slot(input, i); if (input_mt_report_slot_state(input, MT_TOOL_FINGER, pressure != 0)) { - input_report_abs(input, ABS_MT_POSITION_X, - be16_to_cpu(touch_data->abs_x)); - input_report_abs(input, ABS_MT_POSITION_Y, - be16_to_cpu(touch_data->abs_y)); + touchscreen_report_pos(iqs5xx->input, &iqs5xx->prop, + be16_to_cpu(touch_data->abs_x), + be16_to_cpu(touch_data->abs_y), + true); input_report_abs(input, ABS_MT_PRESSURE, pressure); } } From patchwork Mon Jan 18 20:43:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 366476 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD11FC43381 for ; Mon, 18 Jan 2021 20:48:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7450822B39 for ; Mon, 18 Jan 2021 20:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394462AbhARUsB (ORCPT ); Mon, 18 Jan 2021 15:48:01 -0500 Received: from mail-mw2nam10on2067.outbound.protection.outlook.com ([40.107.94.67]:64404 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394486AbhARUqY (ORCPT ); Mon, 18 Jan 2021 15:46:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jjpLpugAW53viAJF2tkvEG4WZVZlddW6MwKs1z80n7OTsRB3Q+tg/ML8sxb0FTkmuuqtPU3wi2kMaPC+oRaEFNilN0peLIzM/XbgPnUE4ntUUwCjNvovsefuWFx0xadFB2zFkEaz4HljPiWwvIScojwvDCViVhw/w6QK3w+atE1pKOiZxQEDS6trNeAspPJTQrCMfCo9SdqeKc0CGutOU+dkskK+xrKoF3ATocWEWioDJfzriU61+kfeYtu+0UEf+ORPKAeAGZN2OMeKVCp6sNWMZlHEFrLygqVuQs0lao1SJBqMkJu6hV21qTsBtnQ36ZRlmu8eDwbbd9UOJGNXEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=99tCFmaIP6J0T2csL+YpzW5tvg7QBkqXq6sXE9ql8VI=; b=gONKKbvvxh+jNWF9xebhifo6CRKk8ZCgHBF+9lt2AH1HBbwfKrl2Fki642ObPk9fKD9h3kWW33/gSpkqh0hFUbCHSC9fm0t1e59wZR/tywOLKcLPr1U6bNtTbDGdyPFMo5pt9fefzkKqcDfVsqSyd5OBDNNBH6qTI3AWc2z2kYovopEd5cEzh5sQdwxoLRj/KhoKNB/eP6wooquCyIkdsOycwSYi70nbIwtCfk4EbG6y3R/J7iSsw0HF8MMrQX98R0g8ne8zSBSZaiHJjgY0iMjkTL7kPuk4V7NRC6AU0Ohb8gikI8TXCs4Tj6IUnT5oEwyjkanJZy31jQU9y1Fe0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=99tCFmaIP6J0T2csL+YpzW5tvg7QBkqXq6sXE9ql8VI=; b=CNYSiIqxu0isfaJV0jNKbVORvMw45FvHH8qOFTtiUOd1HxKl89LDwdd0/G3r4jBQ0bR79DTUock/TYy/CbgVnWCeDy0AIdprtdtOleI4QXoHbj/ALyRtrkvvyx1x/91oPcN9+jpW8YsN8ztnXtYkUJU/0q4lPg2lg/YCfz2NkzU= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:46 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:46 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 07/10] input: iqs5xx: Eliminate unnecessary register read Date: Mon, 18 Jan 2021 14:43:43 -0600 Message-Id: <1611002626-5889-8-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f41aacd9-5d06-4ee2-6acb-08d8bbf1e3e0 X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0b5FflrVgRjN2Rq/2/vnFiVj1NLLVA7JbHe1PrYw04MbU21OWGIjO3aCMjBhg+wIGTjZRdPPk02RP6RoqQwzUGDYyZYWPZw374nRFq9YdzPleNNW/fCBs01BxFnPsgUdObAr0jCIr/fq7/Jv5n5cO45E3YNMkepDXKRfUx3q8JR2L7y3vklfuDfIeaMi/QHAG6YMD4E7rE/HLU924vBN+Z5BY1DaXh0VglrAblHNaKTSj08Rkst943Q/wOh++MZT0dUGwmPCAZGRV2to/5FXxJNzFXEOBLpOKBiiYZsmrUoHzES4r95kPYjtn925X4jyatm7dnOzd7kyZIPLmGKj2jqASE+FgqiG1CifmDTwKqqrJoMe5ATpAY8w9BCKXNwY2Yo41KKcjhA6Q6XUAV5aXNNxwYWy1/T1MiwCefcaMi8gb628gS6nvAK2+vIv6HGR55H7v+RmdGO/lQH8fv1KB4emb8dgF0DoybUzdNP0K68= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: acG9U5VCo0DI/TMyZUTIX1DYYzZJT0LyT4opvhWa7hrpY3J/INw8KfTEWwGqghLubN2djtO/BzDkPF+V+QYtH3WJ/pRHzGMVc/rRJ6LId04xyPjhLZzQB26OH8WPV+clv36DtCCXywOKE0aDvlGfCIc9Y+iR2itiIyHIiUlRH4MkGsxRX5OOBsUiTMcwQ6ydxTpwTqXIIInm0gQPL7/LzkwnsB/aMntLrqLgX+AHRvlXD7oppoIeAz2kTRLNT3SCjLMwd0f97EUrxPMrj5UnPlsC4mFI4ItedCIEmrnmaRlI7hUnfcb2Shl7DpXlOmooL9aBMTsfOWnzP3MUlaTnx/hSfNNnCrEpGqLwpJRoM3e/jfEIOxNovO7NJjo9UaLY2PACvcaWh7OUABCMcifdbj6nqQmqaL+XDEFhSkXDryqQKXZuba8ebf1Vng/QX9Jh8HtkGfV3HTOxG+ttMrAEQcqi7SFWwMJqMtMi+j0iTJ20hFL35nSFoDYyZqoWdASoR+2n0bNxocFAuewz2hfNwD+mHLJVOBE41g6Hdc78Ab5ddihTNun82EEGK2+JQFR9nQjTzg36pJrny+FAYY5VXTn2jSG9xn9SL4irJGW4vep9+tnyxNynNDFh8FaSn+3wf/eD8UGNXe39yT3884+TwUhIHWh58IQRPYvYZXQCwQ2JGu0QpICENlwYNbwqRn7KziCrfcvvoY/R2OBIvp+Jh8pIeqRp+5dyAjZSA9Qgnsjgik6EwXyipXLCr+qR/JlM5ZttHN+yvDR1M8VvttO5QrpdRBhP4vIDb1kSc8luNg6spN+jRk4kOrCXgRCGuc7yrJowzBqQ8JBqGU4arEUCK4M4SrxPniRIasEUSG7fqWI/l7o1FxbMoEeWC+k4tiG9WERFGoVaHy4olDwdegbzx2wNa/YF3IMX6euDRxyqvoNdb9Ex1ba78cbYi65sf0V6Q5qCnTwRWgfO+kPb++Wsft59I2mrBZFxY3H/wiNv+8LvqsvBeAlFlnWtPYotHZJf X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: f41aacd9-5d06-4ee2-6acb-08d8bbf1e3e0 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:45.8700 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XUg3GEVvJiWvKzhEE86zt/yieCy73pOS+xAG9UImfPvpztt8a1SAXHnjw5up3Ag5uxNK4GQs4+98l21BV5N04w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Instead of relying on firmware to enable important register fields and performing read-modify-write operations to additionally enable the fields the driver cares about, it's much simpler just to write all of the pertinent fields explicitly. This avoids an unnecessary register read operation at start-up and makes way for the iqs5xx_read_byte() helper to be dropped. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index d802cee..50b9344 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -46,10 +46,13 @@ #define IQS5XX_SUSPEND BIT(0) #define IQS5XX_RESUME 0 -#define IQS5XX_SW_INPUT_EVENT 0x10 -#define IQS5XX_SETUP_COMPLETE 0x40 -#define IQS5XX_EVENT_MODE 0x01 -#define IQS5XX_TP_EVENT 0x04 +#define IQS5XX_SETUP_COMPLETE BIT(6) +#define IQS5XX_WDT BIT(5) +#define IQS5XX_ALP_REATI BIT(3) +#define IQS5XX_REATI BIT(2) + +#define IQS5XX_TP_EVENT BIT(2) +#define IQS5XX_EVENT_MODE BIT(0) #define IQS5XX_PROD_NUM 0x0000 #define IQS5XX_SYS_INFO0 0x000F @@ -188,11 +191,6 @@ static int iqs5xx_read_word(struct i2c_client *client, u16 reg, u16 *val) return 0; } -static int iqs5xx_read_byte(struct i2c_client *client, u16 reg, u8 *val) -{ - return iqs5xx_read_burst(client, reg, val, sizeof(*val)); -} - static int iqs5xx_write_burst(struct i2c_client *client, u16 reg, const void *val, u16 len) { @@ -562,7 +560,6 @@ static int iqs5xx_dev_init(struct i2c_client *client) struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client); struct iqs5xx_dev_id_info *dev_id_info; int error; - u8 val; u8 buf[sizeof(*dev_id_info) + 1]; error = iqs5xx_read_burst(client, IQS5XX_PROD_NUM, @@ -633,18 +630,14 @@ static int iqs5xx_dev_init(struct i2c_client *client) if (error) return error; - error = iqs5xx_read_byte(client, IQS5XX_SYS_CFG0, &val); - if (error) - return error; - - val |= IQS5XX_SETUP_COMPLETE; - val &= ~IQS5XX_SW_INPUT_EVENT; - error = iqs5xx_write_byte(client, IQS5XX_SYS_CFG0, val); + error = iqs5xx_write_byte(client, IQS5XX_SYS_CFG0, + IQS5XX_SETUP_COMPLETE | IQS5XX_WDT | + IQS5XX_ALP_REATI | IQS5XX_REATI); if (error) return error; - val = IQS5XX_TP_EVENT | IQS5XX_EVENT_MODE; - error = iqs5xx_write_byte(client, IQS5XX_SYS_CFG1, val); + error = iqs5xx_write_byte(client, IQS5XX_SYS_CFG1, + IQS5XX_TP_EVENT | IQS5XX_EVENT_MODE); if (error) return error; From patchwork Mon Jan 18 20:43:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 366473 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 630CFC433E6 for ; Mon, 18 Jan 2021 20:54:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3619122E00 for ; Mon, 18 Jan 2021 20:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727415AbhARUxt (ORCPT ); Mon, 18 Jan 2021 15:53:49 -0500 Received: from mail-mw2nam12on2046.outbound.protection.outlook.com ([40.107.244.46]:61569 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394497AbhARUqo (ORCPT ); Mon, 18 Jan 2021 15:46:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SN8HDqNfJuIgkRJmZyHa21pmh+7qTM/D1wxXEInkw3gcNydL8j2OiHIZqo7P1KsjukiOKZ/eqsvnl8L2VvPAic5vTbh3ec9HJRe//m0XDoZAy7HNVKdmRo7LsZnEz56zDvTGcjLFyqOs2+tf+0UosVtckbFjIlix54x/C3sYcc3QQF2/bcnAlSgvL7/I2/jIqVDwrAmpu3pehj1YvLxnwJ1ViAeEmLeAF1d24VGsrGiy9sV2YGV/OJxUJCnV/g/6HytI0G6PJz5a98NmH6DXvqi+lTNfJ3e9ruM9u1sEzH7U9lHVAHreaZ2vNbr4nJptg0EgEkiFIhoVajUt+wIccA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fhgl2iYRca7HZoQUK4EJ5IVrZk32sjJFMIjWE/zshLo=; b=U6e4GFmPG9OKQKaIl65sK4uYFyQDpnCGVUqVPZ3E0UvNtayQZi2vDaD+/E5XdwWXTZg0iU1jODv2yP07pSCmnn88tO4iRhp0Liz9vhB+Nqp3yCBuOus5KSY/80i3Ju463AjUxuhfyY7YIcEHrSneFvaAJ3Awpi/InwsGqSCjwL7mlFeg0zx4QIb7HQG/ZQb1jfY0pAw787zzBIJ7yy96TjF9idIlRUwM3Rpb2b5WCcQ/qDn/7xMgFZtzSAPv/qwA9wxov0OYMObJeZNfjI1LvFsn98eVLt0vdxjX5vUphYeNX/K5S1Ir/tsj4GUVJyxnZoXBHU85gHqlNGaemPdASQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fhgl2iYRca7HZoQUK4EJ5IVrZk32sjJFMIjWE/zshLo=; b=ifN4RyYM5gVZyDDaYJ7VxXCBgYwg2CFxXQac8YIJKZyoN9l39R1gPPsd3Svx5VWp7MtP4iLECO/Igwqj5wWd+opJm2Gndb/dDEa8F99evkUwVL2sg2ZiFup8h3pdOB1uPsziM3h6r0Fc17hXIoW7OMs2sfmNDfFdCsTi8Mgyn9A= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:52 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:52 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 08/10] input: iqs5xx: Allow more time for ATI to complete Date: Mon, 18 Jan 2021 14:43:44 -0600 Message-Id: <1611002626-5889-9-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1b118ba-d3e6-40e0-a0e3-08d8bbf1e798 X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KGdJ7p8EIvHfBOWbRooNRBr/SKUbG6d0siH4vHxqJU0LxSjEen/ECwx5Zxi5comFdm+0ZrQ5RYTdnGJhZgeqdCDyX30n2gNKhjA7ge92Ak97UOiNiwExYV+llylqKRWl8u/iUqkbg2Xrg31XTa0KG2VffmfMvtThdw0Yzv47DkKjLMfCpPLppNOVGlPseuZuO7tvrTxg7MNz6z8r2wxsFibc/SY+YnbzUaKbeA65W7fHsQXEuSI5a681E3EFgi8nVTLsx2C6Upyg1ICboABA3HKk8lFaCdvFK4D6hH5G3VQZ+HQZr075+czVKxjsMPupWcK9mMpRbCctapBXPn3RdKcrS7W9oCUzzXzBL5Z1ubWMSVzky1I25dVRXBOPDi4/kDF5wSKIfeVM/v30LRo37X+l9xOborqSJX+sRxVqBH4vcQFJmNt7lYeG4FfEAOLCOhKgpCdXKa1Hb+MP//szhz+7rPS8mkjaYU5FIYkf83Y= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6HSlESQ2BON67t0bBUZkZXsadPKzI5q5SHUUgWcbshQXucfDemvi+R6osSzWzDi2bpToKISCzeoU09XT40dPn8rG+aWi6gvpgsmszKxLvKzAYj09LgWux+CPJ2T82UHDVCBP6dZchnq/Z+fhkW2w+a9Mj37kq4hU23Cs7mmd0GlTuRXEwTomIE+6fmPes3Uf0jAkDmykJH3wli0FvQrHP15dl5QLdXUgnGA5G4wqcH1HqGBplKKiqSqwqYm0HklsyyYK5A1kEh+aSxho54QTcUUQKu44qdHTIjWoJWrHZo4wLHuiE7fCRsRKbxQV33BR3NZ/atlAsM9YY/b6sJ8Q2Y8MSHlwkqwu40yL/Otqwmjh6JJ1F3TZe30Ndz36OXUSJ5CVR3sx0iJ6tsG9PvyKYdi5ZYFGtmvInbuPOy0rsWvKzrgdxJr4i/GWszVYdxnKRFtPsR1CgqXHltphuWXvN+xQ4h6RWX8gzlqDmLbM0/cRYS2k5cbhHK5dTNXRT45EcGH/+Kfhpb6q6Si+5aK5cQ44t4H8bdzI4oFZeWcKw/erJMROO141gPTTBlYnC+w4MGD0NhEGkWMKbwhWywsK/R1tw86Ix+bhwqONrYWNj9dhrWgSWp5NC1KrlUqgR+EI16qNZI1O9rQiNBirUNEUatgfNxQqW9WLJTZ5yX/U2ax+6N1V3gyWPPMG+0xtb3dOx4ui+w6eSv6nqt/wVsAU68FWwi95z016kuDjWQcquZmoeuUDUiNmvfQ/JCI8XLTHlo266BVXSqc5ybnRZgMEcdti5v83Trirj8o3/dMKd04/i7nCN6IRU5d3MB3HjF7wsgmeR7r1317u68wsDuDjiqCOvmCZvwjTnXOVN21vJGuZb7JV5SdnGq6BAw5dysoGUkmxz+IzxlUsmrMhoGswD9AZUt4Synyt9Vb9hUr7cC3VQBiEVmpLt5xB0SCNf4rpHepf1LmKm8i67RA6wl1fy7Cm9QoE1bwfAGyg9nd97vkLnsUWmswvPHjdnntsmEpE X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1b118ba-d3e6-40e0-a0e3-08d8bbf1e798 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:52.1065 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LO1/SeGgA7I1Jqxhlv8t9wgBPEvWpzsxw8J7Rk6KYrkVVOm+qkKKTUh3EzQRQ40ygoKTlKbHqsI6zkaxUQo50A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org After the device is initialized, it runs ATI (calibration) during which it cannot readily respond to I2C communication. To keep the open and close callbacks from writing to the device too soon, the driver waits 100 ms before returning from probe. The vendor reports that ATI may actually take up to 250 ms to run (including margin), so increase the delay accordingly. Update the comments to clarify the reason for the delay as well. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 50b9344..babd1f1 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -648,13 +648,12 @@ static int iqs5xx_dev_init(struct i2c_client *client) iqs5xx->bl_status = dev_id_info->bl_status; /* - * Closure of the first communication window that appears following the - * release of reset appears to kick off an initialization period during - * which further communication is met with clock stretching. The return - * from this function is delayed so that further communication attempts - * avoid this period. + * The following delay allows ATI to complete before the open and close + * callbacks are free to elicit I2C communication. Any attempts to read + * from or write to the device during this time may face extended clock + * stretching and prompt the I2C controller to report an error. */ - msleep(100); + msleep(250); return 0; } From patchwork Mon Jan 18 20:43:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 365750 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37561C433E0 for ; Mon, 18 Jan 2021 20:54:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AA8022AAA for ; Mon, 18 Jan 2021 20:54:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388600AbhARUxp (ORCPT ); Mon, 18 Jan 2021 15:53:45 -0500 Received: from mail-mw2nam12on2082.outbound.protection.outlook.com ([40.107.244.82]:41600 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2393965AbhARUrC (ORCPT ); Mon, 18 Jan 2021 15:47:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PE8SB5MVvCDPhrnIMrV9WvlUHYUXVS3bhlEKMmzRQ8Qr8JYP+nyL5KQMPxPHJAMu5q7yKOxQ3y58XW7t8g4bgM4R5U3TswMMOBWBXAvTJ1wXqfpS/N1OsE4x4MFDFGCotgcLxQ2phHzblzqdua8zA+wLEzOIAxVzueIzsuK5Ye9hheADDIIGd1lLVWL28Hc0hKhy0+amOeza5w2tAF8vN8+zLCVKtE9JzyFdc6upred3uaGgXOhenYZH14E3idEnb6n2D3rvpW1TvbNqXS0bKCBoHIx3uyUaMMMyqisKwhT6b91hmtDy9AIZgkpnUXXz2R/oOJlxRIOCDVtwstMk2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lw3PHopsNnuO4c0cZYCaXl3JgtQ7M7kRfKOK6Pvp3Go=; b=hDUYmIR/Q0v6M60x0xE7eVS78T4zJalYYpyXn5d13AD8Xn8KOMWsFxrL44hk3AhRc5cLGDL2CMnTqnKm8TsRmJJaEz9A8o0oSMnkKsNcn8pvcQQxk4DVRzw/J0MJ4g9zwYJ9bMCzkbL/PEFaQD/O3gHVeHu6uGlnB/veYTxkyTik31dLX8YYu/s29pznPil7enTwKhT6LnBpbWmkRrWyH/kpfPCVfqd0+k+OV1oiA2snL6pCXtb3S/6jZTt0lrxNbkSNTcm+8m0kVJmgGek81Dz8psVh3ImHEa6uT7MtvP7Rh2WC/Lid1ylMKwdNK1JRHT8FYwaJDY2syG8ZyZqqlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lw3PHopsNnuO4c0cZYCaXl3JgtQ7M7kRfKOK6Pvp3Go=; b=GogmlxKQe26pJw8+LXiDf8USzts6FJi6uV8e0A+pqxU4t1lu5v6zTj3TOmZEN84qpcezDWuCP94npJmURHKJMM1CtsCznwoUtvg2ICnmpXrEOI1gkP8ffDzLl20sqWMHHzuuEc1wiHMFinN9P05EnfPmkL+vnmrBCPmNaC5yNEo= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:44:58 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:44:58 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 09/10] input: iqs5xx: Make reset GPIO optional Date: Mon, 18 Jan 2021 14:43:45 -0600 Message-Id: <1611002626-5889-10-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:44:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2474bf77-d1c3-4ee9-c893-08d8bbf1eb4e X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +0uD4Y7N0nv9OmheLZBlpCFvYkQt9OyTLZmEMyH07fpd8zrsW9zHKtdlBzO4FilMvbC5Tun8r+9Axx+lV6kEcnHvS7T8+DJ6kcEHY77X/SOe9PVrkG8yiJ/NmInXF98s0a2BGrS+AonpCGEDVNeVcmxJwxZQIP4Eaq/BgcqhRLcchkfcyHkchGwb6gc0gZToM4D+P2XVXT5xewUEliuFEoLFV+bF77bU4x/nSfH8Qad61FE19FTc4L+9tsLF9R/+ZHRtKSVun4ZzHM66Ge2POYDfhTTf4ZTWlSpuUbinJOnhXyCSGTlw9wgkALSvEHMN2TXQ+EvC//9ymCIuWwd2U08jXPEZey99Ret2CCbzbORf3ZcGX3SdNaWxNTfs22hy21tJdt35ZcGPAaR5KxMiJ/AIg1+9B/AA1LOUHlEDQnWSkLZcabe/WkBK/zgNaC4jB2310YkiOsZbJTgUyhAVCm4+5mm3/FJ1EGfVW0G2h+s= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: y+Ph5gs0ji7t3kN4w32MdoWnGhhlKPlco65StriGaYboeZWSJ9ReeZHKpxPz/U+soEDmWGLd4MzyE8ZASVS2VT4LwC71oZ5X2IJKGJof0JqyhBH2lYqwhkYZQRel6BGyqCxR8b/rbBUxsb1VcdFQToboob4nxxeTzrK3w7W3O1ljIIrzxJUoGYDlhlOtHNSDoBxapKX5+UKcA/TqAqmNh3I9CPXT2OmQBeSrLW/jd9NAmxf5Xts14f8Pt589fdXeo02XdshuBCRyXqgwZjHlSs02YN2M6Nt1ZE0GCr3PHwy7clbWJ5bFUPguwnCdYgDl2r8zmjCYG6jNSLW+b3Jrn/BBAHmkGBZJ4MrtdlaXYg2zbIPBHBAxYR911cj540t/RmFx2mdNVFtTsM5s6+1/BRvImf2VNOZA200RMNh6kGSUJFHrcwPgyd7r5mIUdKq5wMwpKFKDlE1Kv/u4XuYGXQ42CyMOArKbZmV4IXN84VeycIknk5zgCHM2KUdASTfyNiNqqG5zrwZylvft1p54e+qi4O7Z5M1gR0hGArQFmxwDdzlSerBTO/5agLVZSjjvPpfPFIljHdWlnD+YBf0aTjBDJ1XOzE0RWR89G7t1hwkV9dvQIsZ8lUsVwFffVA4TmJQ3Ir3gkeyKZLrGCiZSFYTY7NlT7x5wJ/PGBtQWOFnE+n8HwOGnKO+RvIzpxq64okX2qQmWvHh8Y5lf+XvbkyqH3/s/1iqtvdV1Sz1wqTfJ6b+uXG4Gr7h44+uycQs8d+m1CP5grpQQCNRGDtLggUQx6GnbK4GQrybRG5TsvlyF0pheNnjR/RxH6L6pAWu4YlMqXm4sdDEYsyt9SNa3x0ggw1kZirRCbJcPLe1oPFJb8jsffduBuuHkYEW2wTQHPMdA6ANIUuZfJIRr2z/E+SNB21Qrcu3AdsE+FIrhtMY3RPTB/khALbMKbzOSxGxxh4wLOnNpqWYZt7xD+TJlC3Yp7Lusz6F0OegAlqC9PmUnRlDKOpUP63Xy25CJWX6m X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2474bf77-d1c3-4ee9-c893-08d8bbf1eb4e X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:44:58.3339 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DNpWi6lAkkIQzb/bTGNzP4PLcp8rOgpQG3lGvBVsmPck5tVz7G6JnK9JtA2vbZ74k+RLSW+1uAR5hMtxos1jvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The device's hardware reset pin is only required if the platform must be able to update the device's firmware on the fly. As such, demote the reset GPIO to optional in support of devices that ship with pre-programmed firmware and don't route the reset pin back to the SOC. If user space attempts to push updated firmware which would rely upon the reset pin to wake the bootloader, attempts to reach the bootloader are simply NAK'd and the device resumes normally. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index babd1f1..dac132b 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -242,6 +242,9 @@ static void iqs5xx_reset(struct i2c_client *client) { struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client); + if (!iqs5xx->reset_gpio) + return; + gpiod_set_value_cansleep(iqs5xx->reset_gpio, 1); usleep_range(200, 300); @@ -1045,8 +1048,8 @@ static int iqs5xx_probe(struct i2c_client *client, i2c_set_clientdata(client, iqs5xx); iqs5xx->client = client; - iqs5xx->reset_gpio = devm_gpiod_get(&client->dev, - "reset", GPIOD_OUT_LOW); + iqs5xx->reset_gpio = devm_gpiod_get_optional(&client->dev, + "reset", GPIOD_OUT_LOW); if (IS_ERR(iqs5xx->reset_gpio)) { error = PTR_ERR(iqs5xx->reset_gpio); dev_err(&client->dev, "Failed to request GPIO: %d\n", error); From patchwork Mon Jan 18 20:43:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 365751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 860B4C433E0 for ; Mon, 18 Jan 2021 20:53:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 606B622AAA for ; Mon, 18 Jan 2021 20:53:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394424AbhARUvb (ORCPT ); Mon, 18 Jan 2021 15:51:31 -0500 Received: from mail-mw2nam10on2067.outbound.protection.outlook.com ([40.107.94.67]:64404 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2393981AbhARUrC (ORCPT ); Mon, 18 Jan 2021 15:47:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NBEXKACwAotnlgEslMw/xhQJ3VnNEmS1HuU6QT1Kbxwbk9dWF/VsntG8J3SMTR9KlbcDQbTya3xG01G0+Rxcci0JrvQxhYPDyz4b34ggxYg1J0cghQb1bXrAdiXoAp7GmSz3Oui1nqIcG5bC9epa99ooOLwDX2DcfrRpB0lrhKoa4L9dZtQJyDyQXS7XG1hflk3U1iTe3YN+ILGxj06IkXl13+QPbnvdtE6vMUCJKBlfZDo6r2gMhU9uQ72wz64vaYajPR68KKf2Nc9kX+BvQUIVzrpS84VqXoHALBsKk6x7FNMY0B858zraXY/GBZJtf6HSetkRQeOsHqdG/43hTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=trXI4G21zmQhmnB7jC2FncyoTBMcHi+kPxU1iKEqcLs=; b=GN3jqw5++ubODqATGfYSFICmobd7h/0/7GJyBEe8QJ0ScPgNQM7i8Rvt4uWKavejcA6wG2zMkJtYcEQU2CkLWzS1Kf+ckr5tmkwTr1RICRxnHrw1KwfWInxTqUcfm4FBHODPDQ10KHld9Vf1RZElaGwkEY4S+wDhEo09ZgsO3KdnxWtqJXxfUIA/DWv9jlCcWWi93HPoZKX2KNKEEt+3tx0X0ORrMofikGbdJZxusruDq/COvGUj7/QB5upeyQt36S62tDylhhlI6e6y4jh0yayi65S9FCNfhcSq9CKo52Y0ChFA0nwWZyXLHi7nk2QCg6y6m27nSZxa0By237z37w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=trXI4G21zmQhmnB7jC2FncyoTBMcHi+kPxU1iKEqcLs=; b=eN1Qt9c88ElRkC0EFNw7xDU5O6GSmrHsbdSTtqoxsVrrI3rZOH0bqmIGYgsckoPcH2Gl1I87Nu/JF4/i4OOWVjkyTygeemIvVzVbK0kNzKM0Tzg+PG+20oiOe0tjS3k2tjYgi7Zj3QbrNN/iizYxv0QeseGXN1DPO7GY322O6/Q= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4846.namprd08.prod.outlook.com (2603:10b6:805:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Mon, 18 Jan 2021 20:45:04 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 20:45:04 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Jeff LaBundy Subject: [PATCH 10/10] input: iqs5xx: Allow device to be a wake-up source Date: Mon, 18 Jan 2021 14:43:46 -0600 Message-Id: <1611002626-5889-11-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com> References: <1611002626-5889-1-git-send-email-jeff@labundy.com> X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0137.namprd05.prod.outlook.com (2603:10b6:803:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 20:45:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7fb31ad1-e173-4ca0-e713-08d8bbf1ef26 X-MS-TrafficTypeDiagnostic: SN6PR08MB4846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y/2aYu2f5P1O0e3Iu8Qh9hTZrwIXrOBiq8E6Rjiyx4UN/NPLkgY82DFZiXwQmhE70GCikjsV2pn/ScXrkt80cTM7EmQz6g0xSJ+LFUD/D1VZzeff/h7ONv1d4GmbLwI3vo3j5Dm/yfsz9EhDed2HgmWfplJJqCLbkUgmmrnJpLCYEO3dTHNq33cI71fGBVjRLzVDu4bUS1LT1E7yKBtx3daDmynld0zDgn+NNM8pCf6jWYa1woCs6hgXo0xRT89Y7hDmxYuJ5q0GNodSX8eL8dTUeRUSxx6ccRHeUPeTk3pMTX4Kdx4f5xAtLzqodQw9UM4yzz6VBeI/U7bMoZUKVgsQSPnSyjMPn6N2AI96Rf0omH5nkBjtKhYzwPOqNiLFY9e14n7nBzsOqYuU499JQ6FuUvY/Wr5aCUUFd9oPbybYESUL/P34D9+eugvgnTnhSAvtoyXVTYH8rGIwOIPnRRSPw6hZ0g2XF6rMPIDoeUQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39830400003)(396003)(346002)(136003)(376002)(2616005)(5660300002)(36756003)(6916009)(6666004)(316002)(956004)(8936002)(26005)(66476007)(66946007)(2906002)(478600001)(186003)(107886003)(16526019)(6506007)(69590400011)(66556008)(4326008)(83380400001)(6512007)(86362001)(6486002)(8676002)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ULM+4HrCgQ66eSxj5RTLEe/PdVEaoPLO6rbVVfE6v61a5sAhXW79tx4wCeWlQRxTRaERw2Y2jFbToODEHiS41DkErFkbQRHXQXG/I4YA6RnT4NxKuRcSqFuY73woysJ7EeHTvxuIJv0t14Wgyjg6kcPwoZ4Vfzj/44t+5Kf5FeED5O/rKkQie3gZROd7NPY/BP5Jv3d9512X4LhUPiPBbxt19lYladakYX1Q4FcG8MaOhbLDnjAYPyzHyqY3ETRRVp0dzXuzvGqi0+XOucwLUkoz/J8D368stVxR2kaEUS2+mvuMzNNXWmhpvWjbRNE/dKXF5+RbyYi8YLwAtzkbFID9RYZWg5V6ao17mRGkrVZ6uiE/uJn2+7p7xShbg1xtPAQ3LlWVIhgt9gAjnFdgekzKEPudYnmKNcsdZ7PS3lADvADLqN9WU6J+4XHa2koImQeLNTWVAD9wtBwI/onCFbXNzfmTzrYcA+hIa1JYMiEKtmwFEHCmF70LNg4qcrBTCSwwVmoLKs7A5jeTrHh06sNMRxYrbUUpyr0sls5XfMZhGI4LcDILL9wrCOqJ5lzzG1QwgtKQzOzbu8xkKCox76/WfUW0bc55e1kltFwZcEbtLqkTI930rTfiMpd/m1mWkmEnOihDuA3MOL/XK2y6OjnhHm2b4pBVhZzZSc0HeEhd9ju/ZKL6hEOzbEw/8cmlIOIIgr1sHcCdfQM0/nQtDDhIYdOXNLAHKszXTwzYZ24+J3rhiG553oBdb8maMUL8orf1p4/Em/QHLZKmMlltKOvyrXo9ZA2kiVmBhfJr9DXnpeIju7eii2ruMoAWHq6F7vl477gywHUzrNvEbY1qEG4HD6JQE9K3+KLinr+8s1u6Zd7Z+xOkxIrpQO1uc5DGM5HOxIgFJNvv5B9YQjDtW3kqlty5Yd7VDj07kEant1iYrfdH4/8B8zVFoOm5hKnyLK+VBZM0fLvtWBGVMZd05bt5Vc1VLLixIg0oTXSKTlx0RIrVlcvEiA8NXz0lJfAL X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fb31ad1-e173-4ca0-e713-08d8bbf1ef26 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 20:45:04.7829 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PxiER1ukSOzrDf4l60Jvy6iGlHt19Vl7x2+GsdTx9TjqJd15LxiZ7NJOhDzDRiA3MS6vmiGL+JqrdQzsKVVH1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4846 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Avoid placing the device in suspend mode (from which it cannot generate interrupts) if it is defined as a wake-up source. The device is still permitted to enter a low-power sensing mode on its own. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index dac132b..6c1bc6b 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -1001,7 +1001,7 @@ static int __maybe_unused iqs5xx_suspend(struct device *dev) struct input_dev *input = iqs5xx->input; int error = 0; - if (!input) + if (!input || device_may_wakeup(dev)) return error; mutex_lock(&input->mutex); @@ -1020,7 +1020,7 @@ static int __maybe_unused iqs5xx_resume(struct device *dev) struct input_dev *input = iqs5xx->input; int error = 0; - if (!input) + if (!input || device_may_wakeup(dev)) return error; mutex_lock(&input->mutex);