Skip to content

Commit

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

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 Sep 4, 2014
1 parent d7858bd commit 0e0f9b9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sound/soc/codecs/adau1761.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,9 @@ static int adau1761_codec_probe(struct snd_soc_codec *codec)

static const struct snd_soc_codec_driver adau1761_codec_driver = {
.probe = adau1761_codec_probe,
.suspend = adau17x1_suspend,
.resume = adau17x1_resume,
.set_bias_level = adau1761_set_bias_level,
.suspend_bias_off = true,

.controls = adau1761_controls,
.num_controls = ARRAY_SIZE(adau1761_controls),
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/adau1781.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,9 @@ static int adau1781_codec_probe(struct snd_soc_codec *codec)

static const struct snd_soc_codec_driver adau1781_codec_driver = {
.probe = adau1781_codec_probe,
.suspend = adau17x1_suspend,
.resume = adau17x1_resume,
.set_bias_level = adau1781_set_bias_level,
.suspend_bias_off = true,

.controls = adau1781_controls,
.num_controls = ARRAY_SIZE(adau1781_controls),
Expand Down
8 changes: 0 additions & 8 deletions sound/soc/codecs/adau17x1.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,21 +815,13 @@ int adau17x1_add_routes(struct snd_soc_codec *codec)
}
EXPORT_SYMBOL_GPL(adau17x1_add_routes);

int adau17x1_suspend(struct snd_soc_codec *codec)
{
codec->driver->set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}
EXPORT_SYMBOL_GPL(adau17x1_suspend);

int adau17x1_resume(struct snd_soc_codec *codec)
{
struct adau *adau = snd_soc_codec_get_drvdata(codec);

if (adau->switch_mode)
adau->switch_mode(codec->dev);

codec->driver->set_bias_level(codec, SND_SOC_BIAS_STANDBY);
regcache_sync(adau->regmap);

return 0;
Expand Down
1 change: 0 additions & 1 deletion sound/soc/codecs/adau17x1.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ int adau17x1_set_micbias_voltage(struct snd_soc_codec *codec,
enum adau17x1_micbias_voltage micbias);
bool adau17x1_readable_register(struct device *dev, unsigned int reg);
bool adau17x1_volatile_register(struct device *dev, unsigned int reg);
int adau17x1_suspend(struct snd_soc_codec *codec);
int adau17x1_resume(struct snd_soc_codec *codec);

extern const struct snd_soc_dai_ops adau17x1_dai_ops;
Expand Down

0 comments on commit 0e0f9b9

Please sign in to comment.