diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-09-04 13:44:10 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-04 15:10:25 -0400 |
commit | cd5d3a151118cd815be15970db099bcdb3f0ad12 (patch) | |
tree | 029f3a14e5f6e45ec2465206f2bfea573a901638 /sound/soc/codecs/adav80x.c | |
parent | 0e0f9b960a011a9e3815004f37cc475229170dfd (diff) |
ASoC: adav80x: 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. While we are at it also remove the
regcache_cache_only() calls from suspend/resume as there shouldn't be any IO
between suspend and resume.
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>
Diffstat (limited to 'sound/soc/codecs/adav80x.c')
-rw-r--r-- | sound/soc/codecs/adav80x.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c index c43b93fdf0df..ce3cdca9fc62 100644 --- a/sound/soc/codecs/adav80x.c +++ b/sound/soc/codecs/adav80x.c | |||
@@ -812,42 +812,23 @@ static int adav80x_probe(struct snd_soc_codec *codec) | |||
812 | /* Disable DAC zero flag */ | 812 | /* Disable DAC zero flag */ |
813 | regmap_write(adav80x->regmap, ADAV80X_DAC_CTRL3, 0x6); | 813 | regmap_write(adav80x->regmap, ADAV80X_DAC_CTRL3, 0x6); |
814 | 814 | ||
815 | return adav80x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 815 | return 0; |
816 | } | ||
817 | |||
818 | static int adav80x_suspend(struct snd_soc_codec *codec) | ||
819 | { | ||
820 | struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); | ||
821 | int ret; | ||
822 | |||
823 | ret = adav80x_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
824 | regcache_cache_only(adav80x->regmap, true); | ||
825 | |||
826 | return ret; | ||
827 | } | 816 | } |
828 | 817 | ||
829 | static int adav80x_resume(struct snd_soc_codec *codec) | 818 | static int adav80x_resume(struct snd_soc_codec *codec) |
830 | { | 819 | { |
831 | struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); | 820 | struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); |
832 | 821 | ||
833 | regcache_cache_only(adav80x->regmap, false); | ||
834 | adav80x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
835 | regcache_sync(adav80x->regmap); | 822 | regcache_sync(adav80x->regmap); |
836 | 823 | ||
837 | return 0; | 824 | return 0; |
838 | } | 825 | } |
839 | 826 | ||
840 | static int adav80x_remove(struct snd_soc_codec *codec) | ||
841 | { | ||
842 | return adav80x_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
843 | } | ||
844 | |||
845 | static struct snd_soc_codec_driver adav80x_codec_driver = { | 827 | static struct snd_soc_codec_driver adav80x_codec_driver = { |
846 | .probe = adav80x_probe, | 828 | .probe = adav80x_probe, |
847 | .remove = adav80x_remove, | ||
848 | .suspend = adav80x_suspend, | ||
849 | .resume = adav80x_resume, | 829 | .resume = adav80x_resume, |
850 | .set_bias_level = adav80x_set_bias_level, | 830 | .set_bias_level = adav80x_set_bias_level, |
831 | .suspend_bias_off = true, | ||
851 | 832 | ||
852 | .set_pll = adav80x_set_pll, | 833 | .set_pll = adav80x_set_pll, |
853 | .set_sysclk = adav80x_set_sysclk, | 834 | .set_sysclk = adav80x_set_sysclk, |