ASoC: wm8996: Replace direct snd_soc_codec dapm field access
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 1 Jun 2015 08:11:02 +0000 (10:11 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 1 Jun 2015 15:45:46 +0000 (16:45 +0100)
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 <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm8996.c

index 3dce5075146968ce26896baea365164920263549..370459fcf21cb85f3fed9b782fd34d5a28dc89e2 100644 (file)
@@ -1590,7 +1590,7 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec,
                break;
 
        case SND_SOC_BIAS_STANDBY:
-               if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
+               if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) {
                        ret = regulator_bulk_enable(ARRAY_SIZE(wm8996->supplies),
                                                    wm8996->supplies);
                        if (ret != 0) {
@@ -2245,7 +2245,7 @@ int wm8996_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
                  wm8996_polarity_fn polarity_cb)
 {
        struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
 
        wm8996->jack = jack;
        wm8996->detecting = true;
@@ -2290,6 +2290,7 @@ EXPORT_SYMBOL_GPL(wm8996_detect);
 
 static void wm8996_hpdet_irq(struct snd_soc_codec *codec)
 {
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
        struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
        int val, reg, report;
 
@@ -2343,12 +2344,14 @@ out:
        snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, WM8996_MICD_ENA,
                            WM8996_MICD_ENA);
 
-       snd_soc_dapm_disable_pin(&codec->dapm, "Bandgap");
-       snd_soc_dapm_sync(&codec->dapm);
+       snd_soc_dapm_disable_pin(dapm, "Bandgap");
+       snd_soc_dapm_sync(dapm);
 }
 
 static void wm8996_hpdet_start(struct snd_soc_codec *codec)
 {
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
+
        /* Unclamp the output, we can't measure while we're shorting it */
        snd_soc_update_bits(codec, WM8996_ANALOGUE_HP_1,
                            WM8996_HPOUT1L_RMV_SHORT |
@@ -2357,8 +2360,8 @@ static void wm8996_hpdet_start(struct snd_soc_codec *codec)
                            WM8996_HPOUT1R_RMV_SHORT);
 
        /* We need bandgap for HPDET */
-       snd_soc_dapm_force_enable_pin(&codec->dapm, "Bandgap");
-       snd_soc_dapm_sync(&codec->dapm);
+       snd_soc_dapm_force_enable_pin(dapm, "Bandgap");
+       snd_soc_dapm_sync(dapm);
 
        /* Go into headphone detect left mode */
        snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, WM8996_MICD_ENA, 0);