Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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;
}
+1 −1
Original line number Diff line number Diff line
@@ -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);
Loading