From patchwork Mon Mar 29 06:54:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Yu X-Patchwork-Id: 410873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27CBEC433DB for ; Mon, 29 Mar 2021 07:08:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 997DB61936 for ; Mon, 29 Mar 2021 07:08:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 997DB61936 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 45248852; Mon, 29 Mar 2021 09:07:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 45248852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1617001687; bh=iXmjD0NsBavDhs9Gi6tsIP9+4t13N7pWmrDWhiFYDVQ=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=X5vh1g6cZHFj6sZR8OWj1+/q+9ymoURNBM5G+RiPEZi7abv+FE1S5+Lh0IbB/wgKQ GylHtnSTOV7/qaGJ4GkHoXW4yhTMGCtU4AgCOmE0AY48nVticWtSCCyhhPGSq17USb moSt/ss5gEihJ8Gqtvpj4orE6VKUzMLjpQM/i03w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B8A38F8016E; Mon, 29 Mar 2021 09:07:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 093FAF801DB; Mon, 29 Mar 2021 09:07:15 +0200 (CEST) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A49C1F800B9 for ; Mon, 29 Mar 2021 09:07:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A49C1F800B9 Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.73 with qID 12T76tH32013513, This message is accepted by code: ctloc85258 Received: from MailAVG (MailAVG.realtek.com [172.21.6.65] (may be forged)) by rtits2.realtek.com.tw (8.15.2/2.70/5.88) with SMTP id 12T76tH32013513; Mon, 29 Mar 2021 15:06:55 +0800 Received: from mail.realtek.com (RTEXMBS01.realtek.com.tw [172.21.6.94]) by MailAVG with ESMTP ; Mon, 29 Mar 2021 14:54:05 +0800 Received: from RTEXDAG02.realtek.com.tw (172.21.6.101) by RTEXMBS01.realtek.com.tw (172.21.6.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 29 Mar 2021 14:54:05 +0800 Received: from RTEXMBS01.realtek.com.tw (172.21.6.94) by RTEXDAG02.realtek.com.tw (172.21.6.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 29 Mar 2021 14:54:05 +0800 Received: from RTEXMBS01.realtek.com.tw ([fe80::6caa:5fa6:24e2:bbef]) by RTEXMBS01.realtek.com.tw ([fe80::6caa:5fa6:24e2:bbef%7]) with mapi id 15.01.2106.013; Mon, 29 Mar 2021 14:54:05 +0800 From: Jack Yu To: "broonie@kernel.org" , "lgirdwood@gmail.com" Subject: [PATCH v2 3/3] ASoC: rt715: modification for code simplicity Thread-Topic: [PATCH v2 3/3] ASoC: rt715: modification for code simplicity Thread-Index: AdckaE6g3A8rxOuOSiuBEe1mf7DUGQ== Date: Mon, 29 Mar 2021 06:54:05 +0000 Message-ID: <340ee2df83ce47fcb1b59541b12ba7f4@realtek.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: <340ee2df83ce47fcb1b59541b12ba7f4@realtek.com> x-originating-ip: [172.22.102.167] MIME-Version: 1.0 Cc: Oder Chiou , Jack Yu , "alsa-devel@alsa-project.org" , "lars@metafoo.de" , =?big5?b?RGVyZWsgW6TovHe4cV0=?= , "bard.liao@intel.com" , =?big5?b?U2h1bWluZyBb?= =?big5?b?rVOu0bvKXQ==?= , "Flove\(HsinFu\)" , "pierre-louis.bossart@intel.com" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Modification for code simplicity. Signed-off-by: Jack Yu --- sound/soc/codecs/rt715.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.29.0 diff --git a/sound/soc/codecs/rt715.c b/sound/soc/codecs/rt715.c index b33eabb9f740..1352869cc086 100644 --- a/sound/soc/codecs/rt715.c +++ b/sound/soc/codecs/rt715.c @@ -57,14 +57,14 @@ static void rt715_get_gain(struct rt715_priv *rt715, unsigned int addr_h, { int ret; /* R Channel */ - *r_val = (val_h << 8); + *r_val = val_h << 8; ret = regmap_read(rt715->regmap, addr_l, r_val); if (ret < 0) pr_err("Failed to get R channel gain.\n"); /* L Channel */ val_h |= 0x20; - *l_val = (val_h << 8); + *l_val = val_h << 8; ret = regmap_read(rt715->regmap, addr_h, l_val); if (ret < 0) pr_err("Failed to get L channel gain.\n"); @@ -183,8 +183,8 @@ static int rt715_set_amp_gain_get(struct snd_kcontrol *kcontrol, if (mc->invert) { /* for mute status */ - read_ll = !((read_ll & 0x80) >> RT715_MUTE_SFT); - read_rl = !((read_rl & 0x80) >> RT715_MUTE_SFT); + read_ll = !(read_ll & 0x80); + read_rl = !(read_rl & 0x80); } else { /* for gain */ read_ll = read_ll & 0x7f;