diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-09-04 13:44:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-04 15:10:25 -0400 |
commit | 0e0f9b960a011a9e3815004f37cc475229170dfd (patch) | |
tree | 6b3a83cc7ad07956b23eb84ef0edbb6797ad2268 /sound/soc | |
parent | d7858bd647cda68bf832997a280a2f44aec01f1b (diff) |
ASoC: adau17x1: 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>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/adau1761.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/adau1781.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/adau17x1.c | 8 | ||||
-rw-r--r-- | sound/soc/codecs/adau17x1.h | 1 |
4 files changed, 2 insertions, 11 deletions
diff --git a/sound/soc/codecs/adau1761.c b/sound/soc/codecs/adau1761.c index 848cab839553..5518ebd6947c 100644 --- a/sound/soc/codecs/adau1761.c +++ b/sound/soc/codecs/adau1761.c | |||
@@ -714,9 +714,9 @@ static int adau1761_codec_probe(struct snd_soc_codec *codec) | |||
714 | 714 | ||
715 | static const struct snd_soc_codec_driver adau1761_codec_driver = { | 715 | static const struct snd_soc_codec_driver adau1761_codec_driver = { |
716 | .probe = adau1761_codec_probe, | 716 | .probe = adau1761_codec_probe, |
717 | .suspend = adau17x1_suspend, | ||
718 | .resume = adau17x1_resume, | 717 | .resume = adau17x1_resume, |
719 | .set_bias_level = adau1761_set_bias_level, | 718 | .set_bias_level = adau1761_set_bias_level, |
719 | .suspend_bias_off = true, | ||
720 | 720 | ||
721 | .controls = adau1761_controls, | 721 | .controls = adau1761_controls, |
722 | .num_controls = ARRAY_SIZE(adau1761_controls), | 722 | .num_controls = ARRAY_SIZE(adau1761_controls), |
diff --git a/sound/soc/codecs/adau1781.c b/sound/soc/codecs/adau1781.c index 045a61413840..e9fc00fb13dd 100644 --- a/sound/soc/codecs/adau1781.c +++ b/sound/soc/codecs/adau1781.c | |||
@@ -446,9 +446,9 @@ static int adau1781_codec_probe(struct snd_soc_codec *codec) | |||
446 | 446 | ||
447 | static const struct snd_soc_codec_driver adau1781_codec_driver = { | 447 | static const struct snd_soc_codec_driver adau1781_codec_driver = { |
448 | .probe = adau1781_codec_probe, | 448 | .probe = adau1781_codec_probe, |
449 | .suspend = adau17x1_suspend, | ||
450 | .resume = adau17x1_resume, | 449 | .resume = adau17x1_resume, |
451 | .set_bias_level = adau1781_set_bias_level, | 450 | .set_bias_level = adau1781_set_bias_level, |
451 | .suspend_bias_off = true, | ||
452 | 452 | ||
453 | .controls = adau1781_controls, | 453 | .controls = adau1781_controls, |
454 | .num_controls = ARRAY_SIZE(adau1781_controls), | 454 | .num_controls = ARRAY_SIZE(adau1781_controls), |
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c index 0b659704e60c..3e16c1c64115 100644 --- a/sound/soc/codecs/adau17x1.c +++ b/sound/soc/codecs/adau17x1.c | |||
@@ -815,13 +815,6 @@ int adau17x1_add_routes(struct snd_soc_codec *codec) | |||
815 | } | 815 | } |
816 | EXPORT_SYMBOL_GPL(adau17x1_add_routes); | 816 | EXPORT_SYMBOL_GPL(adau17x1_add_routes); |
817 | 817 | ||
818 | int adau17x1_suspend(struct snd_soc_codec *codec) | ||
819 | { | ||
820 | codec->driver->set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
821 | return 0; | ||
822 | } | ||
823 | EXPORT_SYMBOL_GPL(adau17x1_suspend); | ||
824 | |||
825 | int adau17x1_resume(struct snd_soc_codec *codec) | 818 | int adau17x1_resume(struct snd_soc_codec *codec) |
826 | { | 819 | { |
827 | struct adau *adau = snd_soc_codec_get_drvdata(codec); | 820 | struct adau *adau = snd_soc_codec_get_drvdata(codec); |
@@ -829,7 +822,6 @@ int adau17x1_resume(struct snd_soc_codec *codec) | |||
829 | if (adau->switch_mode) | 822 | if (adau->switch_mode) |
830 | adau->switch_mode(codec->dev); | 823 | adau->switch_mode(codec->dev); |
831 | 824 | ||
832 | codec->driver->set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
833 | regcache_sync(adau->regmap); | 825 | regcache_sync(adau->regmap); |
834 | 826 | ||
835 | return 0; | 827 | return 0; |
diff --git a/sound/soc/codecs/adau17x1.h b/sound/soc/codecs/adau17x1.h index 3ffabaf4c7a8..e4a557fd7155 100644 --- a/sound/soc/codecs/adau17x1.h +++ b/sound/soc/codecs/adau17x1.h | |||
@@ -52,7 +52,6 @@ int adau17x1_set_micbias_voltage(struct snd_soc_codec *codec, | |||
52 | enum adau17x1_micbias_voltage micbias); | 52 | enum adau17x1_micbias_voltage micbias); |
53 | bool adau17x1_readable_register(struct device *dev, unsigned int reg); | 53 | bool adau17x1_readable_register(struct device *dev, unsigned int reg); |
54 | bool adau17x1_volatile_register(struct device *dev, unsigned int reg); | 54 | bool adau17x1_volatile_register(struct device *dev, unsigned int reg); |
55 | int adau17x1_suspend(struct snd_soc_codec *codec); | ||
56 | int adau17x1_resume(struct snd_soc_codec *codec); | 55 | int adau17x1_resume(struct snd_soc_codec *codec); |
57 | 56 | ||
58 | extern const struct snd_soc_dai_ops adau17x1_dai_ops; | 57 | extern const struct snd_soc_dai_ops adau17x1_dai_ops; |