ASoC: Route all bias level updates through the core
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 27 Apr 2015 20:13:24 +0000 (22:13 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 27 Apr 2015 20:34:45 +0000 (21:34 +0100)
Use the new snd_soc_codec_force_bias_level() helper function to invoke the
bias_level callback of a driver instead of calling the callback by hand.
Currently the effect of this is the same, but having all bias level updates
go through a central place will allow us to move more of the bias level
management into the DAPM core.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
19 files changed:
sound/soc/codecs/max98095.c
sound/soc/codecs/rt5640.c
sound/soc/codecs/rt5645.c
sound/soc/codecs/rt5651.c
sound/soc/codecs/rt5677.c
sound/soc/codecs/sta32x.c
sound/soc/codecs/sta350.c
sound/soc/codecs/twl6040.c
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8737.c
sound/soc/codecs/wm8900.c
sound/soc/codecs/wm8940.c
sound/soc/codecs/wm8955.c
sound/soc/codecs/wm8978.c
sound/soc/codecs/wm8990.c
sound/soc/codecs/wm8993.c
sound/soc/codecs/wm8994.c
sound/soc/codecs/wm9712.c
sound/soc/codecs/wm9713.c

index 8fba0c3db79827c97135928b4ed537bdec88bbaf..d6e80a932ec3d58b3e1f86a3098b844531d14d99 100644 (file)
@@ -2198,7 +2198,7 @@ static int max98095_suspend(struct snd_soc_codec *codec)
        if (max98095->headphone_jack || max98095->mic_jack)
                max98095_jack_detect_disable(codec);
 
-       max98095_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
 
        return 0;
 }
@@ -2208,7 +2208,7 @@ static int max98095_resume(struct snd_soc_codec *codec)
        struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
        struct i2c_client *client = to_i2c_client(codec->dev);
 
-       max98095_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        if (max98095->headphone_jack || max98095->mic_jack) {
                max98095_jack_detect_enable(codec);
index 178e55d4d48146b9bfee3a211bd297f67a822790..d39b25cd62efc518b43d5822d3d696b7cee875aa 100644 (file)
@@ -1939,7 +1939,7 @@ static int rt5640_probe(struct snd_soc_codec *codec)
 
        rt5640->codec = codec;
 
-       rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
 
        snd_soc_update_bits(codec, RT5640_DUMMY1, 0x0301, 0x0301);
        snd_soc_update_bits(codec, RT5640_MICBIAS, 0x0030, 0x0030);
@@ -1991,7 +1991,7 @@ static int rt5640_suspend(struct snd_soc_codec *codec)
 {
        struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
 
-       rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
        rt5640_reset(codec);
        regcache_cache_only(rt5640->regmap, true);
        regcache_mark_dirty(rt5640->regmap);
index 69528ae5410c991125c2e16f3810d51ae7026b88..b1e681a3e8dbfcb2cf67bef5b9c14a1756c5715e 100644 (file)
@@ -2520,7 +2520,7 @@ static int rt5645_probe(struct snd_soc_codec *codec)
                break;
        }
 
-       rt5645_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
 
        snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200);
 
index 9f4c7be6d798691c70b953c65751904b68c66db1..35c9725059483e7e8dcb0c5b3e473fde9ca87f4e 100644 (file)
@@ -1625,7 +1625,7 @@ static int rt5651_probe(struct snd_soc_codec *codec)
                RT5651_PWR_FV1 | RT5651_PWR_FV2,
                RT5651_PWR_FV1 | RT5651_PWR_FV2);
 
-       rt5651_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
 
        return 0;
 }
index af182586712d42f9bbac6d5b03338e3e5219cf23..ba408ad23457fd825895ee6bc4a1a523f635c965 100644 (file)
@@ -4618,7 +4618,7 @@ static int rt5677_probe(struct snd_soc_codec *codec)
                        ARRAY_SIZE(rt5677_dmic2_clk_1));
        }
 
-       rt5677_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
 
        regmap_write(rt5677->regmap, RT5677_DIG_MISC, 0x0020);
        regmap_write(rt5677->regmap, RT5677_PWR_DSP2, 0x0c00);
index 007a0e3bc2735c0c6f9d8325f15445657fcfd374..686ec765ea0e40f2c3fae04d66d550ec0945435f 100644 (file)
@@ -970,7 +970,7 @@ static int sta32x_probe(struct snd_soc_codec *codec)
        if (sta32x->pdata->needs_esd_watchdog)
                INIT_DELAYED_WORK(&sta32x->watchdog_work, sta32x_watchdog);
 
-       sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
        /* Bias level configuration will have done an extra enable */
        regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
 
index 669e3228241e39d14a2cb009a508cbdb1f6b9fcb..46fc07a94fcdc01c665f4201a8e3ef2cc1753197 100644 (file)
@@ -1037,7 +1037,7 @@ static int sta350_probe(struct snd_soc_codec *codec)
        sta350->coef_shadow[60] = 0x400000;
        sta350->coef_shadow[61] = 0x400000;
 
-       sta350_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
        /* Bias level configuration will have done an extra enable */
        regulator_bulk_disable(ARRAY_SIZE(sta350->supplies), sta350->supplies);
 
index aeec27b6f1af76aca729aacd35e872b01eb05362..9bd887ed7f4406c186b9a1425522b11a3f279a6e 100644 (file)
@@ -1130,7 +1130,7 @@ static int twl6040_probe(struct snd_soc_codec *codec)
                return ret;
        }
 
-       twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
        twl6040_init_chip(codec);
 
        return 0;
index 2245b6a32f3dc52da5b5f8ddf9393cf400172a7b..00898d9d977d12fdd053b06fdac20de375f9880e 100644 (file)
@@ -599,7 +599,7 @@ static int wm8731_probe(struct snd_soc_codec *codec)
                goto err_regulator_enable;
        }
 
-       wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        /* Latch the update bits */
        snd_soc_update_bits(codec, WM8731_LOUT1V, 0x100, 0);
index ada9ac1ba2c647ce6a8d4bb75d504002935a6f85..40e6acb4f3f41a279b42affc98d2c199809bb554 100644 (file)
@@ -560,7 +560,7 @@ static int wm8737_probe(struct snd_soc_codec *codec)
        snd_soc_update_bits(codec, WM8737_RIGHT_PGA_VOLUME, WM8737_RVU,
                            WM8737_RVU);
 
-       wm8737_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        /* Bias level configuration will have done an extra enable */
        regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);
index 2eb986c19b886a48e9d367623adf353a94796689..065da37bbf2160e74405c91616372ed748051b73 100644 (file)
@@ -1138,7 +1138,7 @@ static int wm8900_suspend(struct snd_soc_codec *codec)
        wm8900->fll_out = fll_out;
        wm8900->fll_in = fll_in;
 
-       wm8900_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
 
        return 0;
 }
@@ -1156,7 +1156,7 @@ static int wm8900_resume(struct snd_soc_codec *codec)
                return ret;
        }
 
-       wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        /* Restart the FLL? */
        if (wm8900->fll_out) {
@@ -1189,7 +1189,7 @@ static int wm8900_probe(struct snd_soc_codec *codec)
        wm8900_reset(codec);
 
        /* Turn the chip on */
-       wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        /* Latch the volume update bits */
        snd_soc_update_bits(codec, WM8900_REG_LINVOL, 0x100, 0x100);
index e4142b4309eb577c5efb866a8a75994f7ed93dea..4b4b9973c74094d13dfb82d04a41106386ff85fd 100644 (file)
@@ -707,7 +707,7 @@ static int wm8940_probe(struct snd_soc_codec *codec)
                return ret;
        }
 
-       wm8940_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        ret = snd_soc_write(codec, WM8940_POWER1, 0x180);
        if (ret < 0)
index 00bec915d6522152a5d40dcc3d2df52ef16424eb..8080eabf63bda47d7d0486548da741f8625f2b6b 100644 (file)
@@ -929,7 +929,7 @@ static int wm8955_probe(struct snd_soc_codec *codec)
                                            WM8955_DMEN, WM8955_DMEN);
        }
 
-       wm8955_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        /* Bias level configuration will have done an extra enable */
        regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies);
index cf70329117211806ad7f43a38bd3725b6cc1b0e0..572b1bf07d6c41de9ba8c41a7d2b83367b003fff 100644 (file)
@@ -928,7 +928,7 @@ static int wm8978_suspend(struct snd_soc_codec *codec)
 {
        struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
 
-       wm8978_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
        /* Also switch PLL off */
        snd_soc_write(codec, WM8978_POWER_MANAGEMENT_1, 0);
 
@@ -944,7 +944,7 @@ static int wm8978_resume(struct snd_soc_codec *codec)
        /* Sync reg_cache with the hardware */
        regcache_sync(wm8978->regmap);
 
-       wm8978_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        if (wm8978->f_pllout)
                /* Switch PLL on */
index c93bffcb3cfba2e3953b53b571e046a9553ff5a0..c642b3abba5de2a8c8995d8e159f1f55486992c7 100644 (file)
@@ -1281,7 +1281,7 @@ static int wm8990_probe(struct snd_soc_codec *codec)
        wm8990_reset(codec);
 
        /* charge output caps */
-       wm8990_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        snd_soc_update_bits(codec, WM8990_AUDIO_INTERFACE_4,
                            WM8990_ALRCGPIO1, WM8990_ALRCGPIO1);
index 2e70a270eb2894f36ccb5cacd3fd618dee45256c..b8385ac26b90cab575f62539c20f0f5c6cbc0934 100644 (file)
@@ -1563,7 +1563,7 @@ static int wm8993_suspend(struct snd_soc_codec *codec)
        wm8993->fll_fout = fll_fout;
        wm8993->fll_fref = fll_fref;
 
-       wm8993_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
 
        return 0;
 }
@@ -1573,7 +1573,7 @@ static int wm8993_resume(struct snd_soc_codec *codec)
        struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
        int ret;
 
-       wm8993_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        /* Restart the FLL? */
        if (wm8993->fll_fout) {
index 4fbc7689339a8903f724fa9aefcb6feb31dad54f..fedf48d8e7ae490b544c0e77dcad9d09ec433553 100644 (file)
@@ -3163,7 +3163,7 @@ static int wm8994_codec_suspend(struct snd_soc_codec *codec)
                                 i + 1, ret);
        }
 
-       wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
 
        return 0;
 }
index 98c9525bd751fbacb0eec07f6465869cbc3e2aa5..9119a779f728aede3c3c91b9e8f35c25e172d61b 100644 (file)
@@ -646,7 +646,7 @@ static int wm9712_soc_resume(struct snd_soc_codec *codec)
        if (ret < 0)
                return ret;
 
-       wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        if (ret == 0) {
                /* Sync reg_cache with the hardware after cold reset */
index 79552953e1bdc607e4d25c95aa5ab473637be6cc..39c3e717c577cd601b6eb48ec75722150a88f44c 100644 (file)
@@ -1201,7 +1201,7 @@ static int wm9713_soc_resume(struct snd_soc_codec *codec)
        if (ret < 0)
                return ret;
 
-       wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
        /* do we need to re-start the PLL ? */
        if (wm9713->pll_in)