From patchwork Wed Jan 17 06:51:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10168613 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 9100160386 for ; Wed, 17 Jan 2018 06:53:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D5E127B81 for ; Wed, 17 Jan 2018 06:53:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71C9E27F10; Wed, 17 Jan 2018 06:53:09 +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 B31BD27B81 for ; Wed, 17 Jan 2018 06:53:08 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2D934266FEA; Wed, 17 Jan 2018 07:52:33 +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 457B3266F72; Wed, 17 Jan 2018 07:52:28 +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 65E30266FA1 for ; Wed, 17 Jan 2018 07:52:26 +0100 (CET) Received: by mail-pl0-f66.google.com with SMTP id bi12so8109479plb.6 for ; Tue, 16 Jan 2018 22:52:26 -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=sfVqEIIM0ZTtgq8KHykQCvXhMPzPoRGxi9VEPDI/dhzwU7nuGkXDdl6RKaHcc4NRJB W3SOOWje3aUbfw3S2LTcYdQM7ft6f33MfM5A7bTBdY7nUqj/4B99S3/GaL4ZC5ZPxLqG j3386Icv9QgKGmcT00H00CRMpBe1AX7ALs9Z5zG6Bal7O/KHg4Rq35S4ff15h6EwSpAj utMHG/th8gpUwPTgENNDofPUIw3WN3ACF0aShqD/L0E7Ea7mDmWzChkF1AeyoQZK6Kic h33IG3J66NqK3pUrPnZbZuYD8PUh0A/riFEwjnwgXBWIchnO61y1cHJvzQuK53TwnLWn ib1w== 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=YdtMtGvGyQs1chWCKnCaO435qTxg4dpTAJn7rYaTLWRJYiGwRM0ZqMcSqmOS2pruhw Wsi0d8gvkTzUfkHK06thd+iUMyp7My6Z/DAe0tK2i+X841E9vGfOGhEufn5dD/mnuSW2 AJh2dGsCzwMtfuLrAzh6xBiggwFQ4/pt95mF/9UFqcrJ/7PWNhZRo1735V9DqwLi2t2o Q55TpcIwPg8vSrTtPOmTsEWY6T2pNgtmPOGPfJWnj0+jl/iUSpiqUKJA79RHA3+dr3xW s39Lj+LgcXkgVG2X5qi33AO7y9rgSK/1E+LT5ePPK5FQM2mCL9YQpKKDZFEo1KhBVNyB 7kRA== X-Gm-Message-State: AKwxytd0eMqYMIieGL98NMOHV0VudU8X5fE78OjJPS7PMZKDb66yPW+O oRe2wlOw80Thq/GG3E5rEHQ= X-Google-Smtp-Source: ACJfBotIwx2uGE8Vl1z/7XL2BY2g1B7Up4InrG+OsQ1s9XFQbLpAsOYoFUD31VDBDorAudMFEZWFhA== X-Received: by 10.84.131.163 with SMTP id d32mr2909619pld.193.1516171945155; Tue, 16 Jan 2018 22:52:25 -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 e185sm7503221pfg.155.2018.01.16.22.52.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jan 2018 22:52:24 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Tue, 16 Jan 2018 22:51:27 -0800 Message-Id: <1516171902-32669-3-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516171902-32669-1-git-send-email-nicoleotsuka@gmail.com> References: <1516171902-32669-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 v5 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 */