From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolin Chen Subject: Re: [PATCH v1 01/15] ASoC: fsl_ssi: Clean up set_dai_tdm_slot() Date: Thu, 4 Jan 2018 11:08:37 -0800 Message-ID: <20180104190836.GB27975@Asurada-Nvidia> References: <1513702819-42310-1-git-send-email-nicoleotsuka@gmail.com> <1513702819-42310-2-git-send-email-nicoleotsuka@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pl0-f43.google.com (mail-pl0-f43.google.com [209.85.160.43]) by alsa0.perex.cz (Postfix) with ESMTP id 469EA267900 for ; Thu, 4 Jan 2018 20:08:24 +0100 (CET) Received: by mail-pl0-f43.google.com with SMTP id z5so1561522plo.10 for ; Thu, 04 Jan 2018 11:08:24 -0800 (PST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Maciej S. Szmigiero" Cc: alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, caleb@crome.org, timur@tabi.org, broonie@kernel.org, arnaud.mouiche@invoxia.com, lukma@denx.de, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org List-Id: alsa-devel@alsa-project.org On Mon, Jan 01, 2018 at 07:39:52PM +0100, Maciej S. Szmigiero wrote: > > /* The slot number should be >= 2 if using Network mode or I2S mode */ > > - regmap_read(regs, REG_SSI_SCR, &val); > > - val &= SSI_SCR_I2S_MODE_MASK | SSI_SCR_NET; > > - if (val && slots < 2) { > > + if (ssi->i2s_net && slots < 2) { > > dev_err(dai->dev, "slot number should be >= 2 in I2S or NET\n"); > > return -EINVAL; > > } > > Are you sure that ssi->i2s_net SSI_SCR_I2S_MODE_MASK | SSI_SCR_NET bits > (also known as SSI_SCR_I2S_NET_MASK) zero or non-zero status is always > consistent with that in the SCR register? > > I can see that in fsl_ssi_hw_params() these bits in SCR are zeroed in > a one special case and in the second special case they are hardcoded > to SSI_SCR_I2S_MODE_NORMAL | SSI_SCR_NET, in both cases regardless of > what is currently in ssi->i2s_net. You are right. I should update the i2s_net in hw_params() too. Thanks! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-x231.google.com (mail-pl0-x231.google.com [IPv6:2607:f8b0:400e:c01::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zCHQ36mb0zF0R0 for ; Fri, 5 Jan 2018 06:08:25 +1100 (AEDT) Received: by mail-pl0-x231.google.com with SMTP id bd8so1563631plb.9 for ; Thu, 04 Jan 2018 11:08:25 -0800 (PST) Date: Thu, 4 Jan 2018 11:08:37 -0800 From: Nicolin Chen To: "Maciej S. Szmigiero" Cc: timur@tabi.org, broonie@kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org, lgirdwood@gmail.com, fabio.estevam@nxp.com, caleb@crome.org, arnaud.mouiche@invoxia.com, lukma@denx.de, kernel@pengutronix.de Subject: Re: [PATCH v1 01/15] ASoC: fsl_ssi: Clean up set_dai_tdm_slot() Message-ID: <20180104190836.GB27975@Asurada-Nvidia> References: <1513702819-42310-1-git-send-email-nicoleotsuka@gmail.com> <1513702819-42310-2-git-send-email-nicoleotsuka@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Jan 01, 2018 at 07:39:52PM +0100, Maciej S. Szmigiero wrote: > > /* The slot number should be >= 2 if using Network mode or I2S mode */ > > - regmap_read(regs, REG_SSI_SCR, &val); > > - val &= SSI_SCR_I2S_MODE_MASK | SSI_SCR_NET; > > - if (val && slots < 2) { > > + if (ssi->i2s_net && slots < 2) { > > dev_err(dai->dev, "slot number should be >= 2 in I2S or NET\n"); > > return -EINVAL; > > } > > Are you sure that ssi->i2s_net SSI_SCR_I2S_MODE_MASK | SSI_SCR_NET bits > (also known as SSI_SCR_I2S_NET_MASK) zero or non-zero status is always > consistent with that in the SCR register? > > I can see that in fsl_ssi_hw_params() these bits in SCR are zeroed in > a one special case and in the second special case they are hardcoded > to SSI_SCR_I2S_MODE_NORMAL | SSI_SCR_NET, in both cases regardless of > what is currently in ssi->i2s_net. You are right. I should update the i2s_net in hw_params() too. Thanks!