From patchwork Mon Jan 15 04:21:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10162995 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 A3DE5601C0 for ; Mon, 15 Jan 2018 04:23:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6926289FA for ; Mon, 15 Jan 2018 04:23:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B82C289FF; Mon, 15 Jan 2018 04:23:32 +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 D555D289FA for ; Mon, 15 Jan 2018 04:23:31 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 79482267376; Mon, 15 Jan 2018 05:22:28 +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 C18CE267345; Mon, 15 Jan 2018 05:22:23 +0100 (CET) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by alsa0.perex.cz (Postfix) with ESMTP id 8D32F267323 for ; Mon, 15 Jan 2018 05:22:19 +0100 (CET) Received: by mail-pg0-f66.google.com with SMTP id f14so7384608pga.10 for ; Sun, 14 Jan 2018 20:22:18 -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=puPB+HJ46xXOB5xxoSJAaL7IkW6/MSEY1BhnMZA7KAo=; b=emA+h9kZWCL1ndlAxxY+6spJY7kH1qXaOJ9F9U/axGRe+WwZmT3rxYLreeOS62qjtp rGEBvOUnGdpeFQe9EnnTi9ozmRz7GhR/6uBrV6kdxgYStmLtnv6Pvqpzqz+aUMpJInmu rcPBoieBXZciL8bRkghYViBdli/bp0HkkbwMAZsHPLwU2w5IN9aOKLYrEOCgXvNt3FFc 5KYXnTmUP8T3SsrH0rm1/jKPKmceMaLAqKRYdF+TadIReKWwc/Vw9Dt6A4d7T5Gn38mE 6fj8ar/kNzSL1jaR4lpFWyrzqv+uZNS96wlw+s/Lg9U1SHAy1EfdoJsHEOoXCObJzkum kudw== 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=puPB+HJ46xXOB5xxoSJAaL7IkW6/MSEY1BhnMZA7KAo=; b=ZNTlqWf8dBxxCdhvhymKxUqjQ9sQnPizlREmJ8Jbd+wthwT7wBQw+QJUQBOy2+i+VC qYsczE8sxCg5NVMOZkpXeqqaJ14n1BUEEBPiJpg2leYE849AcwvmT51kJXUCCTzteen8 +LF63CsDuJmrDBlLyea3na+qSfImQOem7WiARVo+4X2YyO93msngpt1RuJtNuRiMzB6m kh4s0GptrfURpO/5kuu0drpBHTsq3c0lwFX78+47xZ8dtCRzjmcRwwbvY6adtKjF+Ctc Klxt8MOqkf4cv3Pz4WTySo8XBvGTw0G5PQUpX0cWFQ0bm4olxowOwc6gTpeEGRYCGl4S FRaw== X-Gm-Message-State: AKGB3mKl5v6fd5e0fFIl5DAUPg0gZZJoILFd/LyAeN/sZlHRJV1hhYAi fCGeovaSg7CGhLbqUn/KvBVC8Q== X-Google-Smtp-Source: ACJfBouLXY+OjWJffh3Oq7PKrDbDbBKM3qXy39wlrVF5uStXwyQrbsK0bsBIaM2rnC3YCZWn4h9+JA== X-Received: by 10.101.97.25 with SMTP id z25mr26680787pgu.313.1515990137859; Sun, 14 Jan 2018 20:22:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 14 Jan 2018 20:22:17 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Sun, 14 Jan 2018 20:21:13 -0800 Message-Id: <1515990087-11598-4-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 03/17] ASoC: fsl_ssi: Clean up set_dai_tdm_slot() 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 This patch replaces the register read with ssi->i2s_net for simplification. It also removes masking SSIEN from scr value since it's handled later by regmap_update_bits() to set this scr value back. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 9847a1d..8984ee2 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1055,9 +1055,7 @@ static int fsl_ssi_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, } /* 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; } @@ -1067,9 +1065,8 @@ static int fsl_ssi_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, regmap_update_bits(regs, REG_SSI_SRCCR, SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots)); - /* Save SSIEN bit of the SCR register */ + /* Save the SCR register value */ regmap_read(regs, REG_SSI_SCR, &val); - val &= SSI_SCR_SSIEN; /* Temporarily enable SSI to allow SxMSKs to be configurable */ regmap_update_bits(regs, REG_SSI_SCR, SSI_SCR_SSIEN, SSI_SCR_SSIEN);