Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2463802ybg; Thu, 30 Jul 2020 23:33:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysP7XZ5qX+lrWOl7OAOG0AOgEgXIf1lgByJl/bd2Zm0NqigxnevGgjIlhM7FRe7sub+6Zm X-Received: by 2002:a17:906:6146:: with SMTP id p6mr2653672ejl.211.1596177226660; Thu, 30 Jul 2020 23:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596177226; cv=none; d=google.com; s=arc-20160816; b=ZX13W8GljDj8frVIyxxZiz6csaZASJqvjiov/CU07PMDrkYPbeZI6PQmrv4I3nPYz8 oJWuWcxyJK9s1bsf60JxTVhQcndOjSaMCgIz6vZ+yJgeBetah1YQHVsijfpLvxC/O1nL +DM58UbMXUjNVT3sitNbqY2831vlcIkivIBadI13jFrrFa6UgAJ2xsTehb3M3JGpVp/y WMbrF8lqgeDfkEoDHTQ79W3Q1yTlWP0nU5yK8Rtr6Md9YcTKGL9hUknRXXUH3IGnVoNY jw8/AIcwfj1Li1gA+EWnDh8fA4Y9iLDOM209pbWQwQPc2j9d9aOzJPljftY9clHw8FDo 4JaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=mXG77ZgkPX0FnrI+5q2F2I4o14Lx95WpBv4MGziu728=; b=HUJjNQK9LdxhhurnbSzDzUuBPT/uYIBWYPK1nU9vHKRcRNM8sFdJli39P51BWpzVhf lCmUbJ2B+QpySwdkalWCO0Aeh9KDyt+UG79/NFXNj9MmgzKGsLkPZvXZIwPb64oCfTtt s1BrtHSB7XkGJUHW+NSMjtIt+CRc5JxQiyg3tYYjaKgqHdJpr8FTjIU0YEIUc84f6HYn Q/VWD38hi3Lb0ETV9/pMJYgup5THH/veqBZkvKhEh0NlKggkuK1/9/9CeDoJ9KGno4P2 54V4nTeWKd7KmHff8j3Lx/AnP1b+t4l/I2AOq2N7bKky03f1foGEuzVmx0cyQDulhUva nTag== ARC-Authentication-Results: i=1; mx.google.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si5105639edl.506.2020.07.30.23.33.23; Thu, 30 Jul 2020 23:33:46 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731375AbgGaGcm (ORCPT + 99 others); Fri, 31 Jul 2020 02:32:42 -0400 Received: from inva021.nxp.com ([92.121.34.21]:36526 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731224AbgGaGcm (ORCPT ); Fri, 31 Jul 2020 02:32:42 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A71972003B3; Fri, 31 Jul 2020 08:32:40 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3CEF52003BA; Fri, 31 Jul 2020 08:32:36 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6B8BE402BF; Fri, 31 Jul 2020 08:32:30 +0200 (CEST) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@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 Subject: [PATCH] ASoC: fsl_sai: Fix value of FSL_SAI_CR1_RFW_MASK Date: Fri, 31 Jul 2020 14:28:15 +0800 Message-Id: <1596176895-28724-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 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 fifo_depth is 64 on i.MX8QM/i.MX8QXP, 128 on i.MX8MQ, 16 on i.MX7ULP. Original FSL_SAI_CR1_RFW_MASK value 0x1F is not suitable for these platform, the FIFO watermark mask should be updated according to the fifo_depth. Fixes: a860fac42097 ("ASoC: fsl_sai: Add support for imx7ulp/imx8mq") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_sai.c | 5 +++-- sound/soc/fsl/fsl_sai.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index a22562f2df47..cdff739924e2 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -680,10 +680,11 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0); regmap_update_bits(sai->regmap, FSL_SAI_TCR1(ofs), - FSL_SAI_CR1_RFW_MASK, + FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth), sai->soc_data->fifo_depth - FSL_SAI_MAXBURST_TX); regmap_update_bits(sai->regmap, FSL_SAI_RCR1(ofs), - FSL_SAI_CR1_RFW_MASK, FSL_SAI_MAXBURST_RX - 1); + FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth), + FSL_SAI_MAXBURST_RX - 1); snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx, &sai->dma_params_rx); diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index 76b15deea80c..6aba7d28f5f3 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -94,7 +94,7 @@ #define FSL_SAI_CSR_FRDE BIT(0) /* SAI Transmit and Receive Configuration 1 Register */ -#define FSL_SAI_CR1_RFW_MASK 0x1f +#define FSL_SAI_CR1_RFW_MASK(x) ((x) - 1) /* SAI Transmit and Receive Configuration 2 Register */ #define FSL_SAI_CR2_SYNC BIT(30) -- 2.27.0