From patchwork Thu Jan 11 06:43:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10157287 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 B9C55605BA for ; Thu, 11 Jan 2018 06:44:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB7BF285C8 for ; Thu, 11 Jan 2018 06:44:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9ED15286B5; Thu, 11 Jan 2018 06:44:48 +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 D9D9B285C8 for ; Thu, 11 Jan 2018 06:44:47 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 13038267863; Thu, 11 Jan 2018 07:44:16 +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 EA2FF266F35; Thu, 11 Jan 2018 07:44:08 +0100 (CET) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by alsa0.perex.cz (Postfix) with ESMTP id EA9D0266F3E for ; Thu, 11 Jan 2018 07:44:06 +0100 (CET) Received: by mail-pf0-f196.google.com with SMTP id e76so873330pfk.1 for ; Wed, 10 Jan 2018 22:44:06 -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=75eoo1ofPoWMIL54bySLp3g4ikjSIGz2ozD04U/e/0E=; b=A2jwRAdLNAlhW5iSO3mhhmnK83YCy1HHygip8UHh3JHz20J8/hgz3DNSwqdmy4lWwG xg3WcYS0ToJ/jb/jBeYMu7qbdCwtXLTj0GuIJzUawU18+ihAx9IzV+wvN8Y7GlXcV+P+ RPl50fIszMdx5jsZJDYpScMXU1zCL4Tg63R1+gWaw/ZBM9gVozaozvLsZPZiBbMRaJJw L2K8vNRsyjsxqIXOqpJkKqSitWV2QtBxtpqfwozLO8WEenB6ury+POZIoQpuK8zmjDcf qiqftAMiFhmu5jQ/tWCgqYIxV3FjkmVrW17fLt9ix6D1AeHIqLv1jKLr5gg1g+3Yod6h /fHw== 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=75eoo1ofPoWMIL54bySLp3g4ikjSIGz2ozD04U/e/0E=; b=ooRua03U+FdvVllBYouptUyAqNUot2vUTayRDD5FiI5SWISWHsCyFCXeRLWRx8luZh IKfNn4x3VONr7lHqHqEfj/a/1k+3q41LpT5ed7xgNx3kCbnvJ8z3Fy3HdGhKmfnrAw7A CNWyhTkprNABn2RO8724RAqynGVaP1ozBNHiK6ti6cVBA8iMcWoSGtTl7egthsYUKxEl Jn9L7sV4aVO/ggcbhZvI9BTna5g9qmfXwXwAG76h8gA2P8Y+laob+Q5GXQ28by9tvRtv /KOu2dpsxArMTSb14FoBZG/8oWp8++vC0aXL8Czc5DYZZKkRLI34RP5t1jrGY8c73KfN xGFA== X-Gm-Message-State: AKGB3mJdTdc1uWyz5Jbjqk+ua72hkSKuIsXa3U62XI77OYR9nZfKOBah oLWHsSqKXY6l8FXyji5N7qk= X-Google-Smtp-Source: ACJfBosWBVRrburulGWNbMvWjAnKLZbR0Ssaefe74A92oU19HSKqukPtDxinurs2j8hYAXXbFF+Rog== X-Received: by 10.98.1.82 with SMTP id 79mr19343576pfb.10.1515653045664; Wed, 10 Jan 2018 22:44:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 22:44:05 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Wed, 10 Jan 2018 22:43:01 -0800 Message-Id: <1515652995-15996-3-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 02/16] 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 c8bd353..491b660 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1051,9 +1051,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; } @@ -1063,9 +1061,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);