From patchwork Sat Dec 3 07:10:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9459561 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 501B960459 for ; Sat, 3 Dec 2016 07:13:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 104522852E for ; Sat, 3 Dec 2016 07:13:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5D5928540; Sat, 3 Dec 2016 07:13:51 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,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 2E97A2852E for ; Sat, 3 Dec 2016 07:13:46 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 67074266917; Sat, 3 Dec 2016 08:13:44 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5A440266621; Sat, 3 Dec 2016 08:11:23 +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 F11D62667B2; Sat, 3 Dec 2016 08:11:13 +0100 (CET) Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by alsa0.perex.cz (Postfix) with ESMTP id 92B87266621 for ; Sat, 3 Dec 2016 08:11:11 +0100 (CET) Received: by mail-pg0-f65.google.com with SMTP id x23so10119095pgx.3 for ; Fri, 02 Dec 2016 23:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=X14OKuMW7RW2bXeC2ackSvUeXg7sDGKVcF7n96sWDhA=; b=GIdwupo8coxINZDrNFekn6zLeYtLzS+Y0sXCiNek9aCF/FjnM0RDxWkSACLuPAf5rE Yc8kVDfwNoU1cgFwuVPmLy75/a16S8JCXvjlxpBAAEjruNgv7mc7l13NqQ/Uo3BnI9L9 J0q/SX9xgiOQnpoNtT7CEHKuTkn+uHBdOYhz8iocBVDZnEfnmBPRhplYaF6pHhZooEbt qPTdGC8x2YZ1zOlCxaUEjSvUzTSIuOQx0Ogx8XLPWpPSyW/HC2lLFPV1U23LCePsTj1X tYbYubcQPxXb5TrJk8w2TkClJmm5fA16oWRpFjUYJEF/HDSTcGC9bIqgzsD8qcy/KMdF 4r0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=X14OKuMW7RW2bXeC2ackSvUeXg7sDGKVcF7n96sWDhA=; b=mFkDq4XExUfJcj0F8gyanfcoFg5ZziF5YLYTI46RE65VSiGZGayQ349C1ztax7B63S qhF3jcIUaqshJmdYX1su7nhmpvcbTw/ii7+XDcRCSRylIpsyrc056if0qnWDeEd9jZWv FExDF9n6/bzCFaTVckz40d+uR/x1DmanFzAIOYZGJakkUBgmGNdDK4JhpIK48yjfIiW+ ycWGkKX+DXbq+8PvrkhMsEB181+E+YwHmUujq1DsEIOx3Dpg0jAM+ZkFo3lunOZoMlW8 9cBr6hjQKHcJUOHn5JDv1zfsqHr14MaIfQpYxaQUYBcKD7uVyfjDJuIOQTPpS5Joirqr Vn7g== X-Gm-Message-State: AKaTC023XowGuqJ/D7+OY6Ij8AaXF2lekVl700mn/v+/d2THJYLU/z+RiRMuxB7d9cq/YQ== X-Received: by 10.84.130.5 with SMTP id 5mr87508923plc.69.1480749070320; Fri, 02 Dec 2016 23:11:10 -0800 (PST) Received: from localhost.localdomain (218-164-26-100.dynamic.hinet.net. [218.164.26.100]) by smtp.gmail.com with ESMTPSA id n17sm12184846pfg.80.2016.12.02.23.11.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2016 23:11:09 -0800 (PST) From: Axel Lin To: Mark Brown Date: Sat, 3 Dec 2016 15:10:50 +0800 Message-Id: <20161203071050.17811-1-axel.lin@ingics.com> X-Mailer: git-send-email 2.9.3 Cc: Brian Austin , alsa-devel@alsa-project.org, Axel Lin , Liam Girdwood , Paul Handrigan Subject: [alsa-devel] [PATCH] ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting 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 logic of "value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_XXXXXX;" is unnecessary complex. By setting CS35L34_MCLK_DIV | CS35L34_MCLK_RATE_MASK as the mask for regmap_update_bits() call, what the code does is exactly the same as setting value = CS35L34_MCLK_RATE_XXXXXX. Signed-off-by: Axel Lin Acked-by: Paul Handrigan --- sound/soc/codecs/cs35l34.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/cs35l34.c b/sound/soc/codecs/cs35l34.c index e0f672a..7c5d151 100644 --- a/sound/soc/codecs/cs35l34.c +++ b/sound/soc/codecs/cs35l34.c @@ -610,15 +610,15 @@ static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai, switch (freq) { case CS35L34_MCLK_5644: - value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_5P6448; + value = CS35L34_MCLK_RATE_5P6448; cs35l34->mclk_int = freq; break; case CS35L34_MCLK_6: - value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_6P0000; + value = CS35L34_MCLK_RATE_6P0000; cs35l34->mclk_int = freq; break; case CS35L34_MCLK_6144: - value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_6P1440; + value = CS35L34_MCLK_RATE_6P1440; cs35l34->mclk_int = freq; break; case CS35L34_MCLK_11289: