From patchwork Fri Sep 13 19:28:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Baluta X-Patchwork-Id: 173788 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp558680ilq; Fri, 13 Sep 2019 12:28:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaGxj8m6E/CuGzUgWCTIeH7/cb7PQICtEj695pLRJ+7YLsiNJxbVzEMuLIX/VKNHCjAatJ X-Received: by 2002:aa7:c586:: with SMTP id g6mr28588434edq.38.1568402897167; Fri, 13 Sep 2019 12:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568402897; cv=none; d=google.com; s=arc-20160816; b=pYrOGa94dUhjBMwXCKQ6dLxl0+pn0xnw7wh1m2QQpVP1esRiFILiHJHkyQC7tpivlo v8dzNvrRJK2uYopzRavvO/Ox5z9JFIRXlkMWWXwdEzX4mhiFEUJDrChqFfhIcp4JNEN+ mKtLKvFmMFEKEZVEprwtS062/31i1wxWuBuVa++bM3lJJgz4c2FLqI6qDec9i0dNYaaJ 8B6dlm0NvYFV2DPKduDVLnDzDmf8chwXcsYUbfrbRfK83FXNWxNH3Hzni2sZ83GqRjR0 aKPI2gPZWZbTwkpFM46VwMTc9lzsUJHQm//tmQjPWNTzVa/UVvJgJa9vrtn88eILLyJC qfGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Iqy9+9G+1JGHkI2VRVONnMUrdqgcLEHWXzZWxUZMFf4=; b=GYqzqlG54AWhaq/ANltR3lev6PyCpe65E/OSb3iZvuYYTU23ekEDpDvXb/0+2Pvvbr 32XlyrsTlPClCpejvVlmGjTw1u3ci3z8seJbyzhGbAgCKxrWFb6Sj0UwQsx/O/+NT+Fe 1fv9apKCZyZ+5MRHvMKR7qIXGHdkOOFlssGhW0XrMLDStKHYIvCR2Wf9+ube6zvoE/W9 UOy/OtRF+D6Y5pEKTF8o9jAPcH0kfMP8mVPhXjeWFDOHDrrEaeZe+uwQscBGF1RM4ySI 8HRoRHJTmyTFLws/U0dLsMTM1Sh54VjPZwQ/Xp0q+5AUAjO5Q+BXL9lJ38pLkKyND7RX LwtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si7812474edj.0.2019.09.13.12.28.17; Fri, 13 Sep 2019 12:28:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730735AbfIMT2N (ORCPT + 27 others); Fri, 13 Sep 2019 15:28:13 -0400 Received: from inva020.nxp.com ([92.121.34.13]:41854 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729471AbfIMT2M (ORCPT ); Fri, 13 Sep 2019 15:28:12 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 2D3CB1A0189; Fri, 13 Sep 2019 21:28:11 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 204D41A00D0; Fri, 13 Sep 2019 21:28:11 +0200 (CEST) Received: from fsr-ub1864-103.ea.freescale.net (fsr-ub1864-103.ea.freescale.net [10.171.82.17]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 93EEE205DB; Fri, 13 Sep 2019 21:28:10 +0200 (CEST) From: Daniel Baluta To: broonie@kernel.org Cc: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Mihai Serban , Daniel Baluta Subject: [PATCH v2 1/3] ASoC: fsl_sai: Fix noise when using EDMA Date: Fri, 13 Sep 2019 22:28:05 +0300 Message-Id: <20190913192807.8423-2-daniel.baluta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190913192807.8423-1-daniel.baluta@nxp.com> References: <20190913192807.8423-1-daniel.baluta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mihai Serban EDMA requires the period size to be multiple of maxburst. Otherwise the remaining bytes are not transferred and thus noise is produced. We can handle this issue by adding a constraint on SNDRV_PCM_HW_PARAM_PERIOD_SIZE to be multiple of tx/rx maxburst value. Signed-off-by: Mihai Serban Signed-off-by: Daniel Baluta --- Changes since v1: * rename variable to use_edma as per Nicolin's suggestion. sound/soc/fsl/fsl_sai.c | 15 +++++++++++++++ sound/soc/fsl/fsl_sai.h | 1 + 2 files changed, 16 insertions(+) -- 2.17.1 Acked-by: Nicolin Chen diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index ef0b74693093..b517e4bc1b87 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -628,6 +628,16 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream, FSL_SAI_CR3_TRCE_MASK, FSL_SAI_CR3_TRCE); + /* + * EDMA controller needs period size to be a multiple of + * tx/rx maxburst + */ + if (sai->soc_data->use_edma) + snd_pcm_hw_constraint_step(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, + tx ? sai->dma_params_tx.maxburst : + sai->dma_params_rx.maxburst); + ret = snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &fsl_sai_rate_constraints); @@ -1026,30 +1036,35 @@ static int fsl_sai_remove(struct platform_device *pdev) static const struct fsl_sai_soc_data fsl_sai_vf610_data = { .use_imx_pcm = false, + .use_edma = false, .fifo_depth = 32, .reg_offset = 0, }; static const struct fsl_sai_soc_data fsl_sai_imx6sx_data = { .use_imx_pcm = true, + .use_edma = false, .fifo_depth = 32, .reg_offset = 0, }; static const struct fsl_sai_soc_data fsl_sai_imx7ulp_data = { .use_imx_pcm = true, + .use_edma = false, .fifo_depth = 16, .reg_offset = 8, }; static const struct fsl_sai_soc_data fsl_sai_imx8mq_data = { .use_imx_pcm = true, + .use_edma = false, .fifo_depth = 128, .reg_offset = 8, }; static const struct fsl_sai_soc_data fsl_sai_imx8qm_data = { .use_imx_pcm = true, + .use_edma = true, .fifo_depth = 64, .reg_offset = 0, }; diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index b12cb578f6d0..76b15deea80c 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -157,6 +157,7 @@ struct fsl_sai_soc_data { bool use_imx_pcm; + bool use_edma; unsigned int fifo_depth; unsigned int reg_offset; }; From patchwork Fri Sep 13 19:28:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Baluta X-Patchwork-Id: 173789 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp558689ilq; Fri, 13 Sep 2019 12:28:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7Rz3/ihAOlwMYVNI64kI9+rE1QxxFJBH7Vtq+oqiNYdOicj9FPWBzYxTh+sgdq/L4JSa9 X-Received: by 2002:a17:906:860d:: with SMTP id o13mr867264ejx.284.1568402897532; Fri, 13 Sep 2019 12:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568402897; cv=none; d=google.com; s=arc-20160816; b=B2VgsW63LgTBUndHVCz3kc+T2pEwmQLBMKsZCPY5QVcC0eSm/xBHntNGY+FiuQWVY5 UhDTXS7drBitX/oMEvllDLEqP/P4oRHa5gqXWbJbavkhFksG2sEVMeyCnggSh6fxh8UW lkcdfy1IkxGGDRdZE6q6sFr3JYvEuoaKOC+KvcADssJiQh0QbkihE5TEqdMtpNlmNirT KkDBP4JpdlBE/+zBc5nzTogj+dHFhQAi8iwl664cVWhQMSE65944mSBVQQUzGtj903Tl NCchlRmpjhu63X14fGydMu3wPKqn29nCon5KuHH6P6fzmUpMyeyep9uJvTyDeqfL4XDU WGgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Jce4LvTz4NSAR129qqI8ufD1ObORqIhZ4kMoj3+4elE=; b=EQrlxs28pkXlpV4gT7Y9ei+Cb5x0mtCV8RV+38gIlSeFjnnHO4tsghw16sp8wxrK5T Dh7hPmtED+/Tg3FkhudgqgzFL5/uG2DL7X4IqIu1pY2eJ5B5KKvYrQuFEYR8EhOLDhhy mmm1bsChnGYdfMKyZZlWcvsJ4ee4QZh84V4nOxGYLj0DS+ANqoYpqfE5LIxQMYwpnsd9 1emWmnJnlw6tJIV9NpJvDhbYT/ihtN+Qy6qi10So2IrIJMdW1zEENCwMciZcrO787LlZ 2RNg4A38ayb2KHuQWyuGSyMQRq/vCwoiWKX1rVt9aEC9OoT5el09mvnqwGW8V3FuBqlT oMMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si7812474edj.0.2019.09.13.12.28.17; Fri, 13 Sep 2019 12:28:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388030AbfIMT2P (ORCPT + 27 others); Fri, 13 Sep 2019 15:28:15 -0400 Received: from inva021.nxp.com ([92.121.34.21]:43364 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729652AbfIMT2N (ORCPT ); Fri, 13 Sep 2019 15:28:13 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C655A200785; Fri, 13 Sep 2019 21:28:11 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B9F6420076D; Fri, 13 Sep 2019 21:28:11 +0200 (CEST) Received: from fsr-ub1864-103.ea.freescale.net (fsr-ub1864-103.ea.freescale.net [10.171.82.17]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 3037E205DB; Fri, 13 Sep 2019 21:28:11 +0200 (CEST) From: Daniel Baluta To: broonie@kernel.org Cc: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Shengjiu Wang , NXP Linux Team , Daniel Baluta Subject: [PATCH v2 2/3] ASoC: fsl_sai: Fix xMR setting in synchronous mode Date: Fri, 13 Sep 2019 22:28:06 +0300 Message-Id: <20190913192807.8423-3-daniel.baluta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190913192807.8423-1-daniel.baluta@nxp.com> References: <20190913192807.8423-1-daniel.baluta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shengjiu Wang When Tx is synchronous with receiver the RMR should not be changed. When Rx is synchronous with transmitter the TMR should not be changed. Cc: NXP Linux Team Signed-off-by: Shengjiu Wang Signed-off-by: Daniel Baluta --- Changes since v1: * new patch sound/soc/fsl/fsl_sai.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.17.1 diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index b517e4bc1b87..6598a1ae0a2d 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -482,8 +482,6 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(sai->regmap, FSL_SAI_TCR5(ofs), FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); - regmap_write(sai->regmap, FSL_SAI_TMR, - ~0UL - ((1 << channels) - 1)); } else if (!sai->synchronous[RX] && sai->synchronous[TX] && tx) { regmap_update_bits(sai->regmap, FSL_SAI_RCR4(ofs), FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK, @@ -491,8 +489,6 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(sai->regmap, FSL_SAI_RCR5(ofs), FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); - regmap_write(sai->regmap, FSL_SAI_RMR, - ~0UL - ((1 << channels) - 1)); } } From patchwork Fri Sep 13 19:28:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Baluta X-Patchwork-Id: 173790 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp558736ilq; Fri, 13 Sep 2019 12:28:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY00JLMI1acuQVq0xxw+YhZt8AlF47X5AsBk2NqG6rAVRQ6qbggqSOAtb/ZdZWwcIDeGOS X-Received: by 2002:a17:906:8406:: with SMTP id n6mr10632517ejx.138.1568402900592; Fri, 13 Sep 2019 12:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568402900; cv=none; d=google.com; s=arc-20160816; b=yZX3hpssDZ9eOgM3wzin+pxH9R73zwMvECyB2jnbyOycBGXMkeKKY1vlPlUG+aCs/e CxYAg3J/l/gEEIFVmFLlg5vedi01BnTsl1jcN0dWILm6nVP+HRzhuxBe3UpR6AVfDvHI gBMfZM1ousmZZ39AD4axWtgzmZolZOQKIqtEPJ3Mq2eyOZij7QzykQ9GcagNkr+VtXHZ ffzWyDTJ5Ru7oBA3tRAxY6dmv3/WjlRrGhe9fZ+EHu4P1OwySlT0hYk83tPwjxm4YMcm bfB8omBvyCletEiXGFmWSfGCM5hjJerECsL8SRnLGjbFeQwsR4JPdXNtMfpnIB6kBFbe PHIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=E0OfHsxak/xMa+Fwwh8VZWchsiJ/dkS/JxH0RE0zjc8=; b=h41C3kMjAqndSP64OLEYYD1uh3cE/rZshU97H/0RcJUsUYFHCJ8NxVQWglEbvZWuDj 3lSRXKiNYF08DZq596QXZR2VRi7hSaQVzQVFH9bYRYzBsuxg4U0SIvYGt4Hb6ZWZiKqV At5IA9wqkYW4ApE+MPmaPIZahaFxebVhMzlyMLR0dgOWp9PXK+5gzFpC4OqtCcCN4V0+ f9OiD42sYomz7QqrRQeVuZYv8VsPfNFsKXYJUJAHh6kPJLtYpLnohyggPnfY7xytpaZk /bbiq509Od4f38C+Lo4OhSVgZiA4eDVkK+8x2BFVBr1Z13+kt/bgIvba1AoLnyCMV493 Wg0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si7812474edj.0.2019.09.13.12.28.20; Fri, 13 Sep 2019 12:28:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730809AbfIMT2T (ORCPT + 27 others); Fri, 13 Sep 2019 15:28:19 -0400 Received: from inva020.nxp.com ([92.121.34.13]:41876 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729340AbfIMT2O (ORCPT ); Fri, 13 Sep 2019 15:28:14 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6482E1A073C; Fri, 13 Sep 2019 21:28:12 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5730D1A0352; Fri, 13 Sep 2019 21:28:12 +0200 (CEST) Received: from fsr-ub1864-103.ea.freescale.net (fsr-ub1864-103.ea.freescale.net [10.171.82.17]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id C9E43205DB; Fri, 13 Sep 2019 21:28:11 +0200 (CEST) From: Daniel Baluta To: broonie@kernel.org Cc: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Daniel Baluta , NXP Linux Team Subject: [PATCH v2 3/3] ASoC: fsl_sai: Fix TCSR.TE/RCSR.RE in synchronous mode Date: Fri, 13 Sep 2019 22:28:07 +0300 Message-Id: <20190913192807.8423-4-daniel.baluta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190913192807.8423-1-daniel.baluta@nxp.com> References: <20190913192807.8423-1-daniel.baluta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SAI transmitter and receiver can be configured to operate with synchronous bit clock and frame sync. When Tx is synchronous with receiver RCSR.RE should be set in playback to enable the receiver which provides bit clock and frame sync. When Rx is synchronous with transmitter TCSR.TE should be set in record to enable the transmitter which provides bit clock and frame sync. Cc: NXP Linux Team Signed-off-by: Daniel Baluta --- Changes since v1: * new patch sound/soc/fsl/fsl_sai.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 6598a1ae0a2d..a59300e37549 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -539,8 +539,8 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, sai->synchronous[RX] ? FSL_SAI_CR2_SYNC : 0); /* - * It is recommended that the transmitter is the last enabled - * and the first disabled. + * it is recommended that the asynchronous block to be the last enabled + * and the first disabled */ switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -549,9 +549,11 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs), FSL_SAI_CSR_FRDE, FSL_SAI_CSR_FRDE); - regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), - FSL_SAI_CSR_TERE, FSL_SAI_CSR_TERE); - regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), + if (sai->synchronous[tx]) + regmap_update_bits(sai->regmap, FSL_SAI_xCSR(!tx, ofs), + FSL_SAI_CSR_TERE, FSL_SAI_CSR_TERE); + + regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs), FSL_SAI_CSR_TERE, FSL_SAI_CSR_TERE); regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs),