Message ID | 20221109121354.123958-1-chancel.liu@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp300058wru; Wed, 9 Nov 2022 04:18:46 -0800 (PST) X-Google-Smtp-Source: AMsMyM5A2Ztc3qYS00j9B1+sre4ByQ6mdoxOeDxVyLTcMt1ZX/V6+Xx9Ngzuw3adxMfwr4+dcgoB X-Received: by 2002:aa7:9629:0:b0:56c:8c22:6d70 with SMTP id r9-20020aa79629000000b0056c8c226d70mr60869470pfg.8.1667996326266; Wed, 09 Nov 2022 04:18:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1667996326; cv=pass; d=google.com; s=arc-20160816; b=iHjVdHIg+Q1q553cMgxt+Eh+9winaLCFfiEDR7CrOShrmHB5yeuy4MYB69qfkhRw+L WBL9DIdtZj/61c3MqBt9mKwNyi8xVTnU8PlAnVN9Cb1qQYpja0TNlfuDVd/e6Y+MUKUo +IwKonrKAuf+vBABmN6w4c7PD5fzTVICLpS4L7ovxccFhC0g+gP8U2KN0NPqhZ1tZCOw 1yMjm9qJ8Jo3XEbSXcjfo0Wb+ap3mT4FT7F4tF0r0+R+p9GXcrYfWWMWfuEjB/Namy+f qG1xqRL+IOFCLB0PRQ44Qu5sTvairS/tsMwbvmRjm8sXdJ7gEOAVmGbWjXgufs0DRKYk 2ygw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=meXvWAYQLHTKW/kLWG1cbXretdZoiinvshd8gvzQE7I=; b=GLfdqLW3I56mkuRx2Jb7Q2ocGMNJI7p6Im4p8EULT7+1wSgNmUyzn/s0xG5SWZRkk2 GhsB1NGUwqU9XowbnZ9LHceHOQ55WbzM0yGjTSsc/0jaUo6oTSSvDyd3UqugXP39k4q5 kCKO2Zte27kwzyHqOP6syCcf41gPTyKQ60S1yLBsnh5upzodJLx5JYj0lY4Hgu9+Y6RX nYhCxpJfcGkYAPFo4HPTMihNToDE/x3bNnFPUBlESu+osDwaDTMGw31MaC68bvKuyupH 9w0v8VildKKnoR2flClSlepdKG0k3W4yZVuPFTlVTPXPNBRbIrYnshbjSnQ1WuhjVXSz XulA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=m9a+YZTJ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj8-20020a056a02018800b0046f94467a3bsi17537720pgb.76.2022.11.09.04.18.33; Wed, 09 Nov 2022 04:18:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=m9a+YZTJ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbiKIMRH (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Wed, 9 Nov 2022 07:17:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230165AbiKIMQu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Nov 2022 07:16:50 -0500 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20067.outbound.protection.outlook.com [40.107.2.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0458C326DA for <linux-kernel@vger.kernel.org>; Wed, 9 Nov 2022 04:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cWkhya6gQmNKPOEtL8+Gxy23dEevmTKwDs+Fm+8YOP/ug9sBWxkriUtGEeBmzSLKz9pVDCgU+7ypQfCQz6bb6xWntUKw0V7Pu2/tgh1ikKX4C13NgzLOZSopgW53RB7eZ3NARL9991vGVIz2rSpVdJcvw97E4BeUDwduC+WKw6wS/bAML4IFxBMQziXXtPUHapzTMky50SumG6z15udlE9DVF+F9Er+PfyH9lk6uhk57m1R9F/VhKxZzICF7KoWzFZlnX2P9lRokWmnFOsRo+PIOUG+k4OPyMeLQAAijo6JDNi2gvD7UYXo8sUIOSrUC3O4s37Zhj9PasSxzSK2fGA== 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=meXvWAYQLHTKW/kLWG1cbXretdZoiinvshd8gvzQE7I=; b=bvSO0s58MzDKg8fb0XXeIC8pRA9GcuS0M2+hKaofOGJZQGrG/wUWuV2tjQrCionKIT6oxrYYi/J0TLMH4W9CZlqnVRDNIw2wnZEsW6rc4J8Y8O0vdNQ7w7Fo3Xevjz1bVAaJWGpole8aVX+BemJ/0lcn67eS2GDQ18V1ckgeaH+GbkRO9g3xpAUw3IOItoQzpg0yQZQ63rhNYNqQZXX13cW/xQSraolo/jEyH4s24O/k1vy9nesklowMMzRKC+RITVfDcRc4mvGtFdAdhikdN9WePF6VbudA3eeN+E2ynnhNsbAS7olg9jq0PMPAvS12xYBX9ul4zVaYbFFrBpwBHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=meXvWAYQLHTKW/kLWG1cbXretdZoiinvshd8gvzQE7I=; b=m9a+YZTJgovYpy1ys9wP9bsznLgL7BNGOxJxz9yixD/bYVFznO/FGclXV2V/S/U7D3xr/027SraBJLrPwakIdcVOIh8EUH8jRpAVepnQLA/D5nwfWJA2DUzWnC2u5VHBmYEK6Z+mb757IqFmYOEGLiD6iNWkGSYeV7zliauL278= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4222.eurprd04.prod.outlook.com (2603:10a6:803:46::19) by DBAPR04MB7303.eurprd04.prod.outlook.com (2603:10a6:10:1af::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Wed, 9 Nov 2022 12:16:24 +0000 Received: from VI1PR04MB4222.eurprd04.prod.outlook.com ([fe80::d09d:ac92:bd65:c390]) by VI1PR04MB4222.eurprd04.prod.outlook.com ([fe80::d09d:ac92:bd65:c390%7]) with mapi id 15.20.5791.027; Wed, 9 Nov 2022 12:16:24 +0000 From: Chancel Liu <chancel.liu@nxp.com> To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ckeepax@opensource.cirrus.com, luca.ceresoli@bootlin.com, ojeda@kernel.org, cmo@melexis.com, u.kleine-koenig@pengutronix.de, xiaolei.wang@windriver.com, steve@sk2.org, chi.minghao@zte.com.cn, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, shengjiu.wang@nxp.com Cc: Chancel Liu <chancel.liu@nxp.com> Subject: [PATCH v2] ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register Date: Wed, 9 Nov 2022 20:13:54 +0800 Message-Id: <20221109121354.123958-1-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0009.apcprd02.prod.outlook.com (2603:1096:4:194::11) To VI1PR04MB4222.eurprd04.prod.outlook.com (2603:10a6:803:46::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB4222:EE_|DBAPR04MB7303:EE_ X-MS-Office365-Filtering-Correlation-Id: 148abf66-7991-4e11-c55c-08dac24c3801 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7PA8m8BIXRuuNN4pJKZMBwFIBVOW2XYWboCev9Hk+BdHBT5KJzgNib9QjfoOO2sXl5p/EkoL4FWSBL8pHHKIxylHHsqC3MZxiDkcr1nJIZHhFnG59N/YNGvc52yCY2HjmV0Zgx8VqQ/GSDLcEg2XZwf+7t0V8BlclZqHQTPz89L/W6j1BzEqvv4QJhRXThXbOqlBH/Szc2fL/xjTJw728WhMO8T8D2mwfFb3OQRp9vI2wzLwRl1loTxZQ3QtAJwHuUACMHim9a4QNnhhWei9lWe1v0UWfa56SjRQ1EU2GrMOfpYu0fxjKDyI6JXGPxRe02ea/SIJmnfwCdg6IqUH+khph4tG5E25Cfrde2eZjhshPqJBcpbeqT/3H+Gsus4XbJ/Zcx4O6qJpZJBRvmOi5nG2iSNmu2xck0EY2TxRF/1cs1VPxKyKQ06NXhygc6t5ftEg5JllfbFTXdwibBB/xz5MR7wPuqwsniYSXukcnpgoW8q71osceA1tkIAaMSDg6Tj+WAsFEFDJ9EIbt3aS4J/ubLdXewyYbEnJl/GNjCGF3Ulb/uh4d2vvv7t1zgB1mdUVTBH5w/kteTdOS6N0mfw1KVB6xL/p6ZRXvnpWpwVS2bpQsyw19fSl4D8pba3X0Dqihw7kmICona43CFTq6NSrXs9S8CxrqZMYMCh/Enq23J0mMastBEAkA//6QydW/llk3Qhp788t86TkfvYQPK3+8nHf4/JDr6ZBNNj8JAKy8C2Et3pmN8sphSzevyzUgQiOE+dA0NkYyQOdms85yA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB4222.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(396003)(366004)(346002)(136003)(451199015)(921005)(38350700002)(66476007)(26005)(36756003)(4326008)(66556008)(66946007)(6512007)(8676002)(41300700001)(478600001)(186003)(7416002)(44832011)(2616005)(6506007)(5660300002)(8936002)(6486002)(1076003)(15650500001)(52116002)(6636002)(316002)(38100700002)(6666004)(86362001)(83380400001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S1FMxEaod0SRO/3l2MTCV5WeLs2EbhN3Mo2YhDb0HBAwRs997vIZE1H1dTSDQFIz1cRCC+0o+xJbNVbl4UozK/+4dHCWKyz0CU+qJmFNnNzSeUfRxzDxQMn2cU00JWT56aOsLJSGfdMmyZTneae+b9QX4zBx7EtEWfvDbvy7U+JV7Jphe86jzSFR+Tcus/BI5DA+/sD4VgFU5TkDsjLIdPGp8Hbx7B0KkU+IcMyJvFUBELHyy1qwqwIA/6bZt5okOXbYKHpO9zoxuA8H8H8xBRyzbjsg7DRJPYWV07OBTppWwn7h7l7XjQabuJp4+1Lqe9ypbkTxkoHaqqV1u3pJhvTGf1gwoc223EebhmXjWijr4zsBOImus9p/xGbvRv64BTvjspHlohZG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guqD5wbMttoHOULUI7SACcHo8r14jJU6RpwBjewBQ0B4BgoVAX4CRQDgHs8LA5uvc3KmDUSvFz+C2EJjoDBD5j/fifvEuIHkQBRJtead6UBVog4ajS X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 148abf66-7991-4e11-c55c-08dac24c3801 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4222.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2022 12:16:24.3195 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CpeXjTqrehdqcLs0T6AVjiKUBgSKoLdgeRSxWFm2OzL98MpGb+l9NV626ur6FeaeW7OMH9KXOOfBv5Gydi0JNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7303 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749020915896275255?= X-GMAIL-MSGID: =?utf-8?q?1749020915896275255?= |
Series |
[v2] ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register
|
|
Commit Message
Chancel Liu
Nov. 9, 2022, 12:13 p.m. UTC
DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate
correct frequency of LRCLK and BCLK. Sometimes the read-only value
can't be updated timely after enabling SYSCLK. This results in wrong
calculation values. Delay is introduced here to wait for newest value
from register. The time of the delay should be at least 500~1000us
according to test.
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
sound/soc/codecs/wm8962.c | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
On Wed, Nov 09, 2022 at 08:13:54PM +0800, Chancel Liu wrote: > DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate > correct frequency of LRCLK and BCLK. Sometimes the read-only value > can't be updated timely after enabling SYSCLK. This results in wrong > calculation values. Delay is introduced here to wait for newest value > from register. The time of the delay should be at least 500~1000us > according to test. > > Signed-off-by: Chancel Liu <chancel.liu@nxp.com> > --- Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Thanks, Charles
On Wed, 9 Nov 2022 20:13:54 +0800, Chancel Liu wrote: > DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate > correct frequency of LRCLK and BCLK. Sometimes the read-only value > can't be updated timely after enabling SYSCLK. This results in wrong > calculation values. Delay is introduced here to wait for newest value > from register. The time of the delay should be at least 500~1000us > according to test. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register commit: 3ca507bf99611c82dafced73e921c1b10ee12869 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index b4b4355c6728..b901e4c65e8a 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -2503,6 +2503,14 @@ static void wm8962_configure_bclk(struct snd_soc_component *component) snd_soc_component_update_bits(component, WM8962_CLOCKING2, WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA); + /* DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate + * correct frequency of LRCLK and BCLK. Sometimes the read-only value + * can't be updated timely after enabling SYSCLK. This results in wrong + * calculation values. Delay is introduced here to wait for newest + * value from register. The time of the delay should be at least + * 500~1000us according to test. + */ + usleep_range(500, 1000); dspclk = snd_soc_component_read(component, WM8962_CLOCKING1); if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON)