Message ID | 1702953057-4499-1-git-send-email-shengjiu.wang@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-4633-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1687032dyi; Mon, 18 Dec 2023 19:12:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHk7AkoqRv2+HZTWI3Cm7Q98PXZ259TRdlA7ef7k7kR9/jmQ8uxkocNBzTZbW2R/DSwitJY X-Received: by 2002:a05:6a20:1012:b0:18f:97c:6143 with SMTP id gs18-20020a056a20101200b0018f097c6143mr17538599pzc.64.1702955564735; Mon, 18 Dec 2023 19:12:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702955564; cv=none; d=google.com; s=arc-20160816; b=cVe6Tg4ppDCZmLHggSMFNIr9wO8cL83j4M/5+pqT8F5Zv24gfJFnHqC1hcHAXqYKrx Oog8gm3hjGYxuJqu4kCPWEpbA9HudN1q1BQv0nl2Bto0i85nSVgYwU77+xp+ghu79QXy So8Oeak2qFf8/hcFd7sCB3vxxGvlnkxi5ALT+pkcKanTXIg+efpWXl+S/AOV9iqpYI4w C6xOQQkfeycoOATAQHmujNYaRA2A5UogAvazFtLCRRNrmsXPlzNWmZNd2ywoTPVW7B+R JgVXOHuNFkxduIYuniL0n2h4f9L2c4Nhr1SbI5+MkHkExCBCZ6FdvfmiSLk+GbQqomjD WrdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:to:from; bh=b0XBqSCXsrQiuQfCBNvUplId+WnXzZb0zwtGtqg4+gU=; fh=7R52BhHPm7zGb3JLJx+XW19T6EjLySf5VrXJfOQiNak=; b=JtEGOqmjvl3lzWiMrD1Gof34TzmFEchvyBW7hnv6YZTI+PNrh2bpVEnrbfEQlBpSRD rXQ8n+TbmZISt9QrHgyo9c1l3aV6mZfXtH5v7rcRbFuB+AQa3Rn2rIxgAqWjdxYhYuP5 GsmZgdKj3p36OocUBAyijP/6A1gzriSTJaPd+l40lIaCufUH4qaU7gcg2YpJxqNo7spM UcPzm/sv1h7nWxXdQOrlkzmW+mqz5wOAAAhuSHsTAcM0NcwozqomLJHumJcpVcnm6p+m 0BsxxPClXCvruksdeXd5CKTpSOsxqzdXp7K7EoEI/6j/W3ZTaGnR09DJr5maqx3vJCeR WBgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4633-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4633-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w4-20020a636204000000b005c66368cfb2si3842104pgb.451.2023.12.18.19.12.44 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 19:12:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4633-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4633-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4633-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A4E2BB215A4 for <ouuuleilei@gmail.com>; Tue, 19 Dec 2023 03:12:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4E1E63AC; Tue, 19 Dec 2023 03:12:29 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9142881E; Tue, 19 Dec 2023 03:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0AFCF200584; Tue, 19 Dec 2023 04:12:25 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C653C2005A1; Tue, 19 Dec 2023 04:12:24 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 0423E1802201; Tue, 19 Dec 2023 11:12:22 +0800 (+08) From: Shengjiu Wang <shengjiu.wang@nxp.com> To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org Subject: [PATCH v2] ASoC: fsl_sai: Fix channel swap issue on i.MX8MP Date: Tue, 19 Dec 2023 10:30:57 +0800 Message-Id: <1702953057-4499-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785678334500729445 X-GMAIL-MSGID: 1785678334500729445 |
Series |
[v2] ASoC: fsl_sai: Fix channel swap issue on i.MX8MP
|
|
Commit Message
Shengjiu Wang
Dec. 19, 2023, 2:30 a.m. UTC
When flag mclk_with_tere and mclk_direction_output enabled,
The SAI transmitter or receiver will be enabled in very early
stage, that if FSL_SAI_xMR is set by previous case,
for example previous case is one channel, current case is
two channels, then current case started with wrong xMR in
the beginning, then channel swap happen.
The patch is to clear xMR in hw_free() to avoid such
channel swap issue.
Fixes: 3e4a82612998 ("ASoC: fsl_sai: MCLK bind with TX/RX enable bit")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
changes in v2:
- add fixes tag
sound/soc/fsl/fsl_sai.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On Tue, Dec 19, 2023 at 5:12 AM Shengjiu Wang <shengjiu.wang@nxp.com> wrote: > > When flag mclk_with_tere and mclk_direction_output enabled, > The SAI transmitter or receiver will be enabled in very early > stage, that if FSL_SAI_xMR is set by previous case, > for example previous case is one channel, current case is > two channels, then current case started with wrong xMR in > the beginning, then channel swap happen. > > The patch is to clear xMR in hw_free() to avoid such > channel swap issue. > > Fixes: 3e4a82612998 ("ASoC: fsl_sai: MCLK bind with TX/RX enable bit") > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
On Tue, 19 Dec 2023 10:30:57 +0800, Shengjiu Wang wrote: > When flag mclk_with_tere and mclk_direction_output enabled, > The SAI transmitter or receiver will be enabled in very early > stage, that if FSL_SAI_xMR is set by previous case, > for example previous case is one channel, current case is > two channels, then current case started with wrong xMR in > the beginning, then channel swap happen. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: fsl_sai: Fix channel swap issue on i.MX8MP commit: 8f0f01647550daf9cd8752c1656dcb0136d79ce1 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 32bbe5056a63..546bd4e333b5 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -714,6 +714,9 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream, bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; unsigned int ofs = sai->soc_data->reg_offset; + /* Clear xMR to avoid channel swap with mclk_with_tere enabled case */ + regmap_write(sai->regmap, FSL_SAI_xMR(tx), 0); + regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, ofs), FSL_SAI_CR3_TRCE_MASK, 0);