Message ID | 20230530103012.3448838-1-chancel.liu@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2101768vqr; Tue, 30 May 2023 04:18:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6URpjMxXH18bubCJVRKoSF/y8KPs4sKC6ioNHvy0nbVozoz5x6bymxCN1KcKRvCqPemSCg X-Received: by 2002:a17:902:b404:b0:1b0:6c3e:363 with SMTP id x4-20020a170902b40400b001b06c3e0363mr619069plr.0.1685445530100; Tue, 30 May 2023 04:18:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685445530; cv=pass; d=google.com; s=arc-20160816; b=iMWNsWHsYI6SVHOI0MBsAWc3v/Zm3gO/fxOrXf8QmZNcBjuxiiDdHuYQjhfu5tRocz tY9cclwWVEbgCL7SW1xSZzW83Dv0aUysQwCFs5tD+xjufaEyN3xhDQmlMWKW5g+D/7iT CawvAUC3dK7tNzlfTpFIgsLiTbaA9iCdZajMWOcUVL5oXOZxa907BRYwGo4HK2H/SKOI cH3H02Iw8yoelS40YC0dBzlQU18uQGRO9rEIJYBfpYx3oY4YwKaafDcnx8JSPxmm92v5 COILa7tSDiJcVbNOSESWX3CJXmefKK9FtO0ODf8SlWGVb0nAEdVcqT95vRM4Fz1hwiQ9 TFhw== 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=f7AMVWF9xVZUTxz9DTSUBCzeMv6541p4nFNehZgUFrc=; b=c7NYwofWJ10LFcIchVG1mtGNZl+w+USUVI+gxn+eADh2FT1BWxikm5BvOFQrE9+G+D 2Lr90SrbW3as7t8Qprbi1S43CRzK3RUAXOKjIDKDi1t5jkIUz2hRMXlFmhaKmiI68/gk o30S2TWPTC+G97Sy/0LbsPTpooiLvoHfVo9D69z4U0n3uEZ7XXQTz/DRt9Chkr74sWag Tn1yfnK1oaJ8ZzG+NMgRHag0M6o7e1zQmf1y+E1c52Fqo9iwaSDj1AE17SzYPvTBcqsG C1ClX66zvdNkLbsXZdt3GoJOpe8fO0Ldx9+fgmSlnnig8M69HvGqKIQc+qH7/Xh+WkNt XPcw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=E8pygQAh; 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 a17-20020a1709027d9100b001a6e98a5f21si258291plm.586.2023.05.30.04.18.37; Tue, 30 May 2023 04:18:50 -0700 (PDT) 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=E8pygQAh; 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 S230417AbjE3Ka5 (ORCPT <rfc822;andrewvogler123@gmail.com> + 99 others); Tue, 30 May 2023 06:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230513AbjE3Kak (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 30 May 2023 06:30:40 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2083.outbound.protection.outlook.com [40.107.20.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EE8DEC for <linux-kernel@vger.kernel.org>; Tue, 30 May 2023 03:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AXGPBaXubFDmxCZy8hAbdHYBfxQJ6bm958tAsh4kEXQzTDI/1+6pzRsIGVxzXXGdYcmZAsy0F2IfelQGF71LW3YJcFfweaWJBxsIHH7EYn2TCzZuIVqNaSglXLPGou74H/KGlbMY6MiD+p95mXsOpNkDO5EhPv74dGyafM/ZbMLOkomusTsay4FdVbYTIVIfnS77wUD7lz22hN3LS7oXBjICYVBS13Mq4GY8W4KUW0iIyOgF3Xo8VKER/K8n52539WwwnVqhZS8yPmeX8tc70sjS9nGbldGj+J1/i08KH7kWBdL2hpzDnFjSd6fpnA0yhVVBzeeDjIlsV7VoQJugtA== 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=f7AMVWF9xVZUTxz9DTSUBCzeMv6541p4nFNehZgUFrc=; b=he/1mVkeB3i/IS0OlJDUsX3HZx7qljSn0wEppWyxSbPQ900tX/BlhvjnYr+QYtSLuPqHLNuRwvRyCC5s8XG1w/6OLptmao1XZMF3b+j0dr0sHYtouVwseRXt2jMfBkbCX8TvhGDfPsAA28p353npkjzCCkXslzoUoTVitUJk4qkh6VEmtKGez5X9SOPZ5ac+06tulRE1eLjhCVX/fN1Om93Fm0l+ItI0TcBxLgDJYsOS7w4sXZhemLrrNtZ0etoZg5XVTmslDdOfwGIE9vEaqMHt301gAb2Ac4vtE+IpUogfM+y5dg//KOhJzTDHm220zkCJAb3ESuyfQ8ZYIZcseg== 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=f7AMVWF9xVZUTxz9DTSUBCzeMv6541p4nFNehZgUFrc=; b=E8pygQAh2k/0oMxyPVN/b0Ee1935WI8fKJNQNNqyPkE0QjA3yORGY5i5OgWicNfv/5kOMyw4bz3s/YCpC6SKUAOG+9qoKbC5E1gTDt024xtSGitAMN4XfaMGw4FyrVUCovnvod0fNPNs/x8cXGPHjq9dYH9W4h+SJn1bsn6YSpo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) by DB9PR04MB8154.eurprd04.prod.outlook.com (2603:10a6:10:243::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 10:30:34 +0000 Received: from DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::a853:185d:bef3:e335]) by DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::a853:185d:bef3:e335%7]) with mapi id 15.20.6433.022; Tue, 30 May 2023 10:30:34 +0000 From: Chancel Liu <chancel.liu@nxp.com> To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com Cc: Chancel Liu <chancel.liu@nxp.com> Subject: [PATCH] ASoC: fsl_sai: Enable BCI bit if SAI works on synchronous mode with BYP asserted Date: Tue, 30 May 2023 18:30:12 +0800 Message-Id: <20230530103012.3448838-1-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0047.apcprd02.prod.outlook.com (2603:1096:4:196::14) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|DB9PR04MB8154:EE_ X-MS-Office365-Filtering-Correlation-Id: f2783b6e-80ff-46dd-459a-08db60f8e6fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ykOjkwBsf99AETd9DPGSaET+lDuFBNluxzKBFpRf6SGR2CgEI5S7njDInVmBzfiBrd0NMsKfO1Dk6zHSes7bjIXw6wjfcRBc28K9bt+TIrLHZNPTwgL3xO1mpT9B6cNdSmQBkSuDv/4E1FjzQh61FQEdnTdr+qE2mNz9pSWzk2X17Vbgf4eKaYtozmFXGk8i0GKekheFO1UrBC7Do5cgEx9dohxrLrbYHMSvReX0Wb1+0+9QmYrLb7UQcTk/LT4rxYt+2GFa9V9KQrzlcK96E07nIx+BXdGOnXJsknkL4wOq+YNsZaDP8UTgoUpbbgaZOyu/YhpnxE3ZOL/ZejYfm2YhW52UEZx/lsNd7t/DOhdfAPZPey1E7gDrzlEF6/SDxcR3GmGZfABBlHwLob6F+7neZprncW5g7hWCy6W8eVPgki/enZpkgpFQjYWxyLzvClleVf93WKAtF8vMuFwBwgPvzaeClAY4wcY4hs073esuVhkfzFhYObjMI6d6+v/OjN3y10OkrNs2msdbz3x0qqrDTXXgp7yhA5mJNfGoOlbK4c6SqOaoUlZ9Q+XAyUK/GQQdySGpr+pxIYp0DE+YhdRuPEpzy86XVma5CZg6dsAkUvs1WMNHUYBVBKUEGCTQMZanlRj/K42LlnyX/WRs0g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9498.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(366004)(396003)(376002)(136003)(451199021)(478600001)(8676002)(8936002)(7416002)(44832011)(5660300002)(36756003)(2906002)(86362001)(921005)(4326008)(66476007)(66556008)(66946007)(316002)(38350700002)(38100700002)(41300700001)(2616005)(186003)(1076003)(6506007)(6512007)(26005)(52116002)(6486002)(6666004)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vwnbwn9nptZY6f7/uhaM7y/qgzvCL+tRZ+X2gwd7IK2NFinRCWUxwHOkCYCiz5FAycBgBk2xKA6CAHrNfBBwcjBSYho3t6uhJ7dsyAKJpfHcC1TYlofxf8x3+k9k5q6v0q+gXd0vjYg7AMbYf8BUVhgAzGYU7YJD9aP5Q6VdRFG/EFx+ZpzlQK3YyLdBHmPZgSuSPzuE6ZGAKjwHuuxZLx9xFVisztRcg/jTbdfnff/kmS5Tl/fETYrU6QFqJm9MMSHu/w87VRi8UVaI9d2YrKwVnVVaIS1CZ/waYLw0krA9C0WvzuQ5HfUURKDURKH5MuRghFqrwf4viuWkr2WCReKwvhSyRxfXPLPxoI/0Q5Pkz2Y4tBfZc7/2bhz6VJ9fbYyRfv0WzqLcLJPd/Dh+hkYQto/tbUVJS3h496k8AEi1Z/77Pd8Qbtto55zgD5rdASUJTzuyBvqmDehTS7LTAGb6qhIEUlD7Uj44ht7LPobwI5wKKGv28+JW30GojAcyonfI3bGg2KDDowwnOBPbAPHgEKCoyuOEYK0ert3sKW6CWME/L3QVcaKQTEF+jj0ugVU7xupJKsGkR+bjaulkIQEP6UqxrmPkTZD/mIRq34+iB1vn440NUovv2MTAc1CrKX0TuEAm4besUja0aGq4T30ihw1lL9TZAOuRuLvWuzlLfTnq2deGSXOlGeR8zEelfibcAve/oy+PyTsmATssShmto4nKmOVhl0OtYUnpZoszKqiuX5moVajtlfbhImB2uJq57XFo3aAFhhVZ/rNVTkZ69bRE1I5l+KvW7qkqNDrLnczvGxn2qGIo3YGPFr0FEwspbDKokAxphPLTKKR1gJ0HcSsRJuxRqAuvkHxUcr/nXL/sQ6PYEI3emSB+e3cIhQPdHW+0zyRlomCV4KPPAIcz3Vw3GD3gBz8BHk62llsX85B0RAYOzx3Ia8OgNvXvw90YsF9S3Vp7xm0lnkxiSt3vXlNrIyg7Zs8ss30x0cdLY4hYtauna99piwMBIF8hEHRyvH5AACd/fZv4cWFG2sL1Bp/nIG7ZTijecpzcfYccPxavLO4mI6VOls/mU4MHK8fzJsFZM0TPq1k7LVrbvkmuXUn/ikNFgjbvSImfhkMhlhhOgtcB+wKrwrI/hYm8yGqQ9zgKy/BGKW7QU4GaYQuG38RDTp7cbJZszlQ7yEICqnWfStGyenFXSTOWQulHmbYMME3WrgLnsn1CG0xkX44eVw2jmSPENu8owXJfm0/H5PpxtWpfBqTFnU8NOEIOZ7ebSMe9o67l5q4mu6lrf7BavI0IUg9E4fpsXMelg3EjmNJIm8zSwVgwr5BzsO51kXQE9nUXEoPDm1J1ebVUyRLd7VRFG0SYXKNDYXN1XkoZpkXR9vwSHZTj5dtig78J9G8h/HNX0T+XlTToF2NHv/NMXrjwQQEIApRbA9eqoPV1cv71IQPwJEJpksa8nI05zSSzW5q/ee8hSSaqR92jJ9jF6ubx2dQWn9GtzdMrgW8I/mdLO4Gh2EE473B1vc3EuTgk1syrOB3xbGoz7m3OM2jsnonTRm9pnCNKJkpe+gE+q/tckr963pBkqZdpyYtZ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2783b6e-80ff-46dd-459a-08db60f8e6fc X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 10:30:34.8329 (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: CdH8IP4b2TEZEpm7aoQNh24qfsfZCbkyT6QngvZQNh10KMKeAwyeWb3GTdp/4hsP4mq1wHXzPElkv1GK28a/7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8154 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,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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?1767317731722554036?= X-GMAIL-MSGID: =?utf-8?q?1767317731722554036?= |
Series |
ASoC: fsl_sai: Enable BCI bit if SAI works on synchronous mode with BYP asserted
|
|
Commit Message
Chancel Liu
May 30, 2023, 10:30 a.m. UTC
There's an issue on SAI synchronous mode that TX/RX side can't get BCLK
from RX/TX it sync with if BYP bit is asserted. It's a workaround to
fix it that enable SION of IOMUX pad control and assert BCI.
For example if TX sync with RX which means both TX and RX are using clk
form RX and BYP=1. TX can get BCLK only if the following two conditions
are valid:
1. SION of RX BCLK IOMUX pad is set to 1
2. BCI of TX is set to 1
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
sound/soc/fsl/fsl_sai.c | 11 +++++++++--
sound/soc/fsl/fsl_sai.h | 1 +
2 files changed, 10 insertions(+), 2 deletions(-)
Comments
On Tue, 30 May 2023 18:30:12 +0800, Chancel Liu wrote: > There's an issue on SAI synchronous mode that TX/RX side can't get BCLK > from RX/TX it sync with if BYP bit is asserted. It's a workaround to > fix it that enable SION of IOMUX pad control and assert BCI. > > For example if TX sync with RX which means both TX and RX are using clk > form RX and BYP=1. TX can get BCLK only if the following two conditions > are valid: > 1. SION of RX BCLK IOMUX pad is set to 1 > 2. BCI of TX is set to 1 > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: fsl_sai: Enable BCI bit if SAI works on synchronous mode with BYP asserted commit: 32cf0046a652116d6a216d575f3049a9ff9dd80d 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/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index d9344025dc16..5e09f634c61b 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -491,14 +491,21 @@ static int fsl_sai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq) regmap_update_bits(sai->regmap, reg, FSL_SAI_CR2_MSEL_MASK, FSL_SAI_CR2_MSEL(sai->mclk_id[tx])); - if (savediv == 1) + if (savediv == 1) { regmap_update_bits(sai->regmap, reg, FSL_SAI_CR2_DIV_MASK | FSL_SAI_CR2_BYP, FSL_SAI_CR2_BYP); - else + if (fsl_sai_dir_is_synced(sai, adir)) + regmap_update_bits(sai->regmap, FSL_SAI_xCR2(tx, ofs), + FSL_SAI_CR2_BCI, FSL_SAI_CR2_BCI); + else + regmap_update_bits(sai->regmap, FSL_SAI_xCR2(tx, ofs), + FSL_SAI_CR2_BCI, 0); + } else { regmap_update_bits(sai->regmap, reg, FSL_SAI_CR2_DIV_MASK | FSL_SAI_CR2_BYP, savediv / 2 - 1); + } if (sai->soc_data->max_register >= FSL_SAI_MCTL) { /* SAI is in master mode at this point, so enable MCLK */ diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index 3eb994aef36a..8254c3547b87 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -116,6 +116,7 @@ /* SAI Transmit and Receive Configuration 2 Register */ #define FSL_SAI_CR2_SYNC BIT(30) +#define FSL_SAI_CR2_BCI BIT(28) #define FSL_SAI_CR2_MSEL_MASK (0x3 << 26) #define FSL_SAI_CR2_MSEL_BUS 0 #define FSL_SAI_CR2_MSEL_MCLK1 BIT(26)