From patchwork Fri Mar 5 04:12:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 393900 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.7 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 9DB13C433E0 for ; Fri, 5 Mar 2021 04:13:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7372C6500D for ; Fri, 5 Mar 2021 04:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229503AbhCEENG (ORCPT ); Thu, 4 Mar 2021 23:13:06 -0500 Received: from mail-bn8nam12hn2244.outbound.protection.outlook.com ([52.100.165.244]:11616 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEENF (ORCPT ); Thu, 4 Mar 2021 23:13:05 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=blyI5RGP4iPzN6T1QknuLlhwQQyUzkVnSQBDhWb7iWdPAvrAZPy0djP7P5fJKFwz5vJNliohIU0JQ6hlquXabWFKx3TJ1/2McNT9KfKBkqLcqU6gx5L6BbnhCJaOuOWgpq46q595nuP1MH1mUFDF+PWYRpsNxY2xgUHKR6mueVJJKDXboiuBEsA79uzXl1UdxBsXzELxDYUQhF6FxEW0+Ml76jvXICqP2yBr5/JsfWs/AlDjrf1D9epkpoPQrAyw3I2rQ3k4z6NqVzyCOhQevVHzps0L++nJ8d5SxzbvqgoALfRv2dKaaoOAfXsAFQBQ4qtyDxruUIE2zwUhX27I1w== 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=IRkLavJ5qhuDK7vNcD+/hAlXyGhEVuch46iBjIyE4hA=; b=X42reSioCeMKZupbbSbI8nivKasAxzr4Y7WxGL/TrGJWKZ5AaCDj0XsvWoqMuGWbhbF/or9+S9ESD8HYcODa5jyNcPLJSwdYqp6ej6pX+/P/oRMD9uiraDcBAalKzjKfUfDHROSUT7qTn8GT/fF2nBInPnMmwYKhvEgYnCs3o18PCGskwtmTQJl/vx2000/dbCsIXHQ5GCFBWUPFE8Z5g9wguGxRIz572J1iYHISXuaizGSNR44s5rayWCOozxXeLgd5rHrr3Y0WG0cs3kOO9Uiw2u4FXpdgdXaYrxM/MZyvWtkIgRCaaH6Ml5cuKNPTJ5RQvxKexF6ik4kEG7hynA== 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=IRkLavJ5qhuDK7vNcD+/hAlXyGhEVuch46iBjIyE4hA=; b=vUZGl8j/IZRAVBJsAZKOYqlfytueX5aqS6BmvIS4SjvOP7t+LebjB46WONKHRIeuH63kNxN/v+Qzoa9d+ic3fuCVDTpVPmlWAAQ/JYty/gxHT+4C3zfa3pnHrfXstj4W/675VHzBDxWZQlGR7oCuDFVJzjKdznNa7+Cx46mPF6Y= 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 SN6PR08MB6112.namprd08.prod.outlook.com (2603:10b6:805:f4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Fri, 5 Mar 2021 04:13:04 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:13:04 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 1/9] Input: iqs5xx - update vendor's URL Date: Thu, 4 Mar 2021 22:12:28 -0600 Message-Id: <20210305041236.3489-2-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:13:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3adf9b82-8724-44e9-9585-08d8df8cf916 X-MS-TrafficTypeDiagnostic: SN6PR08MB6112: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2043; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8wMbkx9LUYBUcS4OLACPhDSNq96BEexFG1DyQMJLtb8CpcRlT9433tSmYW7l3HZbRePtjvViKVn+SoOOyY8eJjAo08vZ97p7CwidLhIHeylwoETyS85BYYrep4DqT/wniUyfcPOMRz9NNfRgfjZy4v35p2M/APZwrHlw7t2z8T6XdjmmCpvc2Xwdnzz/+pV1oYLyJOVp+l0WZCiI/ZHB8epNHUEYbDvS6YTVmpjWDIpM81PTl06B9qn8VjkMs+OywlPZeQBE9/QTF78qDuGpgMWzQ+q7kaHNaWviB1izaRNx6NpIsZfPqzsTTkbz4UR3CLvmXChg64Lv+WbkNJNYJeiOisF16rBQfqJLP0hZY/QQse2aKFSb3uEA80NHWDKYcvmHwgIzIfI97JBumZhEqT5UZ1B0OOGSgnIFyvJs0M2DNPC0cT7l++T4DrSSQeudHvpWvs+CjcP981JuW7ao/rHu3qMD7g1TuHq0RQQmlOYui98i0ehU6Abr9N9RC+QBsh+prpAiLVoB9DGP5+ATFc8QE6s+7bd/mZcH/fNU7drm1en9YS59/PJzluyqmGkxcRhGQcSVKhb38qw+5EzTRsQnxN9le4ZRV3NekrUC2inXD76wNFAcNViTZJdjeBguDa7nJQmbPcXePGn0evimbr3yGnGWLrUoBVMH6CeiAHYLD+8XMfpQw1Y2gu/Un6OHJV41C/DCECpUSq0v65J/NU4GDRYnJ/Y39PiEMAaEe+iS1UydWl+Xp7JdVIlUiMdIU1GGMI/ZJul1WaVOEbvLlsgWCbGCb7gavCw1Q2G+gfADAo/RDRXtVoim9lV+WH+rdb7SZXz7o2HTvvhTn26kuWLxKQmyAVtqffO8JsauwXXGGe6sDvaBEshKLdw6U+sr3kmYc6RunPN8TkA6y7nDPGDI9/qtSmxslQcmVaCOq4o94Ua/00L6s0njSO59CwLWIN1rhRgSNNucJICArX0SZvQJqgDvHHi7I+L8FB/LfBvjQKHZlc4q7O3FJpPjbLYx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(396003)(346002)(136003)(39830400003)(366004)(376002)(6506007)(66946007)(36756003)(16526019)(186003)(66556008)(5660300002)(2906002)(966005)(1076003)(4744005)(66476007)(4326008)(86362001)(316002)(8676002)(52116002)(508600001)(69590400012)(8936002)(107886003)(6512007)(83380400001)(956004)(2616005)(26005)(6486002)(6666004)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: ie8003LlM9hVA4YZMHxLCYhzQQl6dqsY54IOnlnIbscaH701Pk/1YisjVWZeiKOuIPGkx16bCYb9ZbfoSUJaFRwsU9JUNQjU/108sY7pIwkPSBGC3anc+yl1NM9Jx1qwURhDWdLc9mrv7FeNN31VfCkOH4lZiR8kroFzctvGC/sM1fIXIakW3068sW/RiPGivTnuQHNWBYnzglUTurscjBO6qD98DwsaNALYDVbAyvraQpGT6IH3Ya0OaUdzAaHIRhdVcU78zYzUraom9tkElWgSESczj7x4+V+spOUzSCXauL0rCV7pjzYgy8T5NwMYxoBOvHLFqJ3nS/nfEW40vUnK+xZRzUgYuhBJIFqTWwhqjZrp9YiWaxlO4kdSia+gn+yzV0yy2Njy7AGrdXepX8siuWsf8iEjIyuu6JjLb3T2oFQS78VD/tx67XSULyPIF4bGJAXMvH23io8HKFRm0+UxATI3V9/TncMs2pwnZgk73STf//GFKlIEeG43Qt2ootwhVJMhyFrheJoD78Gg39bAi7A/yI1hGbN6DTsZfKvlWvNYuy42CdxfxhgC+d+kbJ02UY+VwZwPt41PK4RDgJVtopXl1GdpuOoPxdCoSdMX2c1XKnQIniXMt2yXzwwnbMUIJe+xz+8E4tZFbX/3VWtzWUQF6W+/Zyc4swDSVPx0GR4Fs4mjylcoGWBE1fdHx+eH0r/wfkl6gIjkFyxE69QdwQwuE8avi+HzICzUdbeMCUAeQLVXFzPPL8EXIUCfP4y8M34P99KG1wBY+hG6FUgdC/6FzobDlR+w9ggWYAQgnc65v49Q2bTqLlQlVMr8dhH18UzZrKWNFcpxpBcbycGSV9PM7+vk+ZUBejy/YFGbtQBttK7YE/JnlXxN5jTbvQzGMIGYUuEYkNRrSEQL91/1x59kcv9F/vGe4uzmg0MtLjbTSxmev8+KZZb4PqesUzLmJ6mWYw8pDUIjrY99AG/4Q3dbb6PpS4MnVARnTkASJ0UjcgPySZPpufS55FU4fC/AgZW9y5Wy7xyLWSZ1gvjmJT0sqrR+98D5BbEidNF5a8wmU9IjnsCuHZh6LTZ1hHfVZLHiea//YdquRkpjpMwxcAW6bvGUFSfpe2zMXkwO4iiHBQDgrymeEg8NH9IKlc3AqBHVzJHFDSOKO8gAaE0RnO9U4VKVvu4W5EffpiESWFpT/bi1qY2YeF1mfE7bI+3qL6tf+cj84/YokaEXmswul8QjrVSN3vA38TZFtnGxwH0HDb8UAr1Og9KiSEMQnAWxzTtPawgtcSE2bCMbMp+xVGpq6vd9XehVxA+Ez27FGFuxXW04OO4qgwuANr+p X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3adf9b82-8724-44e9-9585-08d8df8cf916 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:13:04.1786 (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: Rz7iNecBahNe2uzOy0TI+tpLXOlTj/eC5fqLuOB3ZJrMv0U4XReA6TwrZe18qAuykFzgOzpybsABehzRYBA9KA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB6112 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Replace 'http' with 'https' and correct the spelling of the nearby word 'datasheet'. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 54f30038dca4..403e251a5e7d 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -8,7 +8,7 @@ * made available by the vendor. Firmware files may be pushed to the device's * nonvolatile memory by writing the filename to the 'fw_file' sysfs control. * - * Link to PC-based configuration tool and data sheet: http://www.azoteq.com/ + * Link to PC-based configuration tool and datasheet: https://www.azoteq.com/ */ #include From patchwork Fri Mar 5 04:12:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 394759 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, USER_AGENT_GIT autolearn=unavailable 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 E4A10C433E6 for ; Fri, 5 Mar 2021 04:13:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B490C65010 for ; Fri, 5 Mar 2021 04:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbhCEENM (ORCPT ); Thu, 4 Mar 2021 23:13:12 -0500 Received: from mail-dm6nam10hn2238.outbound.protection.outlook.com ([52.100.156.238]:45505 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEENL (ORCPT ); Thu, 4 Mar 2021 23:13:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kj43CLD2sLs06ZZlj3mGgISajtmNwlADC5sJUWz60w9hprpdD8Gu6xWy1FzBCYJeKKpVnDt63vzoTRHkcNUxGyhu3p13GrpymsVF+8Eq3iSzjAB+I9SdGDGbLtrsDrZTmOr/L63Yc7dsOoqz7H69mTuBbssTt9eTSxXniQxeKKXsuC8Ka8vfrF7fVSIxyVVbxOqhZOIdOpljB6luMqdk+RYJE43VeNiR1yycVPaCfbdipaFYa9pkB4/wLo4XA903IKKaMBYi3kZj9kSgXcQe7A84kQxX0/3MNkXPVIMt1OUGTDQspi/iPgvbyXx5n28eXiXoNRSVzajxZqZCX/yI1g== 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=/W1FS2l2TCtl0QGsrbIbRyUB+wOqpihlQF7+OP0yCqw=; b=WodJdSlw3old00pFCoHclvwdBBVi0lyVxcPrSErF2GKtXOpys3AvrzmVh62KqTXcJDpPS9nJTI9wlVBCukupYou4qjYuSqKCrKvjJ1AplvNgq6GVmSgPD9g71mj6DAlvayGIabyu9QwDQG9vln+ycI8qXGrBY/18CbKd7IkmhZ+GU4fShgzdSscpukHBbXYiFqvX30GVXKsRT/OJPoIIcO0shyAS9w9TSC8qC4l6g3sjOGWlXf/9XF2hEuK0ni9VsWBB8rnHdTaB+EETJ4CflgDGGSCy+LbfVks/H2VTce1zdCSxviB4QYRbJuPWF1zCkZUaclXwcEzMae3pFlypGg== 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=/W1FS2l2TCtl0QGsrbIbRyUB+wOqpihlQF7+OP0yCqw=; b=eXJ4rYMj4r7AcbatSGW+YNiU0i6X7aE7F9TxWhCzL7YZ+1RnKtmjkbT0V0mg5mM4TgWeG6pvkVdw+cqQhxNxgjca2f6AvvGqKlC7M4+3H9esLrDqti73jZeByO4qx84ziv/P3jenipRdvwnmh9I3ezsBEW5ZGOH1MnoE6cM6ShY= 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 SN6PR08MB6112.namprd08.prod.outlook.com (2603:10b6:805:f4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Fri, 5 Mar 2021 04:13:10 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:13:10 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 2/9] Input: iqs5xx - optimize axis definition and validation Date: Thu, 4 Mar 2021 22:12:29 -0600 Message-Id: <20210305041236.3489-3-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:13:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 882b5972-ef00-4a4a-c579-08d8df8cfcfd X-MS-TrafficTypeDiagnostic: SN6PR08MB6112: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nLPKbsBbViPy0upspyAgGVlXONaXh0+KhX4s2C/OBqO3zLvxdOEZxl6i1UqDEA4bLA1U2PlS/FDkvXCdpyS8Cz0UCgdiW/UqB6XHW34uPFlfYlRToCeBOT6nJlllRFXqJgx7Eq+btrTsD/I4I4dSTuQ2rIpM351lYUeMT2e3K+V/pGUDCwEbomwGdg0Na8Ia38pvHsKm6pCneIIerVJeuxXMHflfIp2HgzeEt2sCnxy7139dfnmLEuXv6qETd24dPbgVoD8WwqU3EIb6H8wMhsJX9vXi/BcyEL0amMHfcGWsnD37YksfdeJjk9zgxOCnGXdu7/F2revnzJ+nDSKwNx+PI1Nq4rS4sytsSzgtvsJzudoJc5kBrjaTLfCvhkEukv9JShvCWtYlTnR+DK3sTB3n8PY9gIbZEepuiS7a08D0RT5MX/AfYbSGvE0E7frJx3EOTWGxJz6jyFXghceyaQDHv9Q/kfXnbi753pOROL64lAf65euVjfKsDA7wgD4MHQGbbbFOkxRYMrOKLfUTgFIEDIV4jWlINR39F8H69nvSY3iYcaZe90Kx4sS1yOu7MRCi/oeioyXxd7WV0tQYraBwLP1+9hMNOdlssC+Y6GOBo53cEADcdICTeROcsndHIcjHo9CQZnYFqtEgIoGZ54ezcl5qsek2nonj9TQ/jUGkhmvOZ9//JlYsMr/sCddgoDvOsLGWNIGIW9gdOHV8LlstBoFzjPrlGAxmLBWdUjBIPzQ5OmrCqhvX2SQT9/V8vm8/HI8ZpfcqPIvMZXqSYmNJQejhQfTV8p820Fiofq7sUz5HZ75TpyoPJ2IYBGOJejMeIbBUw2r36I3WIjpDtQ3ilr7Oeq2Cw4TeC6qEG0Omq7X23Zw5uF8RDg8nM8gEuwD1ord6D6EYlCIw2getil+9koqLDzMmyozX/t0RjRfw74RQLRzUVPfesSkMrcED X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(396003)(346002)(136003)(39830400003)(366004)(376002)(6506007)(66946007)(36756003)(16526019)(186003)(66556008)(478600001)(5660300002)(2906002)(1076003)(66476007)(4326008)(86362001)(316002)(8676002)(52116002)(69590400012)(8936002)(107886003)(6512007)(83380400001)(956004)(2616005)(26005)(6486002)(6666004)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: Bl6r6Jx9nQqnITeXSLJwHF2Qnkf3qOOq+MD+wKgrIljf9ZhfWoVkVIIA9B2c9Bhqnrq0PIpV3huUvSH/7dHb50HK1vZnVmO1MwHMgRdcVsB16ZipWpR0iMvcRXxV7o7zKHY47L76Dcy7cHEX0UMrQrgUDhbVvzgGAZkYhBhyWj3b/cvjashAZiKQb6kN9fOVhWa2UwA+IZ9s3fl8sCjZ22XfmupRccL7d7pRG3sjipc0UjDUbmfrFpe93vgnxZqMa/eSJ0l6w4RxpFJGXt4poe/d94aqeUJcOgI4sl6hC5IETy/cnqf6pVCHw5h9Rr/3VJ74e+dWqGpr9vUhJbf3/jzFZZ7SH9PFUOFRpQFJEIpcb+rmxsO+ddB/SKxUcomaHwuAYR8kC59pSDp+AECd/jcFzzJRhvYKGUSK7gxlWEKEvHDRm4txSU63mzmJ7ooTLP0/05fMsO82Xn7WxKJ2dRNw1oW5AmvGak517xZrmoI+GL4+7hNe337yzH8lHVQyOSL9umndBMqQQiFXWh2p25AD90tg+RgX1oMNAE6QQIagEMIltiHnlpRSRljITjEYLBvSZO/UdBjGeW9vNtNYtQKK0mnn4iXkiHUP6sX0PSaNBd6MTjO2uaYOvR7yA3VEmKiNedPFEZAGpQbb4+glxzawu6mdKEB2/0DSw4q4WFmTnomRq4cNIaOPPFK2DXSOOO5PImerSwQgzh+z/3F0qePJ96A5FoboZ1HKAIaYXEKuAtZ6fSlcUm7hVURomZRaqSrM5h314p68xzecsi5nw8aeVs4QjZX33sHkY7wYUSmCpjFwL/FjpyEJYsBp8vOH/B35wOerTJD8maR0pzc1bweIDsoczT4SalUvDBAz13lITWXnN7XQ2QZtVfchYYUIGckNIUfh30uQwHfBxeTiMgGfYKHEyBWiMV/M+ht4LvzmmFH/s7NUS6QOLtllBPeMsWKlU0GoJzq2U0hTv8s0hJkKPXw7EIUkoIIAVidydBVhB2KgrgdNTu7dPMuqt5i6YGKIcbwdSD88rBJI0xe63PhHIFrqs0b78VSi8wu419RADv0OxPC+5s9Ogjti3VFJwy/1F3sSksulacDWz/s/iC+3l9AvbJJIJFPqQ+zpvsmpd98DBbeH3fikR1ebwpCCFBc9r1QbUHbtlEWvbN+4YZtcBI3F7ihkvxA23ssWTabnf69e5xJK9393OKD1BqFO57J86xwFbDpAhMbLiXWk+0sOKLlpMYtBKgL/KVELYUArKfRV/WPzx47vrGkCPquedyvL1QDeFYV4PeUDN+zqhy/DrHuooODCiOTEhiOd4G+pnkLnHBQsWBzCLC9OcAbh X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 882b5972-ef00-4a4a-c579-08d8df8cfcfd X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:13:10.7239 (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: UenX7neWxOQKVKiKF4zqwEx0ia55CaOn+VxmO6otGWE22l/mXa49cniVGCOZSeywZ42IXH61Dm2I3qwEiprh8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB6112 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Set the maximum ABS_MT_PRESSURE value and use the existing U16_MAX definition instead of a magic number to validate ABS_MT_POSITION_X and ABS_MT_POSITION_Y. Also use input_set_abs_params() rather than input_abs_set_max() to avoid having to call input_set_capability() separately. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 403e251a5e7d..2a4e048f1400 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -32,7 +32,6 @@ #define IQS5XX_NUM_RETRIES 10 #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 @@ -504,10 +503,6 @@ static int iqs5xx_axis_init(struct i2c_client *client) input->open = iqs5xx_open; input->close = iqs5xx_close; - input_set_capability(input, EV_ABS, ABS_MT_POSITION_X); - input_set_capability(input, EV_ABS, ABS_MT_POSITION_Y); - input_set_capability(input, EV_ABS, ABS_MT_PRESSURE); - input_set_drvdata(input, iqs5xx); iqs5xx->input = input; } @@ -520,26 +515,29 @@ static int iqs5xx_axis_init(struct i2c_client *client) if (error) return error; - input_abs_set_max(iqs5xx->input, ABS_MT_POSITION_X, max_x); - input_abs_set_max(iqs5xx->input, ABS_MT_POSITION_Y, max_y); + input_set_abs_params(iqs5xx->input, ABS_MT_POSITION_X, 0, max_x, 0, 0); + input_set_abs_params(iqs5xx->input, ABS_MT_POSITION_Y, 0, max_y, 0, 0); + input_set_abs_params(iqs5xx->input, ABS_MT_PRESSURE, 0, U16_MAX, 0, 0); touchscreen_parse_properties(iqs5xx->input, true, prop); - if (prop->max_x > IQS5XX_XY_RES_MAX) { - dev_err(&client->dev, "Invalid maximum x-coordinate: %u > %u\n", - prop->max_x, IQS5XX_XY_RES_MAX); + /* + * The device reserves 0xFFFF for coordinates that correspond to slots + * which are not in a state of touch. + */ + if (prop->max_x >= U16_MAX || prop->max_y >= U16_MAX) { + dev_err(&client->dev, "Invalid touchscreen size: %u*%u\n", + prop->max_x, prop->max_y); return -EINVAL; - } else if (prop->max_x != max_x) { + } + + if (prop->max_x != max_x) { error = iqs5xx_write_word(client, IQS5XX_X_RES, prop->max_x); if (error) return error; } - if (prop->max_y > IQS5XX_XY_RES_MAX) { - dev_err(&client->dev, "Invalid maximum y-coordinate: %u > %u\n", - prop->max_y, IQS5XX_XY_RES_MAX); - return -EINVAL; - } else if (prop->max_y != max_y) { + if (prop->max_y != max_y) { error = iqs5xx_write_word(client, IQS5XX_Y_RES, prop->max_y); if (error) return error; From patchwork Fri Mar 5 04:12:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 393899 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, 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 B4B99C433E6 for ; Fri, 5 Mar 2021 04:13:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9484164FF0 for ; Fri, 5 Mar 2021 04:13:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbhCEENU (ORCPT ); Thu, 4 Mar 2021 23:13:20 -0500 Received: from mail-dm6nam10hn2202.outbound.protection.outlook.com ([52.100.156.202]:44001 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEENT (ORCPT ); Thu, 4 Mar 2021 23:13:19 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ClS/kdLjeLtzqx/BYaQMZyyiFdkmPqbeTHBMJEQijboPGvrwmUAdcejaWJvkc6iAAur5VQSyr/03rLnDTyF5yGwmihRiiTsuvJz1qHnEV0P3CRY0IamyLjGUFoxmKH9dFYXhS43jaWEtuw2NhIo7BWD8h9cyBKSp0vrWRVvFz/FoFL9r1UQJQ1PdpUNZO1Rj5R2B/WhWEutYdSitUKdJU0p0gXMT2rsqcJcp86dMyoR/2BXXm7hytSwoMhYVNHHgRTtnAcEEGiddy6Buci6BairPPc4fzZl1neykNbzbb9BmETW4MgSqdHjzso6eDYL1h4ZrKfN+aHbUEkq/vFtSAw== 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=VdvVfMqijQu2EmQz2GIEDGyIBEN6ScSSyHS5qpYfOz0=; b=lr6qV5b1bh15qGzb4TIf88QBLP7blGjlq8Rn1YWrVTQDm4LTOVHhuZbjROrnYNhBSIapEydhzWPIGBVTsZOxlJIUjEHm1xkt9ykTNSmgURE1GdI09lwHZCCjqU63OCAeesxxKfYT/4V5V688bgZ0GCafAxL25sE5mQ4C12giGyfLgvoXZQVHrqDuBDdRQFvJhifo7Qji/BwS9/mzK1QD1045islBww5qHWUddTHQaR1Ft8h1BkoidvEMiGvT7qTuVYaukpyObR+TRXN2uolaizoqUGwUsoJNcvmFVn01EHTPp6SFpfzIabMaL2Kgr291ffulO+T4WuyeadZ3yPZiiw== 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=VdvVfMqijQu2EmQz2GIEDGyIBEN6ScSSyHS5qpYfOz0=; b=Q6nIitym4eDB5TxwJmtK2fbKkTrTi/+/DdxKHWEfx0H035nt1AC/DnxU6TTdCTD+9nsyayx+u2opDXO2cJz+HyYMaRj1INztDL+lZxYnDsLNHKyVWvpEwRtNEma4wdrqEtFJdIq5BwlcOQkPlXJY7wlVaNaM3XHH6aw7+uu72AQ= 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 SN6PR08MB6112.namprd08.prod.outlook.com (2603:10b6:805:f4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Fri, 5 Mar 2021 04:13:17 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:13:17 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 3/9] Input: iqs5xx - expose firmware revision to user space Date: Thu, 4 Mar 2021 22:12:30 -0600 Message-Id: <20210305041236.3489-4-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:13:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45c5e9d4-26ab-4451-881f-08d8df8d012f X-MS-TrafficTypeDiagnostic: SN6PR08MB6112: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pTCfHTYHprL/qHysFN5dMQykuTOP4guD+tC1krkwEF/XTsBcGFllM4OVl9Wmc4mWAjmUQKvTSLi8YfsbqL3bVvtw/gHbjoHNifDIg8Vye3D/z8uVZujfXQ1ZF0fqk9fIE07cVjsO8f5rJiw/IgqXkjM+XZNi+6jiNpZFcu7x5TB/2BKC7xlHaPRqWqlHY3Xwbg6oCwlVYN0E1VAVPj07QdOaq62qz1QHtfPPXlPRq5NPnzd/uH4+X284XeorYGHTksP/OeU5NnLyszdLOzX/iksLg/hk2kxsDfP86dnhqfF2oDlcwIMFAOphZtMcSUWhs+cSFWEDVMUJEvV9oKCI8RtkGSra414Wo4GkCuPKmPmergGYPFHQqMOkysMqx3agBCrFCo6fBqIgmKg4A2tPcI3EqTzVZBWsi4AVeV0UtkR7w9U60Hm2Qx7Gz6XDFW3/usUyRPiVZfu71xhXe+9Pvye8IzVkdy+HzR0Qj5Kk0hZf1coz0R6KPuQ0xZCgicGPvUDP7PNmbYvQo9aGuOkHjbrmMFquLwIGMdn40sA2iPR79vzgEdcwR1veAIVp8tZil34xCQaDD15L9LgX3nQJdAZRRTGYC9tXHhj7D4zSTkSp9IqMOq01mwQ8cbj8cCDvi8W665E4DUcT2gy32+J/89YBxBWzKrtwvtZnsApVimlVkckKJWvLdFMEIt2i198QBRLCsg+dXXQMUda0VCZAu+q6b0LZFGa//Z/A/1KEBLQyT9e4ZJb+Sx1falYLL/Vsyv/I7xG0DI3NlHitm4qLvmnHcy9LabPmTZQFmzJKk3DlVZo0vTW5c/+6KmuH9RC6j7RWtW+KMJpXUtqd8pvHtk18xEbYJ8lO05ypYv2HB2Dl+ssCwg7Kb+FLuxWf4IEzmCvgfYzvmCK73BSK2XBstNbdTAuJHhsK17UWjmTrz4XwD9PsaK+WmdYLz3ZixtcU X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(396003)(346002)(136003)(39830400003)(366004)(376002)(6506007)(66946007)(36756003)(16526019)(186003)(66556008)(478600001)(5660300002)(2906002)(1076003)(66476007)(4326008)(86362001)(316002)(8676002)(52116002)(69590400012)(8936002)(107886003)(6512007)(83380400001)(956004)(2616005)(26005)(6486002)(6666004)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: VzpW6Zd8zXAA44nnlgyHrktGVE7QT7gC+/rEOHNtSQP95fCXQeENc5b6DaDJZIAXU6JzYpoP3EPTdPH+aygW6zhNzMuOdRhTCrel3eTC4K3UJ+dlb4ReO9YIOZACpNUx48Hjr1Kk8NdwOC3o2n4MYMtcI/Dz4Amg7+C/HVzH1hjkEHh2S20uW/ru4QitNyDOyap11awLRox4oNxncMEfmC3w/JbVz5NNMv3LQciX6yco58D33PRP1Y+GtanelKWnKosh2K66mCKaWKDDAlS49IUYNYeLHfhBiA73VLVf/SWQ+DDRgguMqq82ZmKLmOC8SENpTRon9ETPMOLvOrOyUxv2x7EIcRefkbcIbCNV9nrr5ocV4sk8WyZoRhWGPp3DRKSKo4EztkhDztfnI9BdXE7JN+pe2g0qq0dBFGWE7mRnWPWCXCPuzTgYi88rs67lP7O29YimWfEwa5holRQoPwyDPlQ16MM11o1SMPsH96jFJAIgdDVk34irMdpFMHRzLXGPYmygOc/j9uZSxn6IBST5ad4fMbSyh2PlELZRqbij3evaT5i0HxGNVbFvjkgrOwtUpI3cDL7C34Ym7Ny4voNpmf0/qVlOoqeKb1rVKOHW9iuE66X8hlmv3EhX4zeOznbcOqfaPhPGISiwnp4utkhAIXvAN+VjYAptZjz4XWiDEFMeXvcUhPXJvzUuhNcIbASXxP29sSDa2uhaR6lK/qasY0ZzkpUmj+1RHsXJBKzNo5wiqGQYAo4GtyopgcsghBnQFViNPuxnLLwq7pFLM/T20msOKT9o42O/uwozUKAuNkLSWHJzGiVUdxz/NEx0dH6fvFGBssHNJFC4cIerQOo4Pv9wtEOzFQGSJHc+J4+g3ZvD30T7CuJDWKH69CiiadrLs2CAwRC/BID/7dRqARPqYq2WfDU+9iBhYAQDv37bReDNhnD1+ouyJZAwMR0GkwmLP7RdX9Qa4ikm7Arm2I8MN4aJ0e6HH8JgaZpyMLScHDHSyUFy80mUn8rKr4IU+WJnxllWrdwfUIy17jrNeiRG6XeCemEPGnzV+KAX7473dmeLBrq8w7itFDAASa7pPsinxMV2DvQ4c08vCna41VYc9naX1+WXpIAFMJ6WbSQHwgRqzQeyMCeflMzT1WyxUg5VCMbhlRM9TbHDgboJ9WT/mf/2VpRe466d7KsYeshxFWYyPmEvYXyv6G140UD4b/uWZA2ftZc5OJmtJ/mzFJpf1Mi4KI3tydntbWH8VX8hu+cJmNLS90dwDlgYI8fK3Q3FNOeTi8P12DgiGrEqIYRlvllzCG1ueitex93iX3Yx+M4Y1YhE/RmLxd0FkByG X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45c5e9d4-26ab-4451-881f-08d8df8d012f X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:13:17.7649 (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: ZhVS0QkUgFnbhFx1F9ohR3MG3iMYDWFdrwQjGVH5+u4EL/IsJP0K6yA3SqBIa2UjM5SRwWnvoqR8zM9lcCP+WA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB6112 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add the read-only 'fw_info' attribute which reports information about the device's firmware in the following format: a.b.c.d:e.f Where: a = Product number (e.g. 40 for IQS550) b = Project number (e.g. 15) c = Firmware revision (major) d = Firmware revision (minor) e = Customer-assigned exported file version (major) f = Customer-assigned exported file version (minor) As part of the corresponding rework to uses of 'bl_status', the IQS5XX_BL_STATUS_RESET definition is dropped with 0 used in its place instead. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 56 +++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 2a4e048f1400..f36d170e14b2 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -63,6 +63,7 @@ #define IQS5XX_SYS_CFG1 0x058F #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 @@ -86,22 +87,12 @@ #define IQS5XX_BL_CMD_CRC 0x03 #define IQS5XX_BL_BLK_LEN_MAX 64 #define IQS5XX_BL_ID 0x0200 -#define IQS5XX_BL_STATUS_RESET 0x00 #define IQS5XX_BL_STATUS_AVAIL 0xA5 #define IQS5XX_BL_STATUS_NONE 0xEE #define IQS5XX_BL_CRC_PASS 0x00 #define IQS5XX_BL_CRC_FAIL 0x01 #define IQS5XX_BL_ATTEMPTS 3 -struct iqs5xx_private { - struct i2c_client *client; - struct input_dev *input; - struct gpio_desc *reset_gpio; - struct touchscreen_properties prop; - struct mutex lock; - u8 bl_status; -}; - struct iqs5xx_dev_id_info { __be16 prod_num; __be16 proj_num; @@ -133,6 +124,16 @@ struct iqs5xx_status { struct iqs5xx_touch_data touch_data[IQS5XX_NUM_CONTACTS]; } __packed; +struct iqs5xx_private { + struct i2c_client *client; + struct input_dev *input; + struct gpio_desc *reset_gpio; + struct touchscreen_properties prop; + struct mutex lock; + struct iqs5xx_dev_id_info dev_id_info; + u8 exp_file[2]; +}; + static int iqs5xx_read_burst(struct i2c_client *client, u16 reg, void *val, u16 len) { @@ -445,7 +446,7 @@ static int iqs5xx_set_state(struct i2c_client *client, u8 state) struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client); int error1, error2; - if (iqs5xx->bl_status == IQS5XX_BL_STATUS_RESET) + if (!iqs5xx->dev_id_info.bl_status) return 0; mutex_lock(&iqs5xx->lock); @@ -615,6 +616,11 @@ static int iqs5xx_dev_init(struct i2c_client *client) return -EINVAL; } + error = iqs5xx_read_burst(client, IQS5XX_EXP_FILE, + iqs5xx->exp_file, sizeof(iqs5xx->exp_file)); + if (error) + return error; + error = iqs5xx_axis_init(client); if (error) return error; @@ -638,7 +644,7 @@ static int iqs5xx_dev_init(struct i2c_client *client) if (error) return error; - iqs5xx->bl_status = dev_id_info->bl_status; + iqs5xx->dev_id_info = *dev_id_info; /* * The following delay allows ATI to complete before the open and close @@ -664,7 +670,7 @@ static irqreturn_t iqs5xx_irq(int irq, void *data) * RDY output during bootloader mode. If the device operates outside of * bootloader mode, the input device is guaranteed to be allocated. */ - if (iqs5xx->bl_status == IQS5XX_BL_STATUS_RESET) + if (!iqs5xx->dev_id_info.bl_status) return IRQ_NONE; error = iqs5xx_read_burst(client, IQS5XX_SYS_INFO0, @@ -853,7 +859,7 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) int error, error_bl = 0; u8 *pmap; - if (iqs5xx->bl_status == IQS5XX_BL_STATUS_NONE) + if (iqs5xx->dev_id_info.bl_status == IQS5XX_BL_STATUS_NONE) return -EPERM; pmap = kzalloc(IQS5XX_PMAP_LEN, GFP_KERNEL); @@ -873,7 +879,7 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) */ disable_irq(client->irq); - iqs5xx->bl_status = IQS5XX_BL_STATUS_RESET; + iqs5xx->dev_id_info.bl_status = 0; error = iqs5xx_bl_cmd(client, IQS5XX_BL_CMD_VER, 0); if (error) { @@ -906,7 +912,7 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) error_bl = error; error = iqs5xx_dev_init(client); - if (!error && iqs5xx->bl_status == IQS5XX_BL_STATUS_RESET) + if (!error && !iqs5xx->dev_id_info.bl_status) error = -EINVAL; enable_irq(client->irq); @@ -966,10 +972,28 @@ static ssize_t fw_file_store(struct device *dev, return count; } +static ssize_t fw_info_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); + + if (!iqs5xx->dev_id_info.bl_status) + return -ENODATA; + + return scnprintf(buf, PAGE_SIZE, "%u.%u.%u.%u:%u.%u\n", + be16_to_cpu(iqs5xx->dev_id_info.prod_num), + be16_to_cpu(iqs5xx->dev_id_info.proj_num), + iqs5xx->dev_id_info.major_ver, + iqs5xx->dev_id_info.minor_ver, + iqs5xx->exp_file[0], iqs5xx->exp_file[1]); +} + static DEVICE_ATTR_WO(fw_file); +static DEVICE_ATTR_RO(fw_info); static struct attribute *iqs5xx_attrs[] = { &dev_attr_fw_file.attr, + &dev_attr_fw_info.attr, NULL, }; From patchwork Fri Mar 5 04:12:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 394758 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.7 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=unavailable 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 6AC13C433E6 for ; Fri, 5 Mar 2021 04:13:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4124464FF0 for ; Fri, 5 Mar 2021 04:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbhCEEN0 (ORCPT ); Thu, 4 Mar 2021 23:13:26 -0500 Received: from mail-bgr052100133092.outbound.protection.outlook.com ([52.100.133.92]:30274 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEEN0 (ORCPT ); Thu, 4 Mar 2021 23:13:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hg/dZiFF+98puiH35cGzLujcKXOvxq1oBzEjYerz2zrPTd/SiN8dOsRl3d0uToukA6hWIWmokQPXrZI4sEiQOTk930i0JmfxrSWcbytsNRsoVIYbVHX7fOq8iQ3BpCyCAwd11ng7L2c8PP/YfZT9cayY87qURB1BcBuQIk9ATyiVbQDFME6+3S2/Yo93TxTuEnHWujcLnP8QiDK0ceCQmCFazTtXmGxbup724/hELDN05gU3rD2XDlMIOS/CYrC5Gv38Fa6PTz5mGbwIaOg6Wf0GUCDQ1ppOJIP5oqoljEYIGT40uQnR6gGKjU9t9Gn1Ho36yYsc7EaixMbFCfdw1A== 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=IKp4kIfCiH8iW2z3YhoiABu/r3H+nf18znDksJIo3gI=; b=YMVAWWWh4l9RWS5i2DnUJ4bX2LXQjEzwb6sjR/oMgLfw5F/Cby/1APQ4GWJzbpJvHhPr6+BHsDOQ/7jm4UFy0O0ormhMQIivX2IuoeO1vvhh7oSau+3uv+b5e98TLohN5GvBBQowZYmbanB++kbk0OlG4utNQW3LstAPql3GmEcGoxnW80/IW2D9KPmBrYbQ8DqRkpjUaa4t9BSMggfI1cJxva7aJwEl1JcMKvJEgai0Zb7sdqQlkxGzC+ayAxJaQPAe1GUG/d4B6UkWIhpUuy9Bgi35qbIMreVhUoaxxWfVo10Wj5Wu0UAthx3yAXoeVeASfh3q9gavoBAmU0HGlQ== 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=IKp4kIfCiH8iW2z3YhoiABu/r3H+nf18znDksJIo3gI=; b=zkPb9Jog5b1NyI+OT2yh1YLTocDIZTxIc0eX+zH0nrE+KGtG1vn/TL4QeYOoWud2fVsJ9gXDbQM0qdQPJtV8eXV/cHwbLsVnzSKtYOmZZ7ezJYsJ5OSZNjlGOOgi0meVYiB8yS2Q5m238fD8FIefwbYcHxftB5G7+3Ixj8CQbX8= 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 SN6PR08MB5693.namprd08.prod.outlook.com (2603:10b6:805:f8::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.25; Fri, 5 Mar 2021 04:13:24 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:13:24 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 4/9] Input: iqs5xx - remove superfluous revision validation Date: Thu, 4 Mar 2021 22:12:31 -0600 Message-Id: <20210305041236.3489-5-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:13:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af26885d-96d2-4faf-911d-08d8df8d0553 X-MS-TrafficTypeDiagnostic: SN6PR08MB5693: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wby8WSAzVrRverR8rljg08c0QsATiHVOF/trY+yri5FR/AFSO1FNQWJd4IkN61Ca/wO0Xm2SBqQ0VAVqxmML2QEvyEaWWVh39e/bNw2lHncKzGHf5p8YAShg7+9SoZLot2NJouNINWPXb7w291LKcXIMsqWOQ6o7BwXACO5EG2CNY6FOhkZdimiewr+VSIJEvH3CZzCcpzDZxF1yUX74BAtgVKaxhhAzCpD4s4BoVB8IIESoRnOPmz5TjIqza11Y3Ghy0UR8uvnPVT+R4I6VpsCIdUSPDOneabOvI9AUjyYP2lSRpwKjOmyYum03X3/QyWPR/H1MMMWKmrY31lEBbBvLNByGjHfT3vqel4icFIjlsLBOJVrpJco6MBJt/NxfObcf4n7/Cq+GwAaeWU9tSu9F6bNTNDtOgJBh5Q8JQ5q+/1g+WKJTwd4hKNbjnKjoK4RtU0vzJ44z62Ak353vxZkEElRp/fiJI/Xrju7zsuyU8LUCA2HJ4xcgYRCPuSr3+MQofRgintZlknGi1j56U7uUw5Ay71eD85Y/6HQKvjvq2SJu3LWNFg2Aci8/s1UMBH3kp9hE77+00b9na4uih8wn9SgcHsLlBPf0Xmzusze5iBthucTnFqAhfXe3oG/MFmms782L3TU7nGn4PrUfypBBRXIKmbEfQbUVkmNo+hLjRG0V/pengvHbL/K6Vw1ARFvsNTCOK+wFjaZ5KoRMgR13BUyynC2uFUPxw95z1IAdDgoOKrMRXR9FqMGL4UqvnivbiG0O5shXwF/ImBWOLZJcswCX2tJHMbWdTdOhf3ZMGKJ1HvSIPr9DhVWNoTnXgQ+l3TYuk2rntIkmtzc/WzlsMYYM52TA9Jh0bK07mb0RZz6GQHPdZEKllsbMZY9KsbfNR+FzLKH8PCCHYpP/F0BTlKg99xyJF7JampzqDKHbw0/x0juZp2VHEi2Sen+w X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(396003)(366004)(136003)(376002)(346002)(39830400003)(16526019)(66476007)(8936002)(956004)(5660300002)(478600001)(36756003)(2616005)(107886003)(6486002)(8676002)(66946007)(69590400012)(52116002)(186003)(26005)(66556008)(6666004)(6512007)(83380400001)(86362001)(4326008)(2906002)(6506007)(1076003)(316002)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: Bv9n3jbYxm8QFB+iFxLFkPJVPS+VJZYBcyYfrdv02tJcin8BsQq1vcgkUZTpQT53qU/hDlembX6QHNy3chy5FMMfhsAdV/7sS6BDzjmXxgj+U+1LVWqWrGzo59KPfRbB2oyX6DC9nnI2lQPTUTXqtG4CDt8gd1XNonrNNmEy+2X8hr2+ImyXxdh8kfuxoxF9eEMJap1mveZ7HNdbpCwhjzrlgyps86d/qN44vJBGk7ALsEdYBHsR1bVZnopAgfihmpaMDzjebXOLv7wnCjN/AdVh2yvymhYTdz6Yc28u+jE5b0aDaXvOL0135qLiFSpx0QrT9WO6Uh8y5BjAR/3LCHfsK3l0iop/GZbvF61otux2IZIc/ZoRJSX4EpuTTKvNFBqwW3QUFbvzl1671hIw0hRP3GLP53HaqyWNUGb39KVFHr23DTF6f6ztG+7LtH3RKXLV2f7Gzs/nwQM2+dLLZF8U1my+AD8cCWFCCdO8Al7Ig+SesTl7fw9l2rFk2ZT8eyJE9yGSn8jNfz33ey84NbaY+vL0V6s0u81z+T10y32vD/f1ZFxVHJvGn7nTnMCosZy7Ccbw7rh9TCc3wppjbqdeSXyA4ljOXxI5nvDDDahzaLe+glTNWrm8FjMoFIsBfrg4vths6238oPUFPcXASQ+qHXg2mHRFsOJ+aW3tCEw51POfyU4uUNAytzTliyIzcvSkLGluoBOMHRhuhSsWNA0/qpCfDyfVvOHIgiZVoiLnxWg5a8h8Vht5x5yf3s8pZHyfyxF+2O0lCQq+E21+ZudDCQoKAp82V/2dRbJ13pD4z2HQfFGug+V7+kaBheFjdCEDOzEthmyy8glGXRNdCtf7hl0p/YHRLXbIt1DlsoGwCNihh/krxvaxvS224lWHqtymRpW+OUu72WL4U1g7gFqlhLY5vE86zIgzf0WobgyVe9v1yxhaB2vdsCVStsrRqI+0rW2xn81t4n8TrXP2vGbtpFuuK58cUVZ6kP8H/ObjGYmcE8YgjxUeO2cTsO0kaaz7bwBKBeVAvUl6WwnCbU8mwUXqaAmRLIeWYXZ6hxGqqpLTzldE/iPNAxZZR31A5zPQtX0QOJ4wBC+KcEgBV/kfIPLjJ/JKwriNkU1xQCFPt9N0DALuf+EeJtR9hSrx+qI2YGf+3ZBQy9th7zo/9uz4I2gSVCZClq/sbNQxG/kJAxP0MeVegCIWyvnoEy9h5kY9p1Gu5/XVLvF/JsdL9S2056wjR4UgUxiqiT2QU3VFSs4rbGNwGx0mIQ67JIn7BxLX4B4Ew+XXMqlUskfx+iNJeemSmKh3FvCujPnkfpw5bVg6hQo2sfk8n3moe6cP X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: af26885d-96d2-4faf-911d-08d8df8d0553 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:13:24.7289 (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: +oyHCeZr8UpRO8C0Vpy88Q298a9VAM9dVJYHtISzdCJitsdaQxUEjuLTFxKWtf9473UxG5oYHc+TBXeB32uStw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5693 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The vendor-assigned firmware project number is restricted to the generic project number (15); however the vendor may assign other project numbers to specific applications and customers. These custom project numbers may be based on forwards-compatible firmware revision 1.x. However, the driver unnecessarily rejects anything older than firmware revision 2.0. To support other applications, remove these unnecessarily strict checks and enter the bootloader only for truly incompatible A000 devices. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 40 ++++++------------------------ 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index f36d170e14b2..0920516124c7 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -36,9 +36,6 @@ #define IQS5XX_PROD_NUM_IQS550 40 #define IQS5XX_PROD_NUM_IQS572 58 #define IQS5XX_PROD_NUM_IQS525 52 -#define IQS5XX_PROJ_NUM_A000 0 -#define IQS5XX_PROJ_NUM_B000 15 -#define IQS5XX_MAJOR_VER_MIN 2 #define IQS5XX_SHOW_RESET BIT(7) #define IQS5XX_ACK_RESET BIT(7) @@ -87,7 +84,6 @@ #define IQS5XX_BL_CMD_CRC 0x03 #define IQS5XX_BL_BLK_LEN_MAX 64 #define IQS5XX_BL_ID 0x0200 -#define IQS5XX_BL_STATUS_AVAIL 0xA5 #define IQS5XX_BL_STATUS_NONE 0xEE #define IQS5XX_BL_CRC_PASS 0x00 #define IQS5XX_BL_CRC_FAIL 0x01 @@ -573,7 +569,7 @@ static int iqs5xx_dev_init(struct i2c_client *client) * the missing zero is prepended). */ buf[0] = 0; - dev_id_info = (struct iqs5xx_dev_id_info *)&buf[(buf[1] > 0) ? 0 : 1]; + dev_id_info = (struct iqs5xx_dev_id_info *)&buf[buf[1] ? 0 : 1]; switch (be16_to_cpu(dev_id_info->prod_num)) { case IQS5XX_PROD_NUM_IQS550: @@ -586,36 +582,16 @@ static int iqs5xx_dev_init(struct i2c_client *client) return -EINVAL; } - switch (be16_to_cpu(dev_id_info->proj_num)) { - case IQS5XX_PROJ_NUM_A000: - dev_err(&client->dev, "Unsupported project number: %u\n", - be16_to_cpu(dev_id_info->proj_num)); - return iqs5xx_bl_open(client); - case IQS5XX_PROJ_NUM_B000: - break; - default: - dev_err(&client->dev, "Unrecognized project number: %u\n", - be16_to_cpu(dev_id_info->proj_num)); - return -EINVAL; - } - - if (dev_id_info->major_ver < IQS5XX_MAJOR_VER_MIN) { - dev_err(&client->dev, "Unsupported major version: %u\n", - dev_id_info->major_ver); + /* + * With the product number recognized yet shifted by one byte, open the + * bootloader and wait for user space to convert the A000 device into a + * B000 device via new firmware. + */ + if (buf[1]) { + dev_err(&client->dev, "Opening bootloader for A000 device\n"); return iqs5xx_bl_open(client); } - switch (dev_id_info->bl_status) { - case IQS5XX_BL_STATUS_AVAIL: - case IQS5XX_BL_STATUS_NONE: - break; - default: - dev_err(&client->dev, - "Unrecognized bootloader status: 0x%02X\n", - dev_id_info->bl_status); - return -EINVAL; - } - error = iqs5xx_read_burst(client, IQS5XX_EXP_FILE, iqs5xx->exp_file, sizeof(iqs5xx->exp_file)); if (error) From patchwork Fri Mar 5 04:12:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 393898 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.7 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 12B10C433DB for ; Fri, 5 Mar 2021 04:13:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E10606500C for ; Fri, 5 Mar 2021 04:13:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbhCEENf (ORCPT ); Thu, 4 Mar 2021 23:13:35 -0500 Received: from mail-bgr052100132053.outbound.protection.outlook.com ([52.100.132.53]:24225 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEENe (ORCPT ); Thu, 4 Mar 2021 23:13:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dyL53t5WX2LQgqTk2tA6xAErnlIsO9N0ShjagHiDw0Y6VIOU+Zrus+FYyzTw4XrHz6p97vd9dgZaiL4l4Oq99L2DHV10BrjsJjmGXqj/fi6LumNyvGelbmDuqVEDxvnjE6j0jj0TswU5VqeDtDH/O4XzcTtUIRbetluHjxm9sYPCQZyy7UjeM6llAw/kk1bql4UtPwTzGu1XWxGRVdf+RfvKeIMpt+CWkBRx4QeQzHiwmG0cPkWmZlgGvs5NMHIN/YAYH1MK0VBgBoM+Ctyj0iMZVFEvY+ZyeLoII9ccBzfup4MaXA+iZH1RMiHbqvO36o5e6h+ga2ixk1XAwqpU5Q== 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=8D+UT2IFzOxDSL/Q40XgaeNqzzFUQ/MxHzASLZJ8g7M=; b=XlMBgXaFLVUAN4E3FbpSZFWQSSolJwXoP77hgeYxfhLh45qTl/wzpI99qMY2UHmPWE6k4IegR5uj16iZwxJL45aJnNqrRhI5IZMPLER30HVS7BQJMec1l3yCSqmtVPUHYVPMX1U5bDz8kgWYCLfHzbkf/Nbo9xrGvJHIyGq/utdY1nx8u2stwZXt2hTL1dL1zxC8+ZJvAQVpIh7Efd+vtLvm+ijw78WyvYea7uyvFOb2bNB45w6Qcn86mtfl1y7CmaSOobDsMuA7CGirjW4ihYsii+gjAyX2UyG6A3hQAIKnWLLfRJFni/1KyNwyHXuSdgkG7k9kZxvVI+8nRZ6xpQ== 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=8D+UT2IFzOxDSL/Q40XgaeNqzzFUQ/MxHzASLZJ8g7M=; b=WKv4DcjVaKN+gbR5hmlw9RBjb+iU1BeCP3yfElT5xILRPdaINjbget3yJAFdcqo/8xL3qIwhVgicGsu3rfTRUKodsV642P5UUyYZ7hM2t37jlgUz+wYUgqnHZ01mxjZOc27gO1Ndv3ul6Dq++1ghrJaI097Hirgm72YYf7ld7qo= 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 SN6PR08MB5693.namprd08.prod.outlook.com (2603:10b6:805:f8::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.25; Fri, 5 Mar 2021 04:13:31 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:13:31 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 5/9] Input: iqs5xx - close bootloader using hardware reset Date: Thu, 4 Mar 2021 22:12:32 -0600 Message-Id: <20210305041236.3489-6-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:13:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c95a6bcb-b08c-4a53-55a0-08d8df8d096a X-MS-TrafficTypeDiagnostic: SN6PR08MB5693: 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: apErGGJ9ypm5RfhXCgWzUNCqXh3DiP8CpovLtgMJyCV/qDOgEVMXqFJ7khz3gycCXu4AdJhF5eGJMVJqiEG442amT8z7dKETGvefkFVwd1s2B0rqvVH4zw5kEUu3sCNVLLlE4NRDUiSxNHBJiKyis5e8i/Nypzy8TJdxLFjSrvAc2NSo/tza/ALFQYXNrbZsOgett4VtEV+QI3k8DMQex9WWnWVSITVeKLL1ATMuyhcc7F83f1+x6XNUcJ90my0Yp3q1+QgsiqzigmfYoI860UQ0KYMPorEQoqRyDLGRWMHko+4lri7+UOSoHaAfnBYmLYv2+tyXrgDydpcGgnBhAz9ppQyOTx5mVbH/oCjhMgHf5iQW6yRgEbYivWDiU60e4mPY3DJiU+zyphm26wv5dSZRnlWeCzQodokkYsf/sL3yDcBKLg0hqDsqKNARIM2ucq92BiIldQsDRpKoBbRC5mHj4alqfHs1xq/YZX2jUBK/omWihEYTXFsocnVMlTrddoyzj2dqmp3WJVL6QaTpI9pQnZyTe0kaySicxUSEqDTrSguBVAAdFO1yTp0gUoud0TRwjiFMH0MZyE+rGZzbresKR6yVPQU0jdF+uVQTwFyE+SD59wAJ7ANjffS2XPSGZwjirkUqYCOCLUYJUKCJhlh07wVK7ifH8macRP0ecwRveLnmJLYBWfZuEeY6Ndud2q95fgx2efQmYY+4G7yCVxuuxVdvO942CEZHWO5XIzX/bOfsk8fDCx4qTyeOZZMoQQtZYqY/EoAoTFlk1KO4WjudZQYHVWwlZF04/ucqv9b6J/JGOwkXMbArIvtEU+ds1jxjasIK6kdwDlsT3ebIASbw2iRcriqB4NCwU1fToYJFrPifN+xbJaYXQfn3Q3GvT84dDdYkzr8fxbl7bi1Eux65zFbF8O7qBWBRspXYPd4dJnApT/jJdkv5XjYFMWkx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(396003)(366004)(136003)(376002)(346002)(39830400003)(16526019)(66476007)(8936002)(956004)(5660300002)(478600001)(36756003)(2616005)(107886003)(6486002)(8676002)(66946007)(69590400012)(52116002)(186003)(26005)(66556008)(6512007)(83380400001)(86362001)(4326008)(2906002)(6506007)(1076003)(316002)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: wS7hEmajC9AGlOekk3U8KcLr//PW7JSwHC+YbNz/EIF68ohrQFuNfIIANKeG8PafJjsQnlGOF0gZoZ8ARmT8FnrSJKOYMj9naS1PNu5CuE4KxmKFrP0x2EjOQuYgAeBuy1BbmmubDbsbY2wy6VnwXDssnevHuMa3PYqpT+DM9bhR1nIlheRzRhmwj2qag1plmZ3Zj5tb22Ac8eeS2PI3JZ3hD18jp1hVPnSX3kMN4ibMN5Ocm9mFQz6m5s7Pl6lUFkMUvJhYE79rXsOVvZeNfqiS7dgVz4SMoj6/MPyjwS/nqrgkJAgiviEl+FQSFcp9Xdqs3Jv1ufv1X1KQMGN5iIRnOi8FAqH+HBkzf6LBBtboh8ITLsmBtCf7q6NK1o0bRKsboSxVtLPLjObQ03xp2+f6/qE/ayhGlqEc6kOE3LuvuMgiFbiIaJ3SWJdvD1p28bUnqr2ThCuSgwk/9y4hod0LmCdqCYdiX2Pni3feYiXle/ixHhWBQIEB6jNT2LnPb7HflwKq41vMzNPTduuxlum3C/0o2fuggWHMMtQ9ilo8JAwXoV4SNdS79uq8qRPfMaP9kbOWt3fAM4v4t9C4c9XIqR6AiDQi9Cf9mbZS74gKkbD5N0nKSNMMKf/pw+bwInnAGEvrpok7ZQvKsVyVEsZFWw6DZy5/GXG/m9C6fqeQGi74gjnXVz+if6CPI/iUgFglkxC1NXojn7OPmXyopfYgsrOD8xYAbkmd0a7ZgPWW85JbITmdhZLzZNSJxGLZDpRNnmDouG6wTnFIzTWFlgSuQRm6CCDSaucMsuPDCioGtl0iCcsxjJXmEg9BD8ARmNf6LirmcdMeRaHhTNJ/7w+zmkCXeUjEtaXRERs5ibOWihSUaxC/zn+aJItdIuBnclgePEnu7d3iKGY0YCjy8r/ir6o56lRmm+16SdKkmQlMY+U/EgNmSDnObQldhQah7hu3ujx++994OfEiCwMg5+619LtFA0H9nEMF7dSHcXurjCeXK0T6e/1Iyw6WX14c/019CcbHeLVShw/FZnTV3YujWAkOX/JBshv8m074g0zFW9t7tneSqHCbk4nd+UWO3hEWqJ3gsqsLUu6FfZ8E/EECcfyHjSYWLmWr2Gf79/iZnZLLo+U6Y7sdauZfNwiEIXBaWNnmL5V/ggdM5xTPo4Dy5f34N7LEA612DBAi99+GuZig1B7ANiwspzR1Nv4apsRyUn8n07pmW681pnB2gtufxPhbwchUZWgwDCMk+MaTm+DeBKM46dBV4OFznwYwAmEufppoIwePipqdO3BWVUi1f2MkN8dWENySJOf/H49z4/E0IL1IICKYG4fEhvMG X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: c95a6bcb-b08c-4a53-55a0-08d8df8d096a X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:13:31.5930 (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: 7xB7y7XVUhwSHVPr1JNUVWYkgi23u3VBumayPBlZALrX/3h4EpAS/7tJfFob19PqKGfbuyldNfnL72+ZBIegtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5693 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The bootloader can be closed using the 'execute' command (0x02) or hardware reset. Rather than using the former option for successful firmware update procedures and reserving the latter for recovering the device upon failure, simply use hardware reset for all cases. The post-bootloader initialization delay increases marginally when triggered by a hardware reset, so increase the wait time to ensure the device does not subsequently fail to respond. As part of this change, refactor the return path to avoid an extra assignment and to make the logic a bit smaller. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 0920516124c7..a990c176abf7 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -832,7 +832,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, error_bl = 0; + int error, error_init = 0; u8 *pmap; if (iqs5xx->dev_id_info.bl_status == IQS5XX_BL_STATUS_NONE) @@ -875,21 +875,14 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) error = iqs5xx_bl_verify(client, IQS5XX_CSTM, pmap + IQS5XX_CHKSM_LEN + IQS5XX_APP_LEN, IQS5XX_CSTM_LEN); - if (error) - goto err_reset; - - error = iqs5xx_bl_cmd(client, IQS5XX_BL_CMD_EXEC, 0); err_reset: - if (error) { - iqs5xx_reset(client); - usleep_range(10000, 10100); - } + iqs5xx_reset(client); + usleep_range(15000, 15100); - error_bl = error; - error = iqs5xx_dev_init(client); - if (!error && !iqs5xx->dev_id_info.bl_status) - error = -EINVAL; + error_init = iqs5xx_dev_init(client); + if (!iqs5xx->dev_id_info.bl_status) + error_init = error_init ? : -EINVAL; enable_irq(client->irq); @@ -898,10 +891,7 @@ 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; + return error ? : error_init; } static ssize_t fw_file_store(struct device *dev, From patchwork Fri Mar 5 04:12:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 394757 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.7 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=unavailable 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 39E44C433E0 for ; Fri, 5 Mar 2021 04:13:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C8F16500D for ; Fri, 5 Mar 2021 04:13:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbhCEENl (ORCPT ); Thu, 4 Mar 2021 23:13:41 -0500 Received: from mail-bgr052100132104.outbound.protection.outlook.com ([52.100.132.104]:13457 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEENl (ORCPT ); Thu, 4 Mar 2021 23:13:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CtiRTyr/yNYrqXEwtwXYAUyTim279UMAqkrSPuf/b87CRJXY1TthNS762DHbPKfG2Q8ep+rgBZnVlsWWbaQpOmn4nXWO0E9A/g+PNr4SrvrQhM8NBcH5wAvWZWMQ61wEgr3S0yvQ8HEaycGrOWPLtPmYzW5fw8QrzpiW+lUGX0aEX0t2/NLDCkT1qBWuv2VoktT7jD4ZX7yf0had/Lj8x1wjeiVY8pkxcdt+0DlFSL85Fzfv3tA1qlihTA5OiE2D9BvovzPZQdd3+MdN1DCN0q2kaA/H/LdMRnL8/UgpnU8nX5pIucvPCK6LN8OQfaq2zru5RABKDdfxdRx80nWfSQ== 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=MEue8z/MZFPnMP7mM2eVbTVWx/pEhRGNYr1fU0aF22c=; b=gfgr09PT6o51wnYpJidWkPEfFbpekRWkBzuekvULs5qxE/xSKg8GXTIl5QcmyY4uP6w/ucPNmNuJKa9Lh0c+4NibXwDZmUrv9YH98kOZyNSen59X3UjWZDp+lyg3PIKbanqF1/I49MEYoJ7lcTB6ucJoQgK1Y8D18nUqMoPxXiiacTnI2+Zi7Mkm3YNyyydXVvugJ69huZd4P9M/oVQSqhySR4lRr7eSbpSPN7qR0Y4XjPmG5AK9fCDdp9MLccNHb0KkokcyX8/sPyFJEtHy3C60b2ScDltp6wWzPDCVdgK1HPPodDlC9eEup3sMpQtTqx29gOuzZqc1KOqp6NXtug== 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=MEue8z/MZFPnMP7mM2eVbTVWx/pEhRGNYr1fU0aF22c=; b=a7AcSfhpknVVt0SLy6JHb8fg/oy9CBkTsDHBxSplhV9T4cDZYc3QzFaxmXigYeI9sOrm5iQMrSu88PMeP5QOZcxMfr5kAwfEsgleEDrDlyDGtThaiE4OiJgePduSLd8yhNjsNuyF7h9obuc5FDFgRqd58b6hWB9pQkbqESRiY8k= 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 SN6PR08MB5693.namprd08.prod.outlook.com (2603:10b6:805:f8::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.25; Fri, 5 Mar 2021 04:13:40 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:13:40 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 6/9] Input: iqs5xx - prevent interrupt storm during removal Date: Thu, 4 Mar 2021 22:12:33 -0600 Message-Id: <20210305041236.3489-7-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:13:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 429625b5-256f-4e7c-617c-08d8df8d0e5e X-MS-TrafficTypeDiagnostic: SN6PR08MB5693: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vHixWAtKlxy8fKgYJHgLiZVzCLPret+deEZs0jzRa81KfiD91pjzNpTQA2C/8MY5V2NEENMseXSOJ6IRV1nIWBxtq5d8DJE6TGNWivDCL1L7n+SeRHGhlWCqa/KgThQ2day6701l2Kbz3xdXWWI/fGycyf9i4pdqs93AgKW1CKaTzNyzXjysbbQrSiGwwLJ4SX6S1fFu7eOjjltF10dZ7SKooHxnWvKvuGzcAUXptV/deTJSgYq93dy28OBFotd/c9z3lWppfjA9LcHdDFlCAQypBe+0UXz+OekaBnCqiIyn3UAGRedfDikpTgE2JvRYiXDRz8VT4EwiSN/f/h9R3phDb/XGF97xKmjjHhyXdYU9PhR7wwWJSL66Tx9Xds62w1hSCJqLKToIe9gaNRlg9yGg1SIaSQWztJcqMBa1ITAoasM3p8OFd1YG/gJHXQzCxda6zSg9C0E/1NuVbf9f2sZcLyuURfINNX7yhqSsxuoZxruv5Ccy3qKZbQQmzQbaWgGy50GhQgMWTT3zysy9oHkh9HuvcNHSar8AFnd6Py7gOSeQntO6klyQw9UnGsvWqOjDPpmVV004dxthKtUUNjaveMzx9ybi0fIsfY9g7TLGHpEpE2zfk+LT9o4fTd+fwQoIc6cNOVshPL4JfxlDfxSIZ3JqbfIJBL0gU5bWNsA57mr67AIyOYfD4Ulb5tfctTspaLoNHDHjfuBSfJwtte2nF7aKwvdxLsfeClFg+ouY8FXUkDbffyLbKVxcksSMytRuza65XeHOk3VrTVSSp/DgJuUjVvjkcQ3T9/aa8KpmlosE3pAZMymj9lSBqx7tmbm6DVWkdcx+bNN1H0eJxfO5y8u/CuW3jkJZl58KO3ccaUBLx3O9ZLXqT6aSDfEXSfzjz1CuYF0nIJ17NXykMY3S72X46PpwXDL59BiqDyy57BxkDvxJ3NAGQZYjt6Y6 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(396003)(366004)(136003)(376002)(346002)(39830400003)(16526019)(66476007)(8936002)(956004)(5660300002)(36756003)(2616005)(107886003)(6486002)(8676002)(66946007)(69590400012)(52116002)(508600001)(186003)(26005)(66556008)(6666004)(6512007)(83380400001)(86362001)(4326008)(2906002)(6506007)(1076003)(316002)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: RQlXIhn4MvJakEjWZK5sWs3d1KYChZXKhS13MgOCCp95WllZ/FDj8p7dA5uh9ZLZwljUatpMBzE0YF2aG1zTvMyMhdxgeKzgniXTuE2yiL0ou+DRd0+xurokqDsugtppBqA8d13QckHh2WBZyLSWbxngEVHSsW4u5CfEN+whbheXsuNZ0DaE1fuIGUSeqUox1h+KSawbcL3+y2kfjJUWUDArOGpPoUc8ZMCETdX0LW4ARtGlT84Nom2O89t0g8Qqjf9SjRcQMNXcTXmBQZduibNPBOXBLkMH+IfjxvMBZhEYELeTIsx66hMIxy538aVGZVynm2atW3hb1AWU8o0ffB2cGJVFbUIeaRI9XX9u1iddyNtVg+/SY9FORn5Ff9kzH400tnTmwSEs6XSUNT9Azg7geww5gVDFAePczfknNR2K6hjysgLNghiG5KuYAo8jJOEwD+OpPNKisK/hSp6h93/W0Zb81sLzSm6WHfEHBfLooIcSCTRY2DoPcoNXtgNkj3jpiB6mW1YJqiq9IDqbxOzWDZIXwS1EAO0+Jea3Y0PnuE0l/0egtOQvwAhDCcZmMfJJx3CMBcR7V/xuVKB56Knxy0zap+EgLa/W2GXGq28F60PaHErARWR3cuFZbwl4eYU1uEvcihlHDeXBnrlcRFPzSD4zT0X91ix0E7ZCGo4PB5+MSyGl4RTuM70U97IEUoL3zwg1sGAronGMjj9Yjh0CKgxx9yvHzLoOuQ9i/96L0NXQocpgBLkSk5RZsSIXEKFzMFTbzc631Fo8ZlRFGEvrmzsYdxsLuzUF+HMjUCQSuC2n6yiHQs1OnbGsN7KbQJgen0rsXn7InvUDYX8/ozQmFX2YmvHIbrZ8iOxFMJD8VmsIBVuVjKOy8vz4ez5b7UIXAYr2E0kG9MyTMsyAF44NXt0Uz5cPHgtUvSSZc47lGxLOYA3+xd8vD90LvX+I1YRDCl/U5FL0vT6Z0pD7OPunkC2LIsRFL81qD74B5/+ec91BAokNKi1MeWBxswn8a/fuMRybS+NOhpBxF4ncGTPOJGRZTvdPd9eQw/DG4yd2GBMX9bDj+0sLKq89krfaAuCA+a33O9BeFspY+EBXlxGLwNqiXh3QCfu+d/viVqXgYDBuQAKG/gf3jLkBKNf9EPAzHC4gTLCg6kywoTQrUwT4QYZwNoK7QLPPSu6DxwhMVZLkM5fzozC4C0YBJMLLI8KRjb8z4vWzhDxJ2/Y4ZBQSRQSKIeoHk16ZKmHOS7gkbZByOuNHAkp61kdhDngPN4abq/4AlXurdBCnz5Ar81j0XH48ElvnAyNuhWPYZSrFD1Gj6hhJR8Tzoyt2GCaD X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 429625b5-256f-4e7c-617c-08d8df8d0e5e X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:13:39.8923 (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: DIaRkArvnVFS05acIR9H9ys0VkvMQD2+JgjTsfpJTKilh2+gk463dZznetRu3YG5WUQsTS+EfqHfFZ/3QdcTrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5693 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Unsolicited I2C communication causes the device to assert an interrupt; as such the IRQ is disabled before any registers are written in iqs5xx_open() and iqs5xx_close(). After the driver is unloaded, however, i2c_device_remove() sets the IRQ to zero before any handlers may call input_close_device() while the device is unregistered. This keeps iqs5xx_close() from disabling the IRQ, leading to an interrupt storm during removal. Placing input_register_device() in front of devm_request_threaded_irq() to free the IRQ before iqs5xx_close() is called does not cover the case where firmware is updated at the factory and the input device is registered well after the driver has already probed. The solution, therefore, is to remove the open and close callbacks as they do not buy much in the first place. The device already starts in an active state, then drops into a low-power mode based on activity. As an added benefit, this change allows the 250-ms delay in initialization to be removed as iqs5xx_open() no longer follows immediately. Instead, the delay is replaced with a mere 50-us delay which allows the interrupt to be deasserted before the handler is registered. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index a990c176abf7..350466ff6bbd 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -468,20 +468,6 @@ static int iqs5xx_set_state(struct i2c_client *client, u8 state) return error2; } -static int iqs5xx_open(struct input_dev *input) -{ - struct iqs5xx_private *iqs5xx = input_get_drvdata(input); - - return iqs5xx_set_state(iqs5xx->client, IQS5XX_RESUME); -} - -static void iqs5xx_close(struct input_dev *input) -{ - struct iqs5xx_private *iqs5xx = input_get_drvdata(input); - - iqs5xx_set_state(iqs5xx->client, IQS5XX_SUSPEND); -} - static int iqs5xx_axis_init(struct i2c_client *client) { struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client); @@ -497,10 +483,7 @@ static int iqs5xx_axis_init(struct i2c_client *client) input->name = client->name; input->id.bustype = BUS_I2C; - input->open = iqs5xx_open; - input->close = iqs5xx_close; - input_set_drvdata(input, iqs5xx); iqs5xx->input = input; } @@ -622,13 +605,7 @@ static int iqs5xx_dev_init(struct i2c_client *client) iqs5xx->dev_id_info = *dev_id_info; - /* - * 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(250); + usleep_range(50, 100); return 0; } From patchwork Fri Mar 5 04:12:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 393897 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.7 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=unavailable 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 515DCC433E0 for ; Fri, 5 Mar 2021 04:13:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2364F6500A for ; Fri, 5 Mar 2021 04:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbhCEENs (ORCPT ); Thu, 4 Mar 2021 23:13:48 -0500 Received: from mail-bgr052100133034.outbound.protection.outlook.com ([52.100.133.34]:26041 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEENs (ORCPT ); Thu, 4 Mar 2021 23:13:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fW6b1OU59EmvJ9WuipPjg+2boct15Rb4YGuBBiMeXgDVW+JRgOSDFGWr0LXYG5YI1K382gaqNgHupjGJkBhrWSCH2EkCGbLf6GqOzoWA8xLfZlcJ29TpM7cM+veaoRaBH/EBkJIPNmDVCMsByIoXN7SwtCEkL+Tu9ao1m5VvQwKq07S1f4oEfQd4u53B0CqZwiHEvwBnMnfJyX9HFTAE7y4uFPnk98frAB/EmZZQivbWAoXQoYabNMgMRnjEwUSQB1IhCRR4g5PHFfanLkXwd2pItXw7vh/Pgs5zNYTlfR5anXe+0N3Pax0OPToGqMxdWHjSAuwEIytz+PLornpVgg== 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=nyS+3efpQ29EBojVtckYVH8803f3RS0bmp0dmVuQ+xU=; b=RsToDmEqTFvBlzyxBwC1AbEuahEaNgZ/JnD4XwE6mEkRHsYXCOYP715WYLTHrMee45Z6nFER2NCmXkqk/LS1kLJRCFYRW0bY9I2M30gCeJyKivM65DYwuKq4snjc1jprQqGrnv7WiEcT1NeBlJAyHv/fyh2DiifjZG6yMis9O5kdFj95Cro+jluHWKAP26WSQbyyeycMJFluZ21Ldy5ujo2SB4e1KVC/7wJXyEEUEEHBJ1EQ2tD4pklSvrzXNyYL4H9uwe9AUWONTDc8zJ4XimLWGLEM2s+mN/ntdGPnYTv9Nw+QufnhBUS/BTsRaNCRBKbXMoc1Ima+a/Cr54WIVQ== 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=nyS+3efpQ29EBojVtckYVH8803f3RS0bmp0dmVuQ+xU=; b=Z1PXDvBf/xIpH4Lu+KWGHdfxtha+MOmLAg90h1/uYVzLW8gaMnUtFfjIxhnDqrukSeeozRjZbi9zMAd8p+Qz7ZN1JwOwIrTJ8v82BHoUTV2r2B6ao+MYxsf3/1gIHMISdjn7g34h0OP3HmB0wkiuyTOEReZ8gIqU3eLtaPkkMHw= 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 SN6PR08MB5693.namprd08.prod.outlook.com (2603:10b6:805:f8::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.25; Fri, 5 Mar 2021 04:13:47 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:13:47 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 7/9] Input: iqs5xx - suspend or resume regardless of users Date: Thu, 4 Mar 2021 22:12:34 -0600 Message-Id: <20210305041236.3489-8-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:13:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2154918a-3ad6-470b-4425-08d8df8d12b6 X-MS-TrafficTypeDiagnostic: SN6PR08MB5693: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wMQWh/nP08fVvAWW9SjSQFmHthUTKFKoJzqzv7f4yiVqBH5VU8lsfgy7iLQFo2mrsRXSpC+ZZFdiNFWDFVtQv2rE4Av4+FUz8TQAK0DDKMsgH6Bs4PNOETamjxQ2oUWZvO1FV26Oso2pJNPdpKUIom6bYxP/cS1ej29AiYQvCUrR/ukzI8ddXViwzmZzKFpvyLgcxFvsvs4UXWUSNiIBSKjCc1IHTojAdy9RABXDh/TFMpriPrhHHSpFvTBqeQUYtu0mQ4/e0mOe0rbY+NB1p1C0000ywBZ4JTMDNBKlwhtjM05zHNaSqesQM6aazd8qnfjp+QsZBOu7T0baoRc1oxa6w+bwsXrTGxGW77XMrKBtTBfkFiwHNMflh6+GgYWJacjFWLbEdMd+f8lBUYCmis8J3NFevflKgGAjeukLPVml92routmzaYRg/hpN6RGPAgAAxc9sNfy5jqDcMjeuCgXNEZ/IrEC63c4txd6MymRJW7Z0zddGQ9/zSPeH7jllFbz95kWzR0XBZ/MQk+FO/a0OGvW6BhQpNi2q1cjAustYQPwHP0htShwOKHKfFOnAPbF5/32IIqXrpjDIi5TCZmKMMBPfiBYpewyHxleE6EKpN09RRpuqqSkJOiXWhTa4aQvjyjvER5iRZklZyQn7u62k+JW0FMZs04sbNFdfFxZCfyLQiVXmzRAuuOpspPEaoXOF+8NygE2oDLQAjXrjL83d4RCKifHBJfOGCy46e8iaxqkUKD5GVJAi38AaC9cGo9JbObKLawDlddB1C6lJtLjVr+t+5qP3EnSwUdECr7HU6rqep35QbmhXJZQ+Z7dwrNOV78AT1+pZUVXh9PtZRHhr6wcSwSRx21GR+T9Ghmbec8GxowXQ/BVbOH1Xn3W1Xgz5guJCQ3aNxUOtmonaZxN3yKn4hInh/bzdf3sKmY0gqqM1IzzdRCoKzP5HPbXa X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(396003)(366004)(136003)(376002)(346002)(39830400003)(16526019)(66476007)(8936002)(956004)(5660300002)(36756003)(2616005)(107886003)(6486002)(8676002)(66946007)(69590400012)(52116002)(508600001)(186003)(26005)(66556008)(6666004)(6512007)(83380400001)(86362001)(4326008)(2906002)(6506007)(15650500001)(1076003)(316002)(42413003)(26730200005); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: HtIMoiKHGrXpmdsopG88ybTa7IixZ8QS0lGJ9BYf8HVWa5xfbsuzi8k0dMiHV6hn73KZtv3ARBzX5AIhcm81f1f2NrUjSJEDOxPsObcpC3AucBKJs8pnen8F/btYrN6cjGPGh4F02FnSY/RUhLaaX6VulU5jUbDGlEMpgj9WsJBQMesMbdlKzHpvOPvd6/u8tP9xuiR7kcTDkwmwWEf2Y+cDpJyIEZ++IF/PREvZi1946Evmk0Q9z6nUeCGIcf9BPiZK3nZlqckK2Q2JpsIcNzvv0q9CNravh1vfACZHd9lCMbZnom4JOjegQp7g6u+Y6fcIP2HXMhB/AwRuRyAqhHOOdsNHZlapOmZklBT0laagcbzBSsUL9YArgvvnQ3KatsPk8NF7l78oj2GgvepP0W3Go6LfHGLDNsWgFt7EbuqQcDa5KigC++Kfm25qWh4rjINfAZryr1L44eRpqaCRyx8GgMz6FQmSPLqkn2xNTb5A0RUlJPOQlzcUlxx1B8JQ7PjfesFnr+Kqn2TH3loamhjvW81/8y25BOqGXjv75yCIAvdcEMN3nS7hkvdWVkmD1QT6hCnxLmj4xLlJFN3LFkowEmFnQKAO1dbNMHmg/NaEBNWhEHLIMvUmUuD5iNVzZUz2E7j9u7JPza9gPgXz2dL+zrxE5SHQsE1Ae8Cu32FUtnslHUKbMNRj3DFdKarJdimwY+pNfSckOsA2zQCkJmz6EMAnQxXkTVS9Wp1bMk4wjEKKz6jIn0ySI4VSecG01m6sWAbE5+sUEeuYiPZ26LIr+vH1vt6Tsxk804ZPr2d/fIi8tcJmW/ehDxTGAfZRR/qJYAw94zWuBhlV8dqvRigrpc1YFz91JeDlOhBh0nWv81lAjAkE2jfJaJFZ/4J/vGvdbxyaVaQwPM90VZcVvYuBH0I0Q3uNjPbxuaccgnyt1welGw2LjplL+smqgV2VROd+IyXML54EdYPUGPYxPcJTD6ZeJz9hcgw9Hx1Zcihi7twBSu+1ft8eZjKLtrqFs6bewIQjK1+s2LmZgbH9tl3xs2yZ6SyVNg/8Pk/1PUrV7UjMAuHdSzHOTo8rDJatN91g3vmOiZd4b93EmHPrv5sdcuTJ66oJAFt2tDI7NtbAOIyrGqzngkkz7VO8mPLcuD1TUeHcejxSBylgSrRjfWYii3ua3IvpGX9hTuBV4f5uuMk9EQYCUBI6bxa+uA3Z42yUARbX6V1WXFsy618Ea6K94NtPbKCctTMNVpC/YjjJ1cc/tWQ9n1CeJQEe0Nb2AuTWyo8I+ocyI5+JYvwVhnEpsvoSNkSNuqkXIwuAljoTx4mBor1cY6pvSfJ+movt X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2154918a-3ad6-470b-4425-08d8df8d12b6 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:13:47.1732 (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: DyvuGgBKrjrfZcmfPORgqulkiEFASZco1AYG0nE3aKhO1f3z0YeGO7kGLU1tqKXunLgePN2dKKRMjV5OomEv6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5693 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The device should be allowed to enter its lowest-power state during suspend, even if there are no users. Therefore, drop the check from iqs5xx_suspend(). It follows that the same check must be removed from iqs5xx_resume() since users are not guaranteed to be present upon resume, and there would be no way to power the device back up. This change makes iqs5xx_suspend() and iqs5xx_resume() both smaller and easier to follow. And because these are the only functions that call iqs5xx_set_state() now, call device_may_wakeup() from there to avoid duplicate logic. While here, collapse the return path for iqs5xx_set_state() to save a few lines of code. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 41 +++--------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 350466ff6bbd..180d2618d8c6 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -39,9 +39,7 @@ #define IQS5XX_SHOW_RESET BIT(7) #define IQS5XX_ACK_RESET BIT(7) - #define IQS5XX_SUSPEND BIT(0) -#define IQS5XX_RESUME 0 #define IQS5XX_SETUP_COMPLETE BIT(6) #define IQS5XX_WDT BIT(5) @@ -442,7 +440,7 @@ static int iqs5xx_set_state(struct i2c_client *client, u8 state) struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client); int error1, error2; - if (!iqs5xx->dev_id_info.bl_status) + if (!iqs5xx->dev_id_info.bl_status || device_may_wakeup(&client->dev)) return 0; mutex_lock(&iqs5xx->lock); @@ -462,10 +460,7 @@ static int iqs5xx_set_state(struct i2c_client *client, u8 state) mutex_unlock(&iqs5xx->lock); - if (error1) - return error1; - - return error2; + return error1 ? : error2; } static int iqs5xx_axis_init(struct i2c_client *client) @@ -946,40 +941,12 @@ static const struct attribute_group iqs5xx_attr_group = { static int __maybe_unused iqs5xx_suspend(struct device *dev) { - struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); - struct input_dev *input = iqs5xx->input; - int error = 0; - - if (!input || device_may_wakeup(dev)) - return error; - - mutex_lock(&input->mutex); - - if (input_device_enabled(input)) - error = iqs5xx_set_state(iqs5xx->client, IQS5XX_SUSPEND); - - mutex_unlock(&input->mutex); - - return error; + return iqs5xx_set_state(to_i2c_client(dev), IQS5XX_SUSPEND); } static int __maybe_unused iqs5xx_resume(struct device *dev) { - struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); - struct input_dev *input = iqs5xx->input; - int error = 0; - - if (!input || device_may_wakeup(dev)) - return error; - - mutex_lock(&input->mutex); - - if (input_device_enabled(input)) - error = iqs5xx_set_state(iqs5xx->client, IQS5XX_RESUME); - - mutex_unlock(&input->mutex); - - return error; + return iqs5xx_set_state(to_i2c_client(dev), 0); } static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume); From patchwork Fri Mar 5 04:12:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 394756 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.7 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 055A2C433DB for ; Fri, 5 Mar 2021 04:13:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D79606500A for ; Fri, 5 Mar 2021 04:13:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229589AbhCEENz (ORCPT ); Thu, 4 Mar 2021 23:13:55 -0500 Received: from mail-bgr052100133026.outbound.protection.outlook.com ([52.100.133.26]:22692 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEENz (ORCPT ); Thu, 4 Mar 2021 23:13:55 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XKyxH83mcF3lobwuqAT54eR7fxz9zmi3ZrUui6g+n1Am0ARqBUdag0s1MdbvCy7Bg7MT1GgtfuVPbE/nO2yXJ9oLCSF+kkbPY3tvU2CDLnZTvrplPMltD7CpzK4MtzETxmNbD4uLkxmrZwaQgY2tTIxvXBhW3vZQwCS+1otxN0GcolCD6MeD9jpcMkLC5MmWkqtI15d2FlxI80wrEfFlZQYMrpN+ekGvkrD0IDOnuawsh7Gz/bzdeCx5yllzwgxjgcFp/kVQkdHa1OqPRXRlXMNHdpVybljE6o5eof4X8GvdJYQxbKn9iXwT/knFNiSSzGd6HV1izRruK+xN2k6rkw== 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=iJDYv6N3rpaTwIGh1gLhK4v+CKjLpoJhNRXzEpTgNP8=; b=EozDB4XzDZXVJyB2QzaZGnDz65/yEEiUEWhZKcYaCkR0ejrTtCC89vrtATGcxF3CQw6zGjgzZqUPzznL14L0/Ra2dUdf+3UhO8u+DF5NbFQ+n6SbIESo61iFSQgenHDGMED0en1YTdQcEDhrRs8bwSD1LOxNgRKlrT4KbkExOEfFT7vJlgmdMP2pmOYXfHOmZwIJFR7QQ8oyvBw1Q8Zg6PVGnB2Evot8IvKr/e6qLcvztegerp1CHWJmb0roRH3eNXK0aCtoVOVEMqE6GRlxwsVJEoN29wKfctpkEN+ElQ5TR+4ajXe1IMTKjNWKwEu+Itk7LMH2hrFrAoZIjhbEdg== 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=iJDYv6N3rpaTwIGh1gLhK4v+CKjLpoJhNRXzEpTgNP8=; b=HrFxw0dYoPxLU5SQawxGDLXiVregKw2nTX6ZPbM6Wo5szrhZgAUXeD9j8fdz8MaZsi3ZUrM9uOjFyyCm1S8IB2J4hetJ4VrCRojzJY7o0GEs3GRTxqWhE7GAGdEMNVnQcblduKYLotjaTH9hr09SgmPXHmTyJCcE8fdjMc32kms= 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 SN6PR08MB5693.namprd08.prod.outlook.com (2603:10b6:805:f8::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.25; Fri, 5 Mar 2021 04:13:54 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:13:54 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 8/9] Input: iqs5xx - make reset GPIO optional Date: Thu, 4 Mar 2021 22:12:35 -0600 Message-Id: <20210305041236.3489-9-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:13:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66524b08-154b-4746-eb1b-08d8df8d16bf X-MS-TrafficTypeDiagnostic: SN6PR08MB5693: 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: N1TyW8hsl5c6IlibuMH8Ghqz+sKurgIyBBY9MtM7+29OdyKDi4EzIUdI1YIW0YsYzixhKxMXu9I8QzbtSGG4XCp+Wl+IgADoBcRLGtH6AstOdQS9kENYRFJ8Yh9eSGCOEefQNSxT+0PDMx1hrzuxS+NKx6QP/WeDlTGSFFP0V36eVzGTXvS54OBj+YrRaQIpu80ZrKW2SmohxvAjqJKxYIeQthWJ4btwdacqCI4zjBsc2TUZ2zqgHje5Vo8VF/J7Sm8H0+H4/Ox/R49Ac0Udp3e99mX5tsVd/sIUWeCsuGFnTef2WE8KddOve2eVS9diLqpfzALW5jQ86AGkdUEf6DEOeT92LH0D6ut25yAXBhExiPXC5nCd82XwCW31BuQuxq/mQKdkYNPW1KywCGI/muFV00/OdGoUBTAMCwPblnc3DoJhhuqcD+xPeEk/UF74krcskGjXw1lsRP9reotwCGfc4S3RV7Z7IQ5sz6riB1eCZMQzi7s6Y5GI72obQZszKeMy8QVkA946/a5vyKgbHqwXx3u4digZ85ViI9zQIIZNZmnsmFqjJOfNWE0UccKB4F9ixiFiEpqBqlyGqgVRxWROM4xDBtr+aTTy8g7a5IvVd5FvJNLmsFeaN4GM0LztFg52ZiO1Ziww/KlLmyIq+FxIpyIMuPiqK/r48sLIm7uczOk36tIw1l7GmlFqaJ0g6SbIW7QwFaf31hn/qtPP5baCKcBFqij4s/YMIcRJiN+k4SIeozT68dFj3CjtdNxgRIEJsLuvGv4CdhYI6GWUN6764dvvDdkaQX7hmEn0Cx6BLQRJuLQebiNxtYDVIO5eG6bcL2GSjxJgrkZKpRsdy+KMIT3PLZO+IARyOjUshHGemYdBdHlHp5nM0coRBzKdmdY7oElNFRlI++2PsgshIQG5C2DF4sVXQP3V2B25w3Ydg/qxhKmUpc9YnH9vGlA/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:OSPM; SFS:(396003)(366004)(136003)(376002)(346002)(39830400003)(16526019)(66476007)(8936002)(956004)(5660300002)(36756003)(2616005)(107886003)(6486002)(8676002)(66946007)(69590400012)(52116002)(508600001)(186003)(26005)(66556008)(6666004)(6512007)(83380400001)(86362001)(4326008)(2906002)(6506007)(1076003)(316002)(42413003)(32563001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: I/a3mgGzOTNZjOo80WEpuhQzjYQnTEe8B2MCRiN2us482C/AWhz570CmsCbzt48uARG0+7ejHuow7fq/gQjicTMjU4fbXp0FrMcDuTcdMuM3O9NKSehDly3pPlpOV1ibyQmWgy90OA9r2qbFFtJp6qDnSyPLIUkMNp97DsmQj+WCdXFqNrhreGfP/lI9Zl/3VhkJzZ/4w9QiFCfeV0qo99iGXXqmMISmx16IOBgfzkZOFFyfWB5NaB702vII7xHY1zFu+iKfX0zg2BtJB1o/gm9+/yegQ8vgOY7ASlC8rEfXPrlJHB2dwCPoOYTyJQaOOjG/J1GDhzwfn4GEecWlTnnor1axlDA2QLEAqOPirdXY2uKH9N8yOZR3kXGM/sG7WNlqPdO6oEQkxDGm3ETEfoiHdGB3ittXUcjnrqOl8z4FLVqQMEpIvZXPkq8mvf5FH6vXpXbeqr5bO1tMhfxXocbsoDiKmn3u0fVILWKfrcaUGQBTLVwg5Y8/yPyOWGbT0vohXB0uH9AqY1QJ0LAFUrVM+SsaVwDuJ6W9Dra8XYQqYEISYOUesxw3XAvwrfQi6qnss5aeSQsFApf9gp/mVl+xcDs19ywet92NYvnSl/+2AkszpLOmpayUTjBWssypiLpTbUOJJgFBeiKzIDNH/UQAUnacLSRxyVvGGXjZe7QF04K9T1vP2a5FpO5qlp/Pnsu6T2djyQ3mWFd7VkcAEieuO6qbdFhemxoVB70Hdf0u+ARARYr+PUAeF2BGnCRRvgjYfeWXCv6VS8sKrOb2N6X/WIkLWnxcC93+8AzelcEH+4mCmqte4Z/iDnxQXZb0+ZRgTQzT3YGTTY3BGdEaxJ7LZ4/OrSu3HCXGUv8RYe+dCwHyNQkvPzMAeiMqXMizQ6G122bDNUUF/lkE0Y9kgAGyOyRD6hAUqSYuau/2/ZfvvSnkfH2WlZyUfkR57WQGddSsQeCZaxtTNC7BI9KZg9coThwx8RPNhOLUJBb77UB9kBBVObGsevD2cFuu6au/b+66NHJUZ6VCPLonP+aUcBEnexJqXvOv63P6eve9lWUsZ5vc8poWP+oDwiYDrdGq+xsMhbNzOJwGoatNkjd5YuRZnSECU33SS+vIHMx7S9jhcN1xT4IjnVPatYZMaJb3EuYrJVaUCWw67mirKjnytR+7nX2dqYSWahceZrYBxDROpA4cUMzKSg0J324myEkmxV9eT5AzqccSMR/HDgZiqakNwf3L3HXr7yiRWkl2hPCYg5tMH9oG4FC+/vO6P5XLcMNbcxK3xshgRLkJMbdB2CwNpS2niwoTOS94scr7pxv0gDa3N0mFJ1iww2hUlfZp X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66524b08-154b-4746-eb1b-08d8df8d16bf X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:13:53.9673 (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: l6YspTwjCQ/F5J8ZarhKwPaHCum+oqWem7RCV10iOMNpm/E/NvbLva3QDihlRYRIw5ZPj6JQJLHqD+ZJOa0WUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB5693 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. 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. In that case, the 'fw_file' attribute is hidden because there is no way to open the bootloader. The logic is extended to the case in which the device does not advertise bootloader support in the first place. Last but not least, remove the hardware reset performed at probe because there is no reason to reset the device manually. A power on reset function already ensures a clean reset at start-up. Signed-off-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index 180d2618d8c6..6e53b455bfb9 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -807,9 +807,6 @@ static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file) int error, error_init = 0; u8 *pmap; - if (iqs5xx->dev_id_info.bl_status == IQS5XX_BL_STATUS_NONE) - return -EPERM; - pmap = kzalloc(IQS5XX_PMAP_LEN, GFP_KERNEL); if (!pmap) return -ENOMEM; @@ -929,12 +926,21 @@ static ssize_t fw_info_show(struct device *dev, static DEVICE_ATTR_WO(fw_file); static DEVICE_ATTR_RO(fw_info); -static struct attribute *iqs5xx_attrs[] = { +static struct attribute *iqs5xx_attrs_bl[] = { &dev_attr_fw_file.attr, &dev_attr_fw_info.attr, NULL, }; +static struct attribute *iqs5xx_attrs[] = { + &dev_attr_fw_info.attr, + NULL, +}; + +static const struct attribute_group iqs5xx_attr_group_bl = { + .attrs = iqs5xx_attrs_bl, +}; + static const struct attribute_group iqs5xx_attr_group = { .attrs = iqs5xx_attrs, }; @@ -954,6 +960,7 @@ static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume); static int iqs5xx_probe(struct i2c_client *client, const struct i2c_device_id *id) { + const struct attribute_group *attr_group = &iqs5xx_attr_group; struct iqs5xx_private *iqs5xx; int error; @@ -964,8 +971,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); @@ -974,9 +981,6 @@ static int iqs5xx_probe(struct i2c_client *client, mutex_init(&iqs5xx->lock); - iqs5xx_reset(client); - usleep_range(10000, 10100); - error = iqs5xx_dev_init(client); if (error) return error; @@ -989,7 +993,11 @@ static int iqs5xx_probe(struct i2c_client *client, return error; } - error = devm_device_add_group(&client->dev, &iqs5xx_attr_group); + if (iqs5xx->reset_gpio && + iqs5xx->dev_id_info.bl_status != IQS5XX_BL_STATUS_NONE) + attr_group = &iqs5xx_attr_group_bl; + + error = devm_device_add_group(&client->dev, attr_group); if (error) { dev_err(&client->dev, "Failed to add attributes: %d\n", error); return error; From patchwork Fri Mar 5 04:12:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 393896 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.7 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=unavailable 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 457B1C433E6 for ; Fri, 5 Mar 2021 04:14:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1551265013 for ; Fri, 5 Mar 2021 04:14:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbhCEEOE (ORCPT ); Thu, 4 Mar 2021 23:14:04 -0500 Received: from mail-dm6nam08on2057.outbound.protection.outlook.com ([40.107.102.57]:17664 "EHLO NAM04-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229458AbhCEEOD (ORCPT ); Thu, 4 Mar 2021 23:14:03 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OXPKVtEyaxnpJZ8LW+pl9Mdhx/arKUomvofIN4FqiobFLh4HotGnGZVn+7qbq71PECBdN5h/UmLjjy6TZJO9ndbo+cyoDL7i8oQMLdYdkqwxutiiokjj3aEy0XahlunhFGaybJXnoQX5ZYlkpJy6UVdEO3kbPnRaNaB082ejvMJotLfuZd4PQes6ZNkD9R7boWoMeKqvxQlFGhr04Kwsiyo28mLEVXLenFAyPC+UwNoowUvxyqBr/E4WXCWWW5o75ZiJeosh3vYe/1sZNHT+SeCnKkiu2AQMyf/Zmx7gjcK4VbGJqwAgfoQNQNblLf/+AaLqSHmKkrS8eJalrCWEeA== 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=8tOt5zaMcC6zpGrE2L8Gl8aU3d8XeAXLn4iz2+Be3Rc=; b=S0CbbPudy3VMs8i6yjTV/lQLege84HIQP4cAL2yew/X3sb/lqAMPq+S2gm9CRbIMaycJXTjtJzEl+XWWLE1EOKEkTiHnHibnPTm5eR4lyEi89XgFx9eb2D00+OJ6d6m2baNDnzRLDeHisSqBpS07IXdjM9HqB+SgQlJ9i4bwbhT4CXfbTGvXCa4KdKfHy/7Zea9o1okj7VqWc0xg64WJr24NYwQ0ZtKgmuyAS3ECcpme5Vk3A2JipZce8fzz+W6+5EdU41bbVqdxT5xTEGhQdtHX8MaZpmt3O6zz2yBBUZOir+QV+WrJm6eYHDxdFd66lYIHGctEwge0GJ35NjB/Iw== 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=8tOt5zaMcC6zpGrE2L8Gl8aU3d8XeAXLn4iz2+Be3Rc=; b=xHWO7Bq/se45uSHezT13plUZ/7FqAYLMxTsvnhG6CGGjEKX02H1kTotAmL/6HiAroThQV3JxelIejSvA1Gy+DY4SmSMyb5Q9ePHcmNFzmfUGjOAme4NqHcNW1F0DL61TJTwrfx6+UFT/n7HyXhZhFyD6YCLVoj7u+m+COFLEpng= 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 SN4PR0801MB3709.namprd08.prod.outlook.com (2603:10b6:803:49::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.19; Fri, 5 Mar 2021 04:14:01 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::79a3:8aa5:feb8:7f04%7]) with mapi id 15.20.3890.028; Fri, 5 Mar 2021 04:14:00 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [PATCH 9/9] dt-bindings: input: iqs5xx: Convert to YAML Date: Thu, 4 Mar 2021 22:12:36 -0600 Message-Id: <20210305041236.3489-10-jeff@labundy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210305041236.3489-1-jeff@labundy.com> References: <20210305041236.3489-1-jeff@labundy.com> X-Originating-IP: [136.49.90.243] X-ClientProxiedBy: SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) 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.90.243) by SA9PR13CA0086.namprd13.prod.outlook.com (2603:10b6:806:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Fri, 5 Mar 2021 04:14:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ff5a66a4-26a0-4694-0355-08d8df8d1ac3 X-MS-TrafficTypeDiagnostic: SN4PR0801MB3709: 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: wMIcR2eeSR6AChcFSHjLR6yCDXaI/06W26aUl/foWQIzS9GwrlCeYhuYc2qc/+pKhgBP2KozSx3g9AP+MJLEFWlFqeL3lVcyWN3aRtZZaW3LNk3HM5E6bZkykdgBalAGsOrTW+ZjJPrrRA21+/GpFd4UDCQr4uEOhgf67c/SEIMTg9KWApx5Lz3Mw+I5ap3SHXuFhcVdrBtT2iXLN5GEyTYu6dBP5+yZ2bJy46BzLRsEaBdMdzJkBBkK81x6bY8oZwrO8iqQZT6ryYSRiBiUMnUg8bHHNzoRf3W91emLH7ru+XhT7csSoITrMc11WUlxH977t8z+UNebP0rrpRhL/LfqMmQBD1l1ZQqhKHzyT2EiFC4z7eHqS3iXjducLgXXQ8o5ZmRB7cIdBG+Qh3ctT6QiBCUgWucOc9ufSmphm9p7mhYzuMaeMK93MHXxDGzsyXkENez+fyk+ysuPNktIvFsBZsQbo3THag4vQJTVKDCc/7cgJrN/Jxt9IjNJycMTywqmnFFhauw3ipa3wA9UWTTo/ZKhzADodzsYufK68ezr3YbCq7szEuF0kmW7ye9qcVMLNPFhjOhoBDwLb2h2G0pPFGpAAg36D8f7rm5SRf0QUaN68ggHzn2pVncJ89BC3F4e12XM0JkiJnMYb+eijcQ7NH4B1DrkcgfAPs7QJf8= 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:(39830400003)(396003)(346002)(136003)(366004)(376002)(8676002)(66556008)(956004)(6506007)(107886003)(1076003)(2616005)(5660300002)(2906002)(6486002)(52116002)(8936002)(508600001)(316002)(26005)(4326008)(16526019)(966005)(83380400001)(6666004)(86362001)(66476007)(36756003)(66946007)(186003)(6512007)(69590400012)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: D/mINN7VdlpAHOoFvI0jEU6PNDIWQSyu6btkD0U8+EybTCEnFdwlQJL1f80BBK4kLiZLCe+hZV/Xa8SRRDn6/GS/syoGPw4zNrw7cp5fd7OU+gCs+Togb2K/h+gfxIxa1EeGwIh34iCqtZQUGj5Wej6HC1q2k57Kv4oKI8FuZLnkwqTDGoQDM4gMXYB58kva1KprKUM7Fr6FOFtHBmae2m5y1oVnaIVSmTrV9/i7XIE1jhcf7lN5Fpgca+Ccqh0EwN6P1DfVfRVnQEvntc1YqiB5R18zRmznX7SDqe5WORqTxdebieF/ey8wAaA4vWXaksLq3gcp1iIKA60STacs+/m0O+eRIDtflH4sJ9qrXEgX6wLZtKFtEoK17Nqoh9XZUwns1Ui02fZSGgPoxNbGuuGFaqy/0bMXcJuJQmQhz+ngBG7Tp+KFNXBBM5t+WmzGmIjcZSPHcr0MwaOoc3Kdf6lcVul4GsUR1lZ6EffxGMz2IahMaZyjy3YG8OO1BWSQLqO0Apvws7XXcfZuoG9iNn+h7pIiv5yEoWpBUNFbbBSoHVnTOU8QCinPIupiL2NPb+0qCnOairIFtUMzMOVfHKkU5QElbnnA901qY6FUvuPXkb3BfqDeop6TtwZmNOLqAqbvCkkjXmN5ac5E2iyKEJakwlXcfzuJek4s4MRN7hLGkL8QAaTWGZcT5zONw0S0g4qR8kdDe8x/X1uvQyRREmXJMRqhFir6TCb7YNrxkXKG+4senD3WH5KMaPQ95gCuVD1Sxa7LHlfSLysKIqKZZQNlLzcX1mw7iaITIBO6BAzD3IFY06Wmt7vUdR43Eqb8NZDnIMRUHaMoSS/bU/Gfk1nJ0AR9nlh+eoKjeqtuKXWnjtUJbK07E5mVEcTUzbLczdRc52ByCVQn1QTQQku+bV1PT96h1hXaJkJTaWOMW3ydUbBsftXC3kZTuD5XRUAGDfYycw5/rk6dWqUyhG/otwsV4gM1VMRXafe39QTdqzUXxCl+1V6TnrJoWFYAOaytt8Ta9AKoPtx37got+v86iwUY9083F851cX/kQ13s13c4IKpKHKzzN2foPvguh0UrrE5Ah/GjSLy5P/wqU2tvnI9Cz1S0Byk60KBlOzWR82JWpM1aJGfNbfxrAOJ6+v/HRef9WNmFHon1raGF3zidv5BcTr5QgqBG/LppW46yKpnP4EdCguVlAfIuLtJZ1c1IbYNxBWrvWJidi0TMEs3adyGpAiVUPswgp7peAsciuN4lf1S3vn25LsM1FFe+groSaQzb0xLCpULZxfKr1bG63HkR4SZ5lK8/qbAKdfrmpN/yhyYTjV1NUrUI2h9CnPg6 X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff5a66a4-26a0-4694-0355-08d8df8d1ac3 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 04:14:00.7354 (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: zMdZed4avGyDF4dUGFOmJekU663osUzu5AyKMBiSXhTiwnQ+T9J13ctfrqbCUWKV//L4VrE6SRsA6cOwfk/K/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0801MB3709 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This patch converts the legacy text-based binding document to YAML format. Extraneous details and touchscreen properties that weren't actually supported have been dropped. The reset GPIO has since been made optional in the driver; this is now reflected here as well. Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring --- .../bindings/input/touchscreen/iqs5xx.txt | 80 ------------------- .../bindings/input/touchscreen/iqs5xx.yaml | 75 +++++++++++++++++ 2 files changed, 75 insertions(+), 80 deletions(-) delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt create mode 100644 Documentation/devicetree/bindings/input/touchscreen/iqs5xx.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt b/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt deleted file mode 100644 index efa0820e2469..000000000000 --- a/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt +++ /dev/null @@ -1,80 +0,0 @@ -Azoteq IQS550/572/525 Trackpad/Touchscreen Controller - -Required properties: - -- compatible : Must be equal to one of the following: - "azoteq,iqs550" - "azoteq,iqs572" - "azoteq,iqs525" - -- reg : I2C slave address for the device. - -- interrupts : GPIO to which the device's active-high RDY - output is connected (see [0]). - -- reset-gpios : GPIO to which the device's active-low NRST - input is connected (see [1]). - -Optional properties: - -- touchscreen-min-x : See [2]. - -- touchscreen-min-y : See [2]. - -- touchscreen-size-x : See [2]. If this property is omitted, the - maximum x-coordinate is specified by the - device's "X Resolution" register. - -- touchscreen-size-y : See [2]. If this property is omitted, the - maximum y-coordinate is specified by the - device's "Y Resolution" register. - -- touchscreen-max-pressure : See [2]. Pressure is expressed as the sum of - the deltas across all channels impacted by a - touch event. A channel's delta is calculated - as its count value minus a reference, where - the count value is inversely proportional to - the channel's capacitance. - -- touchscreen-fuzz-x : See [2]. - -- touchscreen-fuzz-y : See [2]. - -- touchscreen-fuzz-pressure : See [2]. - -- touchscreen-inverted-x : See [2]. Inversion is applied relative to that - which may already be specified by the device's - FLIP_X and FLIP_Y register fields. - -- touchscreen-inverted-y : See [2]. Inversion is applied relative to that - which may already be specified by the device's - FLIP_X and FLIP_Y register fields. - -- touchscreen-swapped-x-y : See [2]. Swapping is applied relative to that - which may already be specified by the device's - SWITCH_XY_AXIS register field. - -[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt -[1]: Documentation/devicetree/bindings/gpio/gpio.txt -[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt - -Example: - - &i2c1 { - /* ... */ - - touchscreen@74 { - compatible = "azoteq,iqs550"; - reg = <0x74>; - interrupt-parent = <&gpio>; - interrupts = <17 4>; - reset-gpios = <&gpio 27 1>; - - touchscreen-size-x = <640>; - touchscreen-size-y = <480>; - - touchscreen-max-pressure = <16000>; - }; - - /* ... */ - }; diff --git a/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.yaml b/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.yaml new file mode 100644 index 000000000000..5d802f153a28 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/iqs5xx.yaml @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/iqs5xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Azoteq IQS550/572/525 Trackpad/Touchscreen Controller + +maintainers: + - Jeff LaBundy + +description: | + The Azoteq IQS550, IQS572 and IQS525 trackpad and touchscreen controllers + employ projected-capacitance sensing and can track up to five independent + contacts. + + Link to datasheet: https://www.azoteq.com/ + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + enum: + - azoteq,iqs550 + - azoteq,iqs572 + - azoteq,iqs525 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + reset-gpios: + maxItems: 1 + + wakeup-source: true + + touchscreen-size-x: true + touchscreen-size-y: true + touchscreen-inverted-x: true + touchscreen-inverted-y: true + touchscreen-swapped-x-y: true + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@74 { + compatible = "azoteq,iqs550"; + reg = <0x74>; + interrupt-parent = <&gpio>; + interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; + reset-gpios = <&gpio 22 (GPIO_ACTIVE_LOW | + GPIO_PUSH_PULL)>; + + touchscreen-size-x = <800>; + touchscreen-size-y = <480>; + }; + }; + +...