From patchwork Mon Jan 15 04:21:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10162983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84826601C0 for ; Mon, 15 Jan 2018 04:22:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8634928904 for ; Mon, 15 Jan 2018 04:22:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AC95289FD; Mon, 15 Jan 2018 04:22:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A85C128904 for ; Mon, 15 Jan 2018 04:22:40 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0D5B726732C; Mon, 15 Jan 2018 05:22:23 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A7E7C267338; Mon, 15 Jan 2018 05:22:21 +0100 (CET) Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by alsa0.perex.cz (Postfix) with ESMTP id CDEA326731C for ; Mon, 15 Jan 2018 05:22:17 +0100 (CET) Received: by mail-pl0-f66.google.com with SMTP id s3so2803048plp.4 for ; Sun, 14 Jan 2018 20:22:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=73kjoeOA7be+Bz2PGSf++6LeW9rBrioGXyyKL6CtdX0=; b=VJYR1ix1/7KMrL4ojXayqRlupiD/g88zNWz5hjVr86Gtsj0Bhy9aNMZT8Ejw3zx+Oh H87GQR4K7gHE9LhvKfF+9azDzjZccA2xcrWJxbusOloZPA4baf4MNh/Q6ay0OLtV4DmP 2VGiZjlTFbU7w2gNp1sZhTNkhiMRyzA1iLeLvSM7VZ4xQR4JV9xacpupmdpZJQ9NlR3t vkjOwWMMVGV729NGca1IrUSJ0Vx1E4BL8mpoXEeS4K9SMTRE/6XH+Yh7FDzyr67jc3b1 sjDDWWmuD5T+YyqiiRc/6XpSRliwM24wqE+fY5MtlKILdS08/VUj4xGZOx4dkaLc83+0 c9Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=73kjoeOA7be+Bz2PGSf++6LeW9rBrioGXyyKL6CtdX0=; b=k+yPbYsKny6PUBa3r35O4LpXqCWvCSQ/a8zapqYGzSkLmcIrmaCKwF2O2I8g/aZfVK Ddubm0GR8kls3RF2CUwM5hweqJ/AXl1qGW7OmVYLfpzOPn1NQXqM+aw/Wk9g+uOwe7CE cUeta8hO6IWjKS3lKYZvA87sMBv+NGsfXJ0QROuu2JQ/vy0lZ0nxgmrfqRN8eRfBoRYI UzOfMSck8sebSYEv6ocQmdxLu/bayFNZyWC9tT/IqXTnm8nrME+2O1OrdWEq4za2z8EN Gd5GNTSvWlc6jSSQnybzv19B3IFl6AstI1+zR4naCtn3ZHCrYjDsbkbVk7zPi5cQcnSD /HOg== X-Gm-Message-State: AKGB3mJSEv7iAuyTYsZVlfVh+IaiS4ZIihVNJvXiK/sV6DwTYZ1ZXle7 E1vBQvP1piyXltIUwPBU/cc= X-Google-Smtp-Source: ACJfBouxxCZ1fLyyHBEaBMuoxu3bSw3IgdU/wMiakj0cgvS7KtN4b32ilYCRU0cDKTR/elKkDCULqQ== X-Received: by 10.84.128.100 with SMTP id 91mr33587569pla.71.1515990136702; Sun, 14 Jan 2018 20:22:16 -0800 (PST) Received: from Asurada-CZ80.localdomain (c-73-231-2-134.hsd1.ca.comcast.net. [73.231.2.134]) by smtp.gmail.com with ESMTPSA id v7sm17011018pgs.83.2018.01.14.20.22.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 14 Jan 2018 20:22:16 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Sun, 14 Jan 2018 20:21:12 -0800 Message-Id: <1515990087-11598-3-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515990087-11598-1-git-send-email-nicoleotsuka@gmail.com> References: <1515990087-11598-1-git-send-email-nicoleotsuka@gmail.com> Cc: alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org, caleb@crome.org, lgirdwood@gmail.com, arnaud.mouiche@invoxia.com, lukma@denx.de, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH v3 02/17] ASoC: fsl_ssi: Keep ssi->i2s_net updated X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The hw_params() overwrites i2s_net settings for special cases like mono-channel support, however, it doesn't update ssi->i2s_net as set_dai_fmt() does. This patch removes the local i2s_net variable and directly updates ssi->i2s_net in the hw_params() so that the driver can simply look up the ssi->i2s_net instead of reading the register. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 001e453..9847a1d 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -838,16 +838,16 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, } if (!fsl_ssi_is_ac97(ssi)) { - u8 i2s_net; /* Normal + Network mode to send 16-bit data in 32-bit frames */ if (fsl_ssi_is_i2s_cbm_cfs(ssi) && sample_size == 16) - i2s_net = SSI_SCR_I2S_MODE_NORMAL | SSI_SCR_NET; - else - i2s_net = ssi->i2s_net; + ssi->i2s_net = SSI_SCR_I2S_MODE_NORMAL | SSI_SCR_NET; + + /* Use Normal mode to send mono data at 1st slot of 2 slots */ + if (channels == 1) + ssi->i2s_net = SSI_SCR_I2S_MODE_NORMAL; regmap_update_bits(regs, REG_SSI_SCR, - SSI_SCR_I2S_NET_MASK, - channels == 1 ? 0 : i2s_net); + SSI_SCR_I2S_NET_MASK, ssi->i2s_net); } /* In synchronous mode, the SSI uses STCCR for capture */