Skip to content

Commit

Permalink
ASoC: sta529: Cleanup manual bias level transitions
Browse files Browse the repository at this point in the history
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.

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Oct 22, 2014
1 parent f114040 commit cfbb77c
Showing 1 changed file with 2 additions and 33 deletions.
35 changes: 2 additions & 33 deletions sound/soc/codecs/sta529.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,41 +319,10 @@ static struct snd_soc_dai_driver sta529_dai = {
.ops = &sta529_dai_ops,
};

static int sta529_probe(struct snd_soc_codec *codec)
{
sta529_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

/* power down chip */
static int sta529_remove(struct snd_soc_codec *codec)
{
sta529_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int sta529_suspend(struct snd_soc_codec *codec)
{
sta529_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int sta529_resume(struct snd_soc_codec *codec)
{
sta529_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static const struct snd_soc_codec_driver sta529_codec_driver = {
.probe = sta529_probe,
.remove = sta529_remove,
.set_bias_level = sta529_set_bias_level,
.suspend = sta529_suspend,
.resume = sta529_resume,
.suspend_bias_off = true,

.controls = sta529_snd_controls,
.num_controls = ARRAY_SIZE(sta529_snd_controls),
};
Expand Down

0 comments on commit cfbb77c

Please sign in to comment.