Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1723881pxb; Sun, 17 Jan 2021 20:30:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxWJOoLpE1tWmn4hyDD6Vwf676rfzd/BbLCEMX9LKGRNKwApt9EiOXMG0Yabi4TyFBP74i X-Received: by 2002:a17:906:9616:: with SMTP id s22mr15119542ejx.270.1610944246195; Sun, 17 Jan 2021 20:30:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1610944246; cv=pass; d=google.com; s=arc-20160816; b=YOepHvKXQJvqfafzzfeL6/ijWX2goTSoHvr4ZWP3xayQeBT+HHeKhGk9/1pjf+zvan n7f6rC/qZ0wJNv7zk7ZeRoVt86lxJqzGkG9lZUxb0rZNtwy2oN5/28u12Y06UBUGIsBn UDTfNGbNC16a/vMwSYVVAGxgarx2JZqzj5wexHluctnTqzi7O2K9Vaas2HGoTcL4Hn/7 K2GUP7pvjO51Sskbx6XIGB3mdmA8gyBi1ef+KT0+aiEJYyH/luXQioukKVSLq1/SDCHS igOtWNRfou4r8oUBSPVClwOYkiduhft1oF1CAs70DvZ2S9Fi23vOpiQWJpZZyefHh+Y1 ATDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wi0Dj7wo3sW+KLyZs1cForWgxA8h5XDeZwtBH0wsr6A=; b=uvn7U5XC54C0ZcGHm0Hdi/0cB0w6eM9zj95+3yA0cqPd6kVgktr3P9CYeH7LLEDb0E l9xiix5wBbo9xd1OjjVeLEq44mVy9AAAdPvdxTsm8e3L5ZFpbT7A0WtIA+NQRiWaW2mt rSoaDiudZjnMK3x8Qwgsk8wVlQak5rB8YU7ZlGEs9251ZdSpnTVq+RUXs5fACPqjrQXk Ajh5Q6lTWZIyN6rCgTgzqZj5Pnqc89AEdJ0RJCPEZaf8UMbGf6fd9RAhccYfE+PCOVdi PhAKlAFJ7liclE7XsKVb2qN3uUcwhTT27SD6JtIeugqevtXmRD1Rd8PWbDIt1TRnxYe2 NZ6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NETORG5796793.onmicrosoft.com header.s=selector1-NETORG5796793-onmicrosoft-com header.b=zHUCBI+9; arc=pass (i=1 spf=pass spfdomain=labundy.com dkim=pass dkdomain=labundy.com dmarc=pass fromdomain=labundy.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si7188639edv.418.2021.01.17.20.30.23; Sun, 17 Jan 2021 20:30:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NETORG5796793.onmicrosoft.com header.s=selector1-NETORG5796793-onmicrosoft-com header.b=zHUCBI+9; arc=pass (i=1 spf=pass spfdomain=labundy.com dkim=pass dkdomain=labundy.com dmarc=pass fromdomain=labundy.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730945AbhAREAQ (ORCPT + 99 others); Sun, 17 Jan 2021 23:00:16 -0500 Received: from mail-eopbgr750082.outbound.protection.outlook.com ([40.107.75.82]:60843 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732004AbhARD7i (ORCPT ); Sun, 17 Jan 2021 22:59:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YB9ZF1zCmq9rRMe4cPEbwuBDHAQYb/SiNEt4TXlD6cYzfpN86AnBETWxgfw+bSryQcah5Iy/caXiPfoRsGEGqIaAbXi6Y9+hvtFlG2IgGpQ4CJ1cLBkFbSLAhRIDXVa8nNMtLJMgA3LPBCkHsbWj5+cdmUWVqsB0gum/Si2xxDp1LbDTCKiZvwsiUfQauuFgFfyj7cLA9deeTn6G1O1MwAVX2XXMOj41YLuHqBWddrS8J0bsllN0vHQoSohNGY0JoNKC5cPoETwA3E/ioZ8JxMdprkyiLtLfuyP2Go9D1rZcK1rcPUK6aIfrcmBoX/7JN9uulVFjoXuRigfIEWJXhw== 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=wi0Dj7wo3sW+KLyZs1cForWgxA8h5XDeZwtBH0wsr6A=; b=fQYXzgKViFYaFRAnrES3xg2D2/JRCTEcwAmVPLSo2e3/mPG1tRqXVReiDRtTGRL2YRQR55JRtgQNK1rbSBuICjif3vzeaOkkTIzurP6COULwtch7ccU+LB6BsR4QtIBzu1KLjYUC5r8aj8dGpIta1n19wvVE4SM6ocvzcUXoH8vomf6eMjqPOtm0ubSayeCmrpGjoHA0A72BEKsCOwbJy14X/a8js+EcesyRAKr9E2D1LADOOnmApJFvcQ8y80BVJNAs7vIO/LK2d8qv7ACUN6kbdzt9BoYZtUT97dWx/AxkpYzFNcbKTsbSvIzCyii/TnyjQT8GlbIgaZwzf28CJw== 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=wi0Dj7wo3sW+KLyZs1cForWgxA8h5XDeZwtBH0wsr6A=; b=zHUCBI+98H+/5j0omI1ZvEmGGky9ZF47ZdyrQ8GkU8XaGMZWhH8/Xox/Dxw5J20tMqycOxT6y8Vja2L2eg5dzMSFSij8cLDDW2bMwnTW8rxbWkmdHZo8K1YjHA4STb0a/NLxwqc89umUqvS7Ji1NtVvSxZLCP6EcJ+6kem8PjjY= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4878.namprd08.prod.outlook.com (2603:10b6:805:75::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Mon, 18 Jan 2021 03:58:04 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::972:c257:aa68:9be0%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 03:58:04 +0000 From: Jeff LaBundy To: lee.jones@linaro.org Cc: linux-kernel@vger.kernel.org, Jeff LaBundy Subject: [PATCH v2 6/6] mfd: iqs62x: Do not change clock frequency during ATI Date: Sun, 17 Jan 2021 21:57:08 -0600 Message-Id: <1610942228-7275-7-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1610942228-7275-1-git-send-email-jeff@labundy.com> References: <1610942228-7275-1-git-send-email-jeff@labundy.com> Content-Type: text/plain X-Originating-IP: [136.49.173.128] X-ClientProxiedBy: SN4PR0501CA0055.namprd05.prod.outlook.com (2603:10b6:803:41::32) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.173.128) by SN4PR0501CA0055.namprd05.prod.outlook.com (2603:10b6:803:41::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.6 via Frontend Transport; Mon, 18 Jan 2021 03:58:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e307cac-5916-4477-fed2-08d8bb65419c X-MS-TrafficTypeDiagnostic: SN6PR08MB4878: 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: QoAg7WtTOQ5tiMVFa39/2fVUL+2wMhWCfDRgpFGywopjdTRLofyYWZmN1/cAQ9OxJYpZgwQ3o5K8VkM4do6NWplQGUtFMp4W2AMKnu4h2CZSdTCtoBmRWYyhMaBC7nUY8aJs7jMbUw10yIBnjA2A4rbYo6g5gAD2GpSd4nzavARPwwLRwoqjIDoojLdOb148k6K5msf1tCj7EcAecqX5vZO/WYF/zBxWkk/pJ44O5VEeohAhI4tWkjes9IRLUGj1M0QHIkuQqZVd61a6ZDUORAikPIVB4edtJgnUwPaNmmBfFHGzg55s+AAxgFPu8z0H9La43CJHlmFEpZltR8MAOi06a3xmOccyQkZ5fiiXK7i4GGf3cIC2h2rlubOKjGFzWehEkG1ZM04Yrb8n2IpB/vjVoeLUTDISKKwrkAr0qH2ENw44e5fjp66mQA0j1CeF0mPsMYdVev52awfkz0NB1g== 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)(346002)(136003)(366004)(376002)(396003)(52116002)(66946007)(107886003)(8936002)(5660300002)(6512007)(69590400011)(16526019)(66476007)(478600001)(956004)(316002)(8676002)(6486002)(6506007)(83380400001)(6916009)(2906002)(86362001)(36756003)(4326008)(26005)(186003)(66556008)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?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qwmpsW5VLWkH5gep/agy5HR?= =?us-ascii?Q?upoXRsVy5dQHVnVOu1v3tv1UVkfD4Z47jGLa02O0XP01a7JsUREUzQALbLLv?= =?us-ascii?Q?5PzLf328ZlqOnxIwfHuWAhRdtaCMCfoVg/F7jLPKvvE7qa5Tgf6RWaN3qPk6?= =?us-ascii?Q?+oAX?= X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e307cac-5916-4477-fed2-08d8bb65419c X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 03:58:04.1336 (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: a7J5cjcjXOJK4oxZthM6izQXgqU3jwaSJGOp3joEyoRZU90KnoRNZbXrviyQ+O7z118VVLJ6LcVkCLDniHKYLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4878 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After a reset event, the device automatically triggers ATI at the default core clock frequency (16 MHz). Soon afterward, the driver loads firmware which may attempt to lower the frequency. If this initial ATI cycle is still in progress when the frequency is changed, however, the device incorrectly reports channels 0, 1 and 2 to be in a state of touch once ATI finally completes. To solve this problem, wait until ATI is complete before lowering the frequency. Because this particular ATI cycle occurs following a reset event, its duration is predictable and a simple delay can suffice. Signed-off-by: Jeff LaBundy Acked-for-MFD-by: Lee Jones --- Changes in v2: - Added Acked-for-MFD-by trailer drivers/mfd/iqs62x.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mfd/iqs62x.c b/drivers/mfd/iqs62x.c index 9b5c389..d1fc38a 100644 --- a/drivers/mfd/iqs62x.c +++ b/drivers/mfd/iqs62x.c @@ -81,6 +81,7 @@ #define IQS62X_FW_REC_TYPE_MASK 3 #define IQS62X_FW_REC_TYPE_DATA 4 +#define IQS62X_ATI_STARTUP_MS 350 #define IQS62X_FILT_SETTLE_MS 250 struct iqs62x_fw_rec { @@ -111,6 +112,14 @@ static int iqs62x_dev_init(struct iqs62x_core *iqs62x) int ret; list_for_each_entry(fw_blk, &iqs62x->fw_blk_head, list) { + /* + * In case ATI is in progress, wait for it to complete before + * lowering the core clock frequency. + */ + if (fw_blk->addr == IQS62X_SYS_SETTINGS && + *fw_blk->data & IQS62X_SYS_SETTINGS_CLK_DIV) + msleep(IQS62X_ATI_STARTUP_MS); + if (fw_blk->mask) ret = regmap_update_bits(iqs62x->regmap, fw_blk->addr, fw_blk->mask, *fw_blk->data); -- 2.7.4