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

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

ASoC: max9850: Cleanup manual bias level transitions



Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f114040e
Loading
Loading
Loading
Loading
+1 −21
Original line number Diff line number Diff line
@@ -291,25 +291,6 @@ static struct snd_soc_dai_driver max9850_dai = {
	.ops = &max9850_dai_ops,
};

#ifdef CONFIG_PM
static int max9850_suspend(struct snd_soc_codec *codec)
{
	max9850_set_bias_level(codec, SND_SOC_BIAS_OFF);

	return 0;
}

static int max9850_resume(struct snd_soc_codec *codec)
{
	max9850_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	return 0;
}
#else
#define max9850_suspend NULL
#define max9850_resume NULL
#endif

static int max9850_probe(struct snd_soc_codec *codec)
{
	/* enable zero-detect */
@@ -324,9 +305,8 @@ static int max9850_probe(struct snd_soc_codec *codec)

static struct snd_soc_codec_driver soc_codec_dev_max9850 = {
	.probe =	max9850_probe,
	.suspend =	max9850_suspend,
	.resume =	max9850_resume,
	.set_bias_level = max9850_set_bias_level,
	.suspend_bias_off = true,

	.controls = max9850_controls,
	.num_controls = ARRAY_SIZE(max9850_controls),