From patchwork Tue May 19 19:49:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 6440451 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C81B69F1C1 for ; Tue, 19 May 2015 19:52:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01FE12039D for ; Tue, 19 May 2015 19:52:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id AD6062037E for ; Tue, 19 May 2015 19:52:34 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 969DF265764; Tue, 19 May 2015 21:52:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 41824265483; Tue, 19 May 2015 21:49:35 +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 2E4BB2605C1; Tue, 19 May 2015 21:49:30 +0200 (CEST) Received: from smtp-out-051.synserver.de (smtp-out-051.synserver.de [212.40.185.51]) by alsa0.perex.cz (Postfix) with ESMTP id 2CBB22605BB for ; Tue, 19 May 2015 21:49:23 +0200 (CEST) Received: (qmail 6513 invoked by uid 0); 19 May 2015 19:49:22 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 6170 Received: from ppp-188-174-110-9.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [188.174.110.9] by 217.119.54.77 with SMTP; 19 May 2015 19:49:21 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Tue, 19 May 2015 21:49:08 +0200 Message-Id: <1432064952-31997-4-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1432064952-31997-1-git-send-email-lars@metafoo.de> References: <1432064952-31997-1-git-send-email-lars@metafoo.de> Cc: Oder Chiou , Bard Liao , alsa-devel@alsa-project.org, Lars-Peter Clausen Subject: [alsa-devel] [PATCH 4/7] ASoC: rt5640: Replace direct snd_soc_codec dapm field access 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 dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm.bias_level with snd_soc_codec_get_bias_level() and replace all other manual access to codec->dapm with snd_soc_codec_get_dapm(). Signed-off-by: Lars-Peter Clausen --- sound/soc/codecs/rt5640.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 7d488d8..f40752a 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -1870,7 +1870,7 @@ static int rt5640_set_bias_level(struct snd_soc_codec *codec, { switch (level) { case SND_SOC_BIAS_STANDBY: - if (SND_SOC_BIAS_OFF == codec->dapm.bias_level) { + if (SND_SOC_BIAS_OFF == snd_soc_codec_get_bias_level(codec)) { snd_soc_update_bits(codec, RT5640_PWR_ANLG1, RT5640_PWR_VREF1 | RT5640_PWR_MB | RT5640_PWR_BG | RT5640_PWR_VREF2, @@ -1934,6 +1934,7 @@ EXPORT_SYMBOL_GPL(rt5640_dmic_enable); static int rt5640_probe(struct snd_soc_codec *codec) { + struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); rt5640->codec = codec; @@ -1950,18 +1951,18 @@ static int rt5640_probe(struct snd_soc_codec *codec) snd_soc_add_codec_controls(codec, rt5640_specific_snd_controls, ARRAY_SIZE(rt5640_specific_snd_controls)); - snd_soc_dapm_new_controls(&codec->dapm, + snd_soc_dapm_new_controls(dapm, rt5640_specific_dapm_widgets, ARRAY_SIZE(rt5640_specific_dapm_widgets)); - snd_soc_dapm_add_routes(&codec->dapm, + snd_soc_dapm_add_routes(dapm, rt5640_specific_dapm_routes, ARRAY_SIZE(rt5640_specific_dapm_routes)); break; case RT5640_ID_5639: - snd_soc_dapm_new_controls(&codec->dapm, + snd_soc_dapm_new_controls(dapm, rt5639_specific_dapm_widgets, ARRAY_SIZE(rt5639_specific_dapm_widgets)); - snd_soc_dapm_add_routes(&codec->dapm, + snd_soc_dapm_add_routes(dapm, rt5639_specific_dapm_routes, ARRAY_SIZE(rt5639_specific_dapm_routes)); break;