From patchwork Mon Jan 15 23:16:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10165439 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 F106B602C2 for ; Mon, 15 Jan 2018 23:17:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E225D27B2F for ; Mon, 15 Jan 2018 23:17:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6CB327BFF; Mon, 15 Jan 2018 23:17:49 +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 10F3827B2F for ; Mon, 15 Jan 2018 23:17:49 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AEC1426761B; Tue, 16 Jan 2018 00:17:31 +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 C6B8D267621; Tue, 16 Jan 2018 00:17:29 +0100 (CET) Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by alsa0.perex.cz (Postfix) with ESMTP id 11B3526761A for ; Tue, 16 Jan 2018 00:17:24 +0100 (CET) Received: by mail-pl0-f67.google.com with SMTP id q2so4724442pll.3 for ; Mon, 15 Jan 2018 15:17:24 -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=LJuXv050Np3JcDgl70d84n5cIvZ9iHBDub9ftq2esEuM+xJPIg1jus0Qhxr2GcLn+1 csXTB/55QzLZkPy8/jx0QxoySYHryHHKF7r38m6u81m9XPqIiunxzPoYroG0osKnKTNQ mZC54i8A6wHDrK69oBbYUoTX/3+7iR3tznhsr678oS55TQtGEph0Hohp2FTqoOE6KJqp 4ZCaeGUZNd3adROGrUrYhBKpxC89rHT2JK3xPUFg35B63k3fR/26UcjFL8Za/0BLiVQc 96bK1cd8s/tOaYDdsmEQ2qH6d7GAIakPuqtIOVr1wVHEYo9bqFAzzN0bV7N/5OlRxu5h 2TOA== 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=Lce5rjRnO1h8/hXVgTW+v+m5XY2e8XbidNIsBU980129XJRk+MV04ffKLG3FGIVwA4 Be/OtaEFCbh7Q2N2NDC/B9Q6P4nYHC+iw4H2Lu2e5T16hczGkQ5VQF6UGfHWdl0aLo9y //mmdcS1acOxGEW6LXyhPWrufQbU1LiIQZpXEflFGXloOGnJBo2fns2SWAPcBaieoLuO lXOrsWNLYNXbyVQZVxS8zU/42Ae40XOQsz9Q+cIVBRBOe1tp1re1USEy53SyMHpDxW/Q +Zg0a8zsAuR64PImIuYUXaDtz1Gfu2eVPuae9kGuQvT+uRNM/KuwwDm4uoDyswS1cU6D ZOtw== X-Gm-Message-State: AKwxytdDHGQTnmbPW4hs+R5TCqg2vVX/IgEjnSXvhaZaLwBaeFjIRebz 84pd7YtsXxwozDGsAlkaqhU= X-Google-Smtp-Source: ACJfBot3NJoZCmf4aVe3Vx2gqRKfdNNAfqxjvekh6cBMMwFLBU2ZJLyujudE1vmaisUT2MPaj78gCQ== X-Received: by 10.84.133.161 with SMTP id f30mr4998763plf.124.1516058243433; Mon, 15 Jan 2018 15:17:23 -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 b6sm776442pfe.85.2018.01.15.15.17.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jan 2018 15:17:22 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Mon, 15 Jan 2018 15:16:17 -0800 Message-Id: <1516058192-65519-3-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516058192-65519-1-git-send-email-nicoleotsuka@gmail.com> References: <1516058192-65519-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 v4 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 */