Skip to content

Commit

Permalink
ASoC: tlv320aix31xx: 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.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Nov 27, 2014
1 parent f114040 commit a43a262
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions sound/soc/codecs/tlv320aic31xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,18 +1056,6 @@ static int aic31xx_set_bias_level(struct snd_soc_codec *codec,
return 0;
}

static int aic31xx_suspend(struct snd_soc_codec *codec)
{
aic31xx_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static int aic31xx_resume(struct snd_soc_codec *codec)
{
aic31xx_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
return 0;
}

static int aic31xx_codec_probe(struct snd_soc_codec *codec)
{
int ret = 0;
Expand Down Expand Up @@ -1110,8 +1098,6 @@ static int aic31xx_codec_remove(struct snd_soc_codec *codec)
{
struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
int i;
/* power down chip */
aic31xx_set_bias_level(codec, SND_SOC_BIAS_OFF);

for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++)
regulator_unregister_notifier(aic31xx->supplies[i].consumer,
Expand All @@ -1123,9 +1109,9 @@ static int aic31xx_codec_remove(struct snd_soc_codec *codec)
static struct snd_soc_codec_driver soc_codec_driver_aic31xx = {
.probe = aic31xx_codec_probe,
.remove = aic31xx_codec_remove,
.suspend = aic31xx_suspend,
.resume = aic31xx_resume,
.set_bias_level = aic31xx_set_bias_level,
.suspend_bias_off = true,

.controls = aic31xx_snd_controls,
.num_controls = ARRAY_SIZE(aic31xx_snd_controls),
.dapm_widgets = aic31xx_dapm_widgets,
Expand Down

0 comments on commit a43a262

Please sign in to comment.