From patchwork Thu Jan 11 06:43:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10157277 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 AC763605BA for ; Thu, 11 Jan 2018 06:44:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E504285C8 for ; Thu, 11 Jan 2018 06:44:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92A74286B5; Thu, 11 Jan 2018 06:44:17 +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 A7213285C8 for ; Thu, 11 Jan 2018 06:44:16 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4A90E266F3E; Thu, 11 Jan 2018 07:44:13 +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 6332E266F67; Thu, 11 Jan 2018 07:44:08 +0100 (CET) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by alsa0.perex.cz (Postfix) with ESMTP id C180F266E70 for ; Thu, 11 Jan 2018 07:44:05 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id u19so875200pfa.12 for ; Wed, 10 Jan 2018 22:44:05 -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=S5j3tOuQ5W1M+N/Ie0YwXaxl33HjDCsjQDMUREt2TYM=; b=Yuj5z9z1DdVGwUxdmDtFYe7mZT22ixrg1ry9a1RRPyWSoNxWnLOkax0Ze+HqUK+WFY zk0WOTwPdcrRsmAZton3+VKUdmlpiWVyEfcpQfTNJItrxahnAujW9JUC99boOKlMx6Ae nk3XnPAKoFvyXaV5Nwa7gDxL8y897V1bSf308FD85TEaUeOJj8bbY63cWeoJ0I7AkBmx SFwPdOiFvB9bR1aVhevsyXAlrtd23F9dOWgV/a0qyfoeNkw7+gaLgvgjliskCe/dYLeF eJ5Je/24lhWVYbtZs3wr/XFlAXMQVxiu+gHlveYmOHxXOVuzkxlURyLanJ0uola94dky GS3g== 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=S5j3tOuQ5W1M+N/Ie0YwXaxl33HjDCsjQDMUREt2TYM=; b=XnUmmsUHnG4Zd1RbdiT04i4OXCHjY8YkwOEagtYvZESdCCC/lWCQyz1hlGTS22OHRG AYQyPRHFkP0KElFZYCw/XjDYur/BnPJgnypsM1v0y9X3+NNVFuSb1STtuKIrSyylAmlw i2aL5ms6FpmifHpyOYiMRWGU5L0BnorOxIsCI8fp/jQZl9bbRA9E8qM1reC42IjfGU3Q BOTUZl/VzJP9TjnT7XRJ2QLRp7sbE1X8oMlvACiOMbL1tg4THSxNuYz/8GrnXqIKh5kO ++lbJXAIQ7lZvfKQPRdGD8aZMdimUWo4i5E4sJDqTfbgH1apKDBESUoSlmngELH9u0/9 cgQw== X-Gm-Message-State: AKwxytf2F5z2OHv7BnuyKbvqwgIv/PEhjOZ57FPLTYxUtTULo4rmUKgz YSbNS4/j0XYjlLWVpnv9SC4= X-Google-Smtp-Source: ACJfBov4bXNNX8D0sjkdI4jMDoxKbILiXLgTj7emT/jhkY2qLUAK4H0Z9H900U71u7xHZT9h9HYIIg== X-Received: by 10.98.0.5 with SMTP id 5mr6389805pfa.202.1515653044482; Wed, 10 Jan 2018 22:44:04 -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 b69sm27959666pfk.128.2018.01.10.22.44.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 22:44:04 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Wed, 10 Jan 2018 22:43:00 -0800 Message-Id: <1515652995-15996-2-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515652995-15996-1-git-send-email-nicoleotsuka@gmail.com> References: <1515652995-15996-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 v2 01/16] 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 aecd00f..c8bd353 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -834,16 +834,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 */