aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-30 09:29:14 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-04-05 11:20:49 -0400
commitd522ffbfb9fccf6eca283cd2e8b03cf3d21fb616 (patch)
treea3dd5826bb8c4d13f886d21ec460b8e45d058fe7 /sound
parent4dcc93d0ede49fae32dd0ee41c685db1be14c529 (diff)
ASoC: Only do WM8994 bias off transition from standby
Otherwise we may try to power down multiple times when the using idle bias off and the driver is removed. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8994.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index c80218f23bb9..f8355ac76a42 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3007,34 +3007,39 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
3007 break; 3007 break;
3008 3008
3009 case SND_SOC_BIAS_OFF: 3009 case SND_SOC_BIAS_OFF:
3010 /* Switch over to startup biases */ 3010 if (codec->bias_level == SND_SOC_BIAS_STANDBY) {
3011 snd_soc_update_bits(codec, WM8994_ANTIPOP_2, 3011 /* Switch over to startup biases */
3012 WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA | 3012 snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
3013 WM8994_VMID_BUF_ENA | 3013 WM8994_BIAS_SRC |
3014 WM8994_VMID_RAMP_MASK, 3014 WM8994_STARTUP_BIAS_ENA |
3015 WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA | 3015 WM8994_VMID_BUF_ENA |
3016 WM8994_VMID_BUF_ENA | 3016 WM8994_VMID_RAMP_MASK,
3017 (1 << WM8994_VMID_RAMP_SHIFT)); 3017 WM8994_BIAS_SRC |
3018 3018 WM8994_STARTUP_BIAS_ENA |
3019 /* Disable main biases */ 3019 WM8994_VMID_BUF_ENA |
3020 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1, 3020 (1 << WM8994_VMID_RAMP_SHIFT));
3021 WM8994_BIAS_ENA | WM8994_VMID_SEL_MASK, 0);
3022 3021
3023 /* Discharge line */ 3022 /* Disable main biases */
3024 snd_soc_update_bits(codec, WM8994_ANTIPOP_1, 3023 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
3025 WM8994_LINEOUT1_DISCH | 3024 WM8994_BIAS_ENA |
3026 WM8994_LINEOUT2_DISCH, 3025 WM8994_VMID_SEL_MASK, 0);
3027 WM8994_LINEOUT1_DISCH |
3028 WM8994_LINEOUT2_DISCH);
3029 3026
3030 msleep(5); 3027 /* Discharge line */
3028 snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
3029 WM8994_LINEOUT1_DISCH |
3030 WM8994_LINEOUT2_DISCH,
3031 WM8994_LINEOUT1_DISCH |
3032 WM8994_LINEOUT2_DISCH);
3031 3033
3032 /* Switch off startup biases */ 3034 msleep(5);
3033 snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
3034 WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA |
3035 WM8994_VMID_BUF_ENA |
3036 WM8994_VMID_RAMP_MASK, 0);
3037 3035
3036 /* Switch off startup biases */
3037 snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
3038 WM8994_BIAS_SRC |
3039 WM8994_STARTUP_BIAS_ENA |
3040 WM8994_VMID_BUF_ENA |
3041 WM8994_VMID_RAMP_MASK, 0);
3042 }
3038 break; 3043 break;
3039 } 3044 }
3040 codec->bias_level = level; 3045 codec->bias_level = level;