From patchwork Fri Oct 21 08:27:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 9388297 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 DA2FF607F0 for ; Fri, 21 Oct 2016 09:01:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7A5529F4A for ; Fri, 21 Oct 2016 09:01:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC24129F4C; Fri, 21 Oct 2016 09:01:56 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham 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 846A529F4A for ; Fri, 21 Oct 2016 09:01:51 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 95CA3267187; Fri, 21 Oct 2016 11:01:50 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id ACD2926716C; Fri, 21 Oct 2016 10:59:24 +0200 (CEST) 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 593CE267173; Fri, 21 Oct 2016 10:27:21 +0200 (CEST) Received: from www381.your-server.de (www381.your-server.de [78.46.137.84]) by alsa0.perex.cz (Postfix) with ESMTP id 6FD3A267164 for ; Fri, 21 Oct 2016 10:27:15 +0200 (CEST) Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by www381.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1bxVAX-0001DH-V8; Fri, 21 Oct 2016 10:27:13 +0200 Received: from [46.244.225.166] (helo=lars-laptop.fritz.box) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:AES256-SHA:256) (Exim 4.84_2) (envelope-from ) id 1bxVAX-0006ka-NS; Fri, 21 Oct 2016 10:27:13 +0200 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Fri, 21 Oct 2016 10:27:08 +0200 Message-Id: <1477038428-4480-2-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1477038428-4480-1-git-send-email-lars@metafoo.de> References: <1477038428-4480-1-git-send-email-lars@metafoo.de> X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.99.2/22403/Fri Oct 21 07:57:35 2016) Cc: Charles Keepax , patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org, Lars-Peter Clausen Subject: [alsa-devel] [PATCH 2/2] ASoC: wm9705: Remove ac97_read/ac97_write wrappers 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 Since the regmap conversion ac97_read/ac97_write are just simple wrappers around snd_soc_read/snd_soc_write. Use those instead directly and remove the wrappers. Also use snd_soc_update_bits() where appropriate. Signed-off-by: Lars-Peter Clausen Acked-by: Charles Keepax --- sound/soc/codecs/wm9705.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c index 70ab607..e73ff61 100644 --- a/sound/soc/codecs/wm9705.c +++ b/sound/soc/codecs/wm9705.c @@ -226,33 +226,20 @@ static const struct snd_soc_dapm_route wm9705_audio_map[] = { {"Right ADC", NULL, "ADC PGA"}, }; -static unsigned int ac97_read(struct snd_soc_codec *codec, unsigned int reg) -{ - return snd_soc_read(codec, reg); -} - -static int ac97_write(struct snd_soc_codec *codec, unsigned int reg, - unsigned int val) -{ - return snd_soc_write(codec, reg, val); -} - static int ac97_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; int reg; - u16 vra; - vra = ac97_read(codec, AC97_EXTENDED_STATUS); - ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1); + snd_soc_update_bits(codec, AC97_EXTENDED_STATUS, 0x1, 0x1); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) reg = AC97_PCM_FRONT_DAC_RATE; else reg = AC97_PCM_LR_ADC_RATE; - return ac97_write(codec, reg, substream->runtime->rate); + return snd_soc_write(codec, reg, substream->runtime->rate); } #define WM9705_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | \ @@ -299,7 +286,7 @@ static struct snd_soc_dai_driver wm9705_dai[] = { static int wm9705_soc_suspend(struct snd_soc_codec *codec) { regcache_cache_bypass(codec->component.regmap, true); - ac97_write(codec, AC97_POWERDOWN, 0xffff); + snd_soc_write(codec, AC97_POWERDOWN, 0xffff); regcache_cache_bypass(codec->component.regmap, false); return 0;