Commit bd1204cb authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

ASoC: Route all bias level updates through the core

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fa880775
...@@ -2198,7 +2198,7 @@ static int max98095_suspend(struct snd_soc_codec *codec) ...@@ -2198,7 +2198,7 @@ static int max98095_suspend(struct snd_soc_codec *codec)
if (max98095->headphone_jack || max98095->mic_jack) if (max98095->headphone_jack || max98095->mic_jack)
max98095_jack_detect_disable(codec); 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; return 0;
} }
...@@ -2208,7 +2208,7 @@ static int max98095_resume(struct snd_soc_codec *codec) ...@@ -2208,7 +2208,7 @@ static int max98095_resume(struct snd_soc_codec *codec)
struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
struct i2c_client *client = to_i2c_client(codec->dev); 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) { if (max98095->headphone_jack || max98095->mic_jack) {
max98095_jack_detect_enable(codec); max98095_jack_detect_enable(codec);
......
...@@ -1939,7 +1939,7 @@ static int rt5640_probe(struct snd_soc_codec *codec) ...@@ -1939,7 +1939,7 @@ static int rt5640_probe(struct snd_soc_codec *codec)
rt5640->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_DUMMY1, 0x0301, 0x0301);
snd_soc_update_bits(codec, RT5640_MICBIAS, 0x0030, 0x0030); snd_soc_update_bits(codec, RT5640_MICBIAS, 0x0030, 0x0030);
...@@ -1991,7 +1991,7 @@ static int rt5640_suspend(struct snd_soc_codec *codec) ...@@ -1991,7 +1991,7 @@ static int rt5640_suspend(struct snd_soc_codec *codec)
{ {
struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(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); rt5640_reset(codec);
regcache_cache_only(rt5640->regmap, true); regcache_cache_only(rt5640->regmap, true);
regcache_mark_dirty(rt5640->regmap); regcache_mark_dirty(rt5640->regmap);
......
...@@ -2520,7 +2520,7 @@ static int rt5645_probe(struct snd_soc_codec *codec) ...@@ -2520,7 +2520,7 @@ static int rt5645_probe(struct snd_soc_codec *codec)
break; 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); snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200);
......
...@@ -1625,7 +1625,7 @@ static int rt5651_probe(struct snd_soc_codec *codec) ...@@ -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_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; return 0;
} }
......
...@@ -4618,7 +4618,7 @@ static int rt5677_probe(struct snd_soc_codec *codec) ...@@ -4618,7 +4618,7 @@ static int rt5677_probe(struct snd_soc_codec *codec)
ARRAY_SIZE(rt5677_dmic2_clk_1)); 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_DIG_MISC, 0x0020);
regmap_write(rt5677->regmap, RT5677_PWR_DSP2, 0x0c00); regmap_write(rt5677->regmap, RT5677_PWR_DSP2, 0x0c00);
......
...@@ -970,7 +970,7 @@ static int sta32x_probe(struct snd_soc_codec *codec) ...@@ -970,7 +970,7 @@ static int sta32x_probe(struct snd_soc_codec *codec)
if (sta32x->pdata->needs_esd_watchdog) if (sta32x->pdata->needs_esd_watchdog)
INIT_DELAYED_WORK(&sta32x->watchdog_work, sta32x_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 */ /* Bias level configuration will have done an extra enable */
regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
......
...@@ -1037,7 +1037,7 @@ static int sta350_probe(struct snd_soc_codec *codec) ...@@ -1037,7 +1037,7 @@ static int sta350_probe(struct snd_soc_codec *codec)
sta350->coef_shadow[60] = 0x400000; sta350->coef_shadow[60] = 0x400000;
sta350->coef_shadow[61] = 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 */ /* Bias level configuration will have done an extra enable */
regulator_bulk_disable(ARRAY_SIZE(sta350->supplies), sta350->supplies); regulator_bulk_disable(ARRAY_SIZE(sta350->supplies), sta350->supplies);
......
...@@ -1130,7 +1130,7 @@ static int twl6040_probe(struct snd_soc_codec *codec) ...@@ -1130,7 +1130,7 @@ static int twl6040_probe(struct snd_soc_codec *codec)
return ret; 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); twl6040_init_chip(codec);
return 0; return 0;
......
...@@ -599,7 +599,7 @@ static int wm8731_probe(struct snd_soc_codec *codec) ...@@ -599,7 +599,7 @@ static int wm8731_probe(struct snd_soc_codec *codec)
goto err_regulator_enable; 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 */ /* Latch the update bits */
snd_soc_update_bits(codec, WM8731_LOUT1V, 0x100, 0); snd_soc_update_bits(codec, WM8731_LOUT1V, 0x100, 0);
......
...@@ -560,7 +560,7 @@ static int wm8737_probe(struct snd_soc_codec *codec) ...@@ -560,7 +560,7 @@ static int wm8737_probe(struct snd_soc_codec *codec)
snd_soc_update_bits(codec, WM8737_RIGHT_PGA_VOLUME, WM8737_RVU, snd_soc_update_bits(codec, WM8737_RIGHT_PGA_VOLUME, WM8737_RVU,
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 */ /* Bias level configuration will have done an extra enable */
regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies); regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);
......
...@@ -1138,7 +1138,7 @@ static int wm8900_suspend(struct snd_soc_codec *codec) ...@@ -1138,7 +1138,7 @@ static int wm8900_suspend(struct snd_soc_codec *codec)
wm8900->fll_out = fll_out; wm8900->fll_out = fll_out;
wm8900->fll_in = fll_in; 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; return 0;
} }
...@@ -1156,7 +1156,7 @@ static int wm8900_resume(struct snd_soc_codec *codec) ...@@ -1156,7 +1156,7 @@ static int wm8900_resume(struct snd_soc_codec *codec)
return ret; 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? */ /* Restart the FLL? */
if (wm8900->fll_out) { if (wm8900->fll_out) {
...@@ -1189,7 +1189,7 @@ static int wm8900_probe(struct snd_soc_codec *codec) ...@@ -1189,7 +1189,7 @@ static int wm8900_probe(struct snd_soc_codec *codec)
wm8900_reset(codec); wm8900_reset(codec);
/* Turn the chip on */ /* 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 */ /* Latch the volume update bits */
snd_soc_update_bits(codec, WM8900_REG_LINVOL, 0x100, 0x100); snd_soc_update_bits(codec, WM8900_REG_LINVOL, 0x100, 0x100);
......
...@@ -707,7 +707,7 @@ static int wm8940_probe(struct snd_soc_codec *codec) ...@@ -707,7 +707,7 @@ static int wm8940_probe(struct snd_soc_codec *codec)
return ret; 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); ret = snd_soc_write(codec, WM8940_POWER1, 0x180);
if (ret < 0) if (ret < 0)
......
...@@ -929,7 +929,7 @@ static int wm8955_probe(struct snd_soc_codec *codec) ...@@ -929,7 +929,7 @@ static int wm8955_probe(struct snd_soc_codec *codec)
WM8955_DMEN, WM8955_DMEN); 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 */ /* Bias level configuration will have done an extra enable */
regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies);
......
...@@ -928,7 +928,7 @@ static int wm8978_suspend(struct snd_soc_codec *codec) ...@@ -928,7 +928,7 @@ static int wm8978_suspend(struct snd_soc_codec *codec)
{ {
struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(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 */ /* Also switch PLL off */
snd_soc_write(codec, WM8978_POWER_MANAGEMENT_1, 0); snd_soc_write(codec, WM8978_POWER_MANAGEMENT_1, 0);
...@@ -944,7 +944,7 @@ static int wm8978_resume(struct snd_soc_codec *codec) ...@@ -944,7 +944,7 @@ static int wm8978_resume(struct snd_soc_codec *codec)
/* Sync reg_cache with the hardware */ /* Sync reg_cache with the hardware */
regcache_sync(wm8978->regmap); 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) if (wm8978->f_pllout)
/* Switch PLL on */ /* Switch PLL on */
......
...@@ -1281,7 +1281,7 @@ static int wm8990_probe(struct snd_soc_codec *codec) ...@@ -1281,7 +1281,7 @@ static int wm8990_probe(struct snd_soc_codec *codec)
wm8990_reset(codec); wm8990_reset(codec);
/* charge output caps */ /* 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, snd_soc_update_bits(codec, WM8990_AUDIO_INTERFACE_4,
WM8990_ALRCGPIO1, WM8990_ALRCGPIO1); WM8990_ALRCGPIO1, WM8990_ALRCGPIO1);
......
...@@ -1563,7 +1563,7 @@ static int wm8993_suspend(struct snd_soc_codec *codec) ...@@ -1563,7 +1563,7 @@ static int wm8993_suspend(struct snd_soc_codec *codec)
wm8993->fll_fout = fll_fout; wm8993->fll_fout = fll_fout;
wm8993->fll_fref = fll_fref; 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; return 0;
} }
...@@ -1573,7 +1573,7 @@ static int wm8993_resume(struct snd_soc_codec *codec) ...@@ -1573,7 +1573,7 @@ static int wm8993_resume(struct snd_soc_codec *codec)
struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
int ret; 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? */ /* Restart the FLL? */
if (wm8993->fll_fout) { if (wm8993->fll_fout) {
......
...@@ -3163,7 +3163,7 @@ static int wm8994_codec_suspend(struct snd_soc_codec *codec) ...@@ -3163,7 +3163,7 @@ static int wm8994_codec_suspend(struct snd_soc_codec *codec)
i + 1, ret); 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; return 0;
} }
......
...@@ -646,7 +646,7 @@ static int wm9712_soc_resume(struct snd_soc_codec *codec) ...@@ -646,7 +646,7 @@ static int wm9712_soc_resume(struct snd_soc_codec *codec)
if (ret < 0) if (ret < 0)
return ret; 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) { if (ret == 0) {
/* Sync reg_cache with the hardware after cold reset */ /* Sync reg_cache with the hardware after cold reset */
......
...@@ -1201,7 +1201,7 @@ static int wm9713_soc_resume(struct snd_soc_codec *codec) ...@@ -1201,7 +1201,7 @@ static int wm9713_soc_resume(struct snd_soc_codec *codec)
if (ret < 0) if (ret < 0)
return ret; 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 ? */ /* do we need to re-start the PLL ? */
if (wm9713->pll_in) if (wm9713->pll_in)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment