From patchwork Tue Jul 7 13:57:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 6732941 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 B70F89F380 for ; Tue, 7 Jul 2015 14:00:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 066D1206F8 for ; Tue, 7 Jul 2015 14:00:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 80E29206DF for ; Tue, 7 Jul 2015 14:00:38 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id DC12B265876; Tue, 7 Jul 2015 16:00:32 +0200 (CEST) Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id E562D2655DB; Tue, 7 Jul 2015 15:57:58 +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 5B9452654FC; Tue, 7 Jul 2015 15:57:55 +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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id 1AE1B2654C3 for ; Tue, 7 Jul 2015 15:57:50 +0200 (CEST) Received: from 234.27.125.91.dyn.plus.net ([91.125.27.234] helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZCTNa-0001MZ-GN; Tue, 07 Jul 2015 13:57:47 +0000 Received: from broonie by finisterre with local (Exim 4.86_RC4) (envelope-from ) id 1ZCTNS-0005Ss-Pk; Tue, 07 Jul 2015 14:57:38 +0100 From: Mark Brown To: Lars-Peter Clausen , Mark Brown In-Reply-To: <1436189891-15343-1-git-send-email-lars@metafoo.de> Message-Id: Date: Tue, 07 Jul 2015 14:57:38 +0100 X-SA-Exim-Connect-IP: 91.125.27.234 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] Applied "ASoC: rt5645: Replace direct snd_soc_codec dapm field access" to the asoc tree 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 patch ASoC: rt5645: Replace direct snd_soc_codec dapm field access has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From e2ada8187bc8b46c30a623e7d6b5a72c209f70cd Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 6 Jul 2015 15:38:06 +0200 Subject: [PATCH] ASoC: rt5645: Replace direct snd_soc_codec dapm field access 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 Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 73 +++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 9ce311e..571e4b5 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -2642,7 +2642,7 @@ static int rt5645_set_bias_level(struct snd_soc_codec *codec, switch (level) { case SND_SOC_BIAS_PREPARE: - if (SND_SOC_BIAS_STANDBY == codec->dapm.bias_level) { + if (SND_SOC_BIAS_STANDBY == snd_soc_codec_get_bias_level(codec)) { snd_soc_update_bits(codec, RT5645_PWR_ANLG1, RT5645_PWR_VREF1 | RT5645_PWR_MB | RT5645_PWR_BG | RT5645_PWR_VREF2, @@ -2760,20 +2760,17 @@ static int rt5650_calibration(struct rt5645_priv *rt5645) static void rt5645_enable_push_button_irq(struct snd_soc_codec *codec, bool enable) { + struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec); if (enable) { - snd_soc_dapm_mutex_lock(&codec->dapm); - snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, - "ADC L power"); - snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, - "ADC R power"); - snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, - "LDO2"); - snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, - "Mic Det Power"); - snd_soc_dapm_sync_unlocked(&codec->dapm); - snd_soc_dapm_mutex_unlock(&codec->dapm); + snd_soc_dapm_mutex_lock(dapm); + snd_soc_dapm_force_enable_pin_unlocked(dapm, "ADC L power"); + snd_soc_dapm_force_enable_pin_unlocked(dapm, "ADC R power"); + snd_soc_dapm_force_enable_pin_unlocked(dapm, "LDO2"); + snd_soc_dapm_force_enable_pin_unlocked(dapm, "Mic Det Power"); + snd_soc_dapm_sync_unlocked(dapm); + snd_soc_dapm_mutex_unlock(dapm); snd_soc_update_bits(codec, RT5645_INT_IRQ_ST, 0x8, 0x8); @@ -2786,23 +2783,20 @@ static void rt5645_enable_push_button_irq(struct snd_soc_codec *codec, snd_soc_update_bits(codec, RT5650_4BTN_IL_CMD2, 0x8000, 0x0); snd_soc_update_bits(codec, RT5645_INT_IRQ_ST, 0x8, 0x0); - snd_soc_dapm_mutex_lock(&codec->dapm); - snd_soc_dapm_disable_pin_unlocked(&codec->dapm, - "ADC L power"); - snd_soc_dapm_disable_pin_unlocked(&codec->dapm, - "ADC R power"); + snd_soc_dapm_mutex_lock(dapm); + snd_soc_dapm_disable_pin_unlocked(dapm, "ADC L power"); + snd_soc_dapm_disable_pin_unlocked(dapm, "ADC R power"); if (rt5645->pdata.jd_mode == 0) - snd_soc_dapm_disable_pin_unlocked(&codec->dapm, - "LDO2"); - snd_soc_dapm_disable_pin_unlocked(&codec->dapm, - "Mic Det Power"); - snd_soc_dapm_sync_unlocked(&codec->dapm); - snd_soc_dapm_mutex_unlock(&codec->dapm); + snd_soc_dapm_disable_pin_unlocked(dapm, "LDO2"); + snd_soc_dapm_disable_pin_unlocked(dapm, "Mic Det Power"); + snd_soc_dapm_sync_unlocked(dapm); + snd_soc_dapm_mutex_unlock(dapm); } } static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert) { + struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec); unsigned int val; @@ -2811,10 +2805,9 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert) if (codec->component.card->instantiated) { /* for jack type detect */ - snd_soc_dapm_force_enable_pin(&codec->dapm, "LDO2"); - snd_soc_dapm_force_enable_pin(&codec->dapm, - "Mic Det Power"); - snd_soc_dapm_sync(&codec->dapm); + snd_soc_dapm_force_enable_pin(dapm, "LDO2"); + snd_soc_dapm_force_enable_pin(dapm, "Mic Det Power"); + snd_soc_dapm_sync(dapm); } else { /* Power up necessary bits for JD if dapm is not ready yet */ @@ -2847,9 +2840,8 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert) } } else { if (codec->component.card->instantiated) { - snd_soc_dapm_disable_pin(&codec->dapm, - "Mic Det Power"); - snd_soc_dapm_sync(&codec->dapm); + snd_soc_dapm_disable_pin(dapm, "Mic Det Power"); + snd_soc_dapm_sync(dapm); } else regmap_update_bits(rt5645->regmap, RT5645_PWR_VOL, RT5645_PWR_MIC_DET, 0); @@ -2863,11 +2855,9 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert) else { if (codec->component.card->instantiated) { if (rt5645->pdata.jd_mode == 0) - snd_soc_dapm_disable_pin(&codec->dapm, - "LDO2"); - snd_soc_dapm_disable_pin(&codec->dapm, - "Mic Det Power"); - snd_soc_dapm_sync(&codec->dapm); + snd_soc_dapm_disable_pin(dapm, "LDO2"); + snd_soc_dapm_disable_pin(dapm, "Mic Det Power"); + snd_soc_dapm_sync(dapm); } else { if (rt5645->pdata.jd_mode == 0) regmap_update_bits(rt5645->regmap, @@ -3043,21 +3033,22 @@ static int rt5645_irq_detection(struct rt5645_priv *rt5645) static int rt5645_probe(struct snd_soc_codec *codec) { + struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec); rt5645->codec = codec; switch (rt5645->codec_type) { case CODEC_TYPE_RT5645: - snd_soc_dapm_add_routes(&codec->dapm, + snd_soc_dapm_add_routes(dapm, rt5645_specific_dapm_routes, ARRAY_SIZE(rt5645_specific_dapm_routes)); break; case CODEC_TYPE_RT5650: - snd_soc_dapm_new_controls(&codec->dapm, + snd_soc_dapm_new_controls(dapm, rt5650_specific_dapm_widgets, ARRAY_SIZE(rt5650_specific_dapm_widgets)); - snd_soc_dapm_add_routes(&codec->dapm, + snd_soc_dapm_add_routes(dapm, rt5650_specific_dapm_routes, ARRAY_SIZE(rt5650_specific_dapm_routes)); break; @@ -3067,9 +3058,9 @@ static int rt5645_probe(struct snd_soc_codec *codec) /* for JD function */ if (rt5645->pdata.jd_mode) { - snd_soc_dapm_force_enable_pin(&codec->dapm, "JD Power"); - snd_soc_dapm_force_enable_pin(&codec->dapm, "LDO2"); - snd_soc_dapm_sync(&codec->dapm); + snd_soc_dapm_force_enable_pin(dapm, "JD Power"); + snd_soc_dapm_force_enable_pin(dapm, "LDO2"); + snd_soc_dapm_sync(dapm); } return 0;