Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928AbeADTI1 (ORCPT + 1 other); Thu, 4 Jan 2018 14:08:27 -0500 Received: from mail-pl0-f49.google.com ([209.85.160.49]:41487 "EHLO mail-pl0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752848AbeADTIY (ORCPT ); Thu, 4 Jan 2018 14:08:24 -0500 X-Google-Smtp-Source: ACJfBotC8M1dx1ooekLIaE3mg58dROnKeGcsE5uGGsXA7L7drZl46zeh/EfjEkeER7eSkroKA0SVfg== 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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!