diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-10-20 04:56:36 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-22 06:32:16 -0400 |
commit | 815b776cf5983ab69d548146fb979adac5dec4de (patch) | |
tree | 59708d959292d0eec7ab455f69a33276ac015208 | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
ASoC: sta32x: 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.
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/sta32x.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index 48740855566d..7e18200dd6a9 100644 --- a/sound/soc/codecs/sta32x.c +++ b/sound/soc/codecs/sta32x.c | |||
@@ -833,23 +833,6 @@ static struct snd_soc_dai_driver sta32x_dai = { | |||
833 | .ops = &sta32x_dai_ops, | 833 | .ops = &sta32x_dai_ops, |
834 | }; | 834 | }; |
835 | 835 | ||
836 | #ifdef CONFIG_PM | ||
837 | static int sta32x_suspend(struct snd_soc_codec *codec) | ||
838 | { | ||
839 | sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
840 | return 0; | ||
841 | } | ||
842 | |||
843 | static int sta32x_resume(struct snd_soc_codec *codec) | ||
844 | { | ||
845 | sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
846 | return 0; | ||
847 | } | ||
848 | #else | ||
849 | #define sta32x_suspend NULL | ||
850 | #define sta32x_resume NULL | ||
851 | #endif | ||
852 | |||
853 | static int sta32x_probe(struct snd_soc_codec *codec) | 836 | static int sta32x_probe(struct snd_soc_codec *codec) |
854 | { | 837 | { |
855 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); | 838 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); |
@@ -936,7 +919,6 @@ static int sta32x_remove(struct snd_soc_codec *codec) | |||
936 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); | 919 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); |
937 | 920 | ||
938 | sta32x_watchdog_stop(sta32x); | 921 | sta32x_watchdog_stop(sta32x); |
939 | sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
940 | regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); | 922 | regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); |
941 | 923 | ||
942 | return 0; | 924 | return 0; |
@@ -955,9 +937,8 @@ static bool sta32x_reg_is_volatile(struct device *dev, unsigned int reg) | |||
955 | static const struct snd_soc_codec_driver sta32x_codec = { | 937 | static const struct snd_soc_codec_driver sta32x_codec = { |
956 | .probe = sta32x_probe, | 938 | .probe = sta32x_probe, |
957 | .remove = sta32x_remove, | 939 | .remove = sta32x_remove, |
958 | .suspend = sta32x_suspend, | ||
959 | .resume = sta32x_resume, | ||
960 | .set_bias_level = sta32x_set_bias_level, | 940 | .set_bias_level = sta32x_set_bias_level, |
941 | .suspend_bias_off = true, | ||
961 | .controls = sta32x_snd_controls, | 942 | .controls = sta32x_snd_controls, |
962 | .num_controls = ARRAY_SIZE(sta32x_snd_controls), | 943 | .num_controls = ARRAY_SIZE(sta32x_snd_controls), |
963 | .dapm_widgets = sta32x_dapm_widgets, | 944 | .dapm_widgets = sta32x_dapm_widgets, |