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: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f114040e3e
commit
46804120c5
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user