From patchwork Sun Jul 9 17:06:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 701376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90EAAEB64DC for ; Sun, 9 Jul 2023 17:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbjGIRGq (ORCPT ); Sun, 9 Jul 2023 13:06:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjGIRGp (ORCPT ); Sun, 9 Jul 2023 13:06:45 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E428A4; Sun, 9 Jul 2023 10:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ig5U73BE9FF9hh3WG378ZsKiYeecWvem4/xtgpou+Ajg8zt04NQUCIj39C8Qsz/zVAQsVXjaMvCoEWAiVM8Mgn5ABnEU8u/PmMJl34XCiE2tgdDZbVnT33HH9WzAutunHby2tavCInx27bjc2/Ve7sQT5QpU8MAtV1qpmS0pyIZrVsQMICwJH4ylsBfiZLL20IfzR9ikN84GmOMrCQFV3duzD/Z23xm3ZvoPmetM62TxIlIYWhLZdtsV+UoTN28HFTG18mCY32d18Lvl5sLxoZXcHp27U2QBQCR4bptdjZm4p+eDasItTol3b5cE0GCg17CubUBVQ21Q7cCQ1nF2+Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K3zQcwDrCTThyLlfJ12rElR4LlqTxCUd9ibe/BKneTw=; b=SjST4oItpZBPRTiYoiWldyhsrnad+QZQh8aA2upqHZI4bjZ+zAsoRJurEIhuEywFEcSFQHbPFGme8VyGqorXZ0MZ3nOcS2JtJDNbq6H/hWQqPiSuZFFqiik+n41Vny5tlg2hLirxakuOQ8/GB2cVp2wOnZfhxn05hbdcg9lg8bTem3l3hXxre9yF/dylkupow2caWvUtsDCXrRJA5sic7au9dEpUfuJI24b6RArl3pN5Yuid9eTuqj9cPGjaGb5XQ3flgMfJdZy6Y8LR0ZTYNrhP4wMbO31LLJ69fmZvpZJyXJMpqynnm3IA6o20F6Fffo0qliDFlC3RVgDJRyJ2qA== 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=K3zQcwDrCTThyLlfJ12rElR4LlqTxCUd9ibe/BKneTw=; b=rB4pp3iBSntSe+AyL9bKFaoWgjnD02oOX9iv4QJ9HLNGyL5ltAYjY7AIrgZP1dbNzGypglbuayuxbl5aT2XwlUBFJw8ytjBE4MVZD94JfzM/BJlHUqvdHE5MUDeCSVUKypQYghnEe2LW/xF6Mw5uL895vrYKfRPWOowKeJt0tTw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=labundy.com; Received: from SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) by PH0PR08MB7020.namprd08.prod.outlook.com (2603:10b6:510:74::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Sun, 9 Jul 2023 17:06:39 +0000 Received: from SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae]) by SN4PR0801MB3774.namprd08.prod.outlook.com ([fe80::36df:48aa:beb0:47ae%5]) with mapi id 15.20.6565.026; Sun, 9 Jul 2023 17:06:39 +0000 Date: Sun, 9 Jul 2023 12:06:37 -0500 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, jeff@labundy.com Subject: [PATCH v2 1/4] Input: iqs7222 - configure power mode before triggering ATI Message-ID: Content-Disposition: inline In-Reply-To: References: X-ClientProxiedBy: SA0PR12CA0025.namprd12.prod.outlook.com (2603:10b6:806:6f::30) To SN4PR0801MB3774.namprd08.prod.outlook.com (2603:10b6:803:43::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR0801MB3774:EE_|PH0PR08MB7020:EE_ X-MS-Office365-Filtering-Correlation-Id: 960df375-f4e4-4e41-d991-08db809edc64 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZUfH+5ZmPZUf9uI3egbY8sN4O4bWumvdep/ZEXDnUZ3snmqhEATm7sm78sBgtdmmpqObQMkUdBdUVvzu9IebfIevl4RL4hatOlJ1OwQT2ZHNFd2NcFjbBPsgvY6jrxegm/khVRgrdHVBAOmKjop1kAh9ON8/ZqcYsN2P6puYhxaWyPUvu8j3GX2aHFVfAfwDZceG6RMLUmmZ8QmBJYEIu0F93oNNzC527YWmmY+bKkHRpX+SO/S/Czh3LsGFB8+Z2VSma6IegHwYzYx3sKcY9u9AOYE86M8M5Lrotu5aD5ixs9wV6Bns4KV/QugxJghQeD7cHDYM2GMR4OIhfD/etLHXGyJ352VNgIGPxJscSivui4DCD9p/1ofYW9a03Seo8zuS0AnBS+Ige/1RUuRl0RFBpqUyc7upGvzLp/hvwTO7fS1k2iChFwM2Ux0rX+lcg+vly5Z/B93Z855GxjReD2xU/mopqbC3tasizrfTQC77x7GD3vE4Bh4qqtCeQXJurArby5BU4CEYQOvUIBP9sEdpBIM9rTPMF/12k0/GT+Qll3dyTmXk9FFSd6uStN+n X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN4PR0801MB3774.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(7916004)(136003)(346002)(396003)(39830400003)(376002)(366004)(451199021)(86362001)(38100700002)(6486002)(33716001)(107886003)(26005)(6506007)(9686003)(186003)(6512007)(5660300002)(316002)(2906002)(66556008)(66946007)(478600001)(8676002)(8936002)(66476007)(83380400001)(4326008)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vtEma8Syjs9TivK5PYJE+f6zkUWnENJOY57m3LvUZGiOrTCtAZGJ6lgZfFeVGzsvWhhB9qAceZvnFHc/6M70pJ6g6J2tX2MzQhd0vII2x0jaHbkBliiG27hRPZ5tq0Dbp6how+0EN1cYB5DI9z7gVmOQMcmnNXWXAqVsRN5ph6w+iSodAVKJIqPtiaFj5IzJnxch0esk/U+nn8lJVc79q5QstaeLMMiVHPf2OWdiLmfprnKnSUy1NwxyfXpVuPMx4A2p5x8tX5m82jL5xSwKquzp98jY65Zh0Z3L+25nxvVaTMSXR2KRvppaWd3ok6YPXwHr1pn4iBYWQ88v7JcysAt7c3Aerv7vw/k1biy4uGY4+ktns4VfahagSorW+EjvQqsWYyrDLz7mxO460yVE7Ao5vy7UA4DJJRQiny0KYMkCqLR8++6uBECjqrmsGrQ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Ty+kUrP9prC8wloMexZnBM7oehdl7udoViTMXc6H1Vru5+GYVQWay3NL/RZN3f78GuKnmS0acsUqrM+g X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 960df375-f4e4-4e41-d991-08db809edc64 X-MS-Exchange-CrossTenant-AuthSource: SN4PR0801MB3774.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2023 17:06:39.5272 (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: q+93ahavhbcpw9fsIdvnBLlFB6Qo7lmcYDqRq6Bk2akWlYypGd0sRgu3trdazX+X36Y/qwr5vyMNmEXPIbZ1xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR08MB7020 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org If the device drops into ultra-low-power mode before being placed into normal-power mode as part of ATI being triggered, the device does not assert any interrupts until the ATI routine is restarted two seconds later. Solve this problem by adopting the vendor's recommendation, which calls for the device to be placed into normal-power mode prior to being configured and ATI being triggered. The original implementation followed this sequence, but the order was inadvertently changed as part of the resolution of a separate erratum. Fixes: 1e4189d8af27 ("Input: iqs7222 - protect volatile registers") Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs7222.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index 096b0925f41b..acb95048e823 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1381,9 +1381,6 @@ static int iqs7222_ati_trigger(struct iqs7222_private *iqs7222) if (error) return error; - sys_setup &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK; - sys_setup &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK; - for (i = 0; i < IQS7222_NUM_RETRIES; i++) { /* * Trigger ATI from streaming and normal-power modes so that @@ -1561,8 +1558,11 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir) return error; } - if (dir == READ) + if (dir == READ) { + iqs7222->sys_setup[0] &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK; + iqs7222->sys_setup[0] &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK; return 0; + } return iqs7222_ati_trigger(iqs7222); }