From patchwork Tue Nov 6 09:39:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 10669979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 092EF1803 for ; Tue, 6 Nov 2018 09:39:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9B5B2A189 for ; Tue, 6 Nov 2018 09:39:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8A732A278; Tue, 6 Nov 2018 09:39:38 +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=-0.2 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SUBJ_OBFU_PUNCT_FEW, SUBJ_OBFU_PUNCT_MANY 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 07AED2A189 for ; Tue, 6 Nov 2018 09:39:37 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id ACCC82678F2; Tue, 6 Nov 2018 10:39:35 +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 4A82B2679F7; Tue, 6 Nov 2018 10:39:33 +0100 (CET) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by alsa0.perex.cz (Postfix) with ESMTP id 7B3E2267839 for ; Tue, 6 Nov 2018 10:39:29 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id b11-v6so5848972pfi.5 for ; Tue, 06 Nov 2018 01:39:29 -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=V8dFRMr5oJDuB0+/3aqLJklXZ3S3y4tH5CWdL/tcxZI=; b=aTbjgCPMQL0WI7z6bkpVyKC/NhGf25IT+fAlwNwFK7tbsPpym4SPAkbdcA/g5RiiHT kyxd0dpF1VrZM2ZoiPvFa7sdgw5yEvfuzo45f34Dsaz3aZRiPPlT76vmrz8S92rEN9XJ g6FwY6ljhouzVTQWR/kAjey0/diaVJcqqlAxVE4ceQcxMfsiycdPeB46i3rEcl4iJSz4 H6k+1EJkrTfcdb4xihNwoQ87ll1vcInrii/IOoCgMXkGk6QuHBFb/6JAIJumbYVPgjle gaQtCXkVJOg3+TA5WS5O1jIFgKiYPAAnA/wbCp5CKxH8TgGaIdbT/ckbpLXRwqjYVm3t 23gA== 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; bh=V8dFRMr5oJDuB0+/3aqLJklXZ3S3y4tH5CWdL/tcxZI=; b=eZtRZnumLsx0oiF7VEKg1MkrxaMmEpgXdq3g1si87/Cu98J2/IIXtVvPuL6dDMt0DB 8Sf5Xvmay61GUcPhJ/LLA7+KpKadjkrfy7QZmmD+OwmoCvWpZ/AviD0xZyP28wFaAruB fcI6MrTtOoPuylUCC5B71QXmEPYJqSPqth1fm8ieh75Cmn7ZYGr01rD/DGMYrOagYlwZ VWYKWcbrh3fZyQbSOxik9HgFtWryQb0w6J6HbaWipQaqV96MM60m78Dg6JpHROFAkzCc q5mGeUwk7mAhPjRLauv6WT5mlXnFOo0ccTSk1ZDR+hokJtliC3XVztKdUQEx7WpZmjsS Y5qg== X-Gm-Message-State: AGRZ1gIgU0QiuNyWCAblhGkZJS7lqyj79aQCq8zDgi4moqYvE06URpd+ ILn9frgYC8OFeTJt4fawpWYkzBrGUto= X-Google-Smtp-Source: AJdET5cJ1mbGJCeJqQwfzH+0Mw8o98FI97n4R1UYvKsvqRQMiIm3GZf4mCWYwHcdjUganRI7YSOqDw== X-Received: by 2002:aa7:8719:: with SMTP id b25-v6mr25099036pfo.250.1541497167946; Tue, 06 Nov 2018 01:39:27 -0800 (PST) Received: from localhost.localdomain (220-133-186-239.HINET-IP.hinet.net. [220.133.186.239]) by smtp.gmail.com with ESMTPSA id w2-v6sm46435270pfw.26.2018.11.06.01.39.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 01:39:27 -0800 (PST) From: Axel Lin To: Mark Brown Date: Tue, 6 Nov 2018 17:39:19 +0800 Message-Id: <20181106093919.20740-1-axel.lin@ingics.com> X-Mailer: git-send-email 2.17.1 Cc: Axel Lin , alsa-devel@alsa-project.org, Daniel Baluta , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: ak5558: Remove redundant snd_soc_component_read32 calls 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 snd_soc_component_update_bits() will only update the mask bits, so remove the redundant snd_soc_component_read32(). Signed-off-by: Axel Lin Reviewed-by: Daniel Baluta --- sound/soc/codecs/ak5558.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/ak5558.c b/sound/soc/codecs/ak5558.c index 60f1f12c81ea..8179512129d3 100644 --- a/sound/soc/codecs/ak5558.c +++ b/sound/soc/codecs/ak5558.c @@ -130,16 +130,12 @@ static int ak5558_hw_params(struct snd_pcm_substream *substream, u8 bits; int pcm_width = max(params_physical_width(params), ak5558->slot_width); - /* set master/slave audio interface */ - bits = snd_soc_component_read32(component, AK5558_02_CONTROL1); - bits &= ~AK5558_BITS; - switch (pcm_width) { case 16: - bits |= AK5558_DIF_24BIT_MODE; + bits = AK5558_DIF_24BIT_MODE; break; case 32: - bits |= AK5558_DIF_32BIT_MODE; + bits = AK5558_DIF_32BIT_MODE; break; default: return -EINVAL; @@ -168,18 +164,15 @@ static int ak5558_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) } /* set master/slave audio interface */ - format = snd_soc_component_read32(component, AK5558_02_CONTROL1); - format &= ~AK5558_DIF; - switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: - format |= AK5558_DIF_I2S_MODE; + format = AK5558_DIF_I2S_MODE; break; case SND_SOC_DAIFMT_LEFT_J: - format |= AK5558_DIF_MSB_MODE; + format = AK5558_DIF_MSB_MODE; break; case SND_SOC_DAIFMT_DSP_B: - format |= AK5558_DIF_MSB_MODE; + format = AK5558_DIF_MSB_MODE; break; default: return -EINVAL;