Commit d522ffbf authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 4dcc93d0
...@@ -3007,18 +3007,22 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, ...@@ -3007,18 +3007,22 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
break; break;
case SND_SOC_BIAS_OFF: case SND_SOC_BIAS_OFF:
if (codec->bias_level == SND_SOC_BIAS_STANDBY) {
/* Switch over to startup biases */ /* Switch over to startup biases */
snd_soc_update_bits(codec, WM8994_ANTIPOP_2, snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA | WM8994_BIAS_SRC |
WM8994_STARTUP_BIAS_ENA |
WM8994_VMID_BUF_ENA | WM8994_VMID_BUF_ENA |
WM8994_VMID_RAMP_MASK, WM8994_VMID_RAMP_MASK,
WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA | WM8994_BIAS_SRC |
WM8994_STARTUP_BIAS_ENA |
WM8994_VMID_BUF_ENA | WM8994_VMID_BUF_ENA |
(1 << WM8994_VMID_RAMP_SHIFT)); (1 << WM8994_VMID_RAMP_SHIFT));
/* Disable main biases */ /* Disable main biases */
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1, snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
WM8994_BIAS_ENA | WM8994_VMID_SEL_MASK, 0); WM8994_BIAS_ENA |
WM8994_VMID_SEL_MASK, 0);
/* Discharge line */ /* Discharge line */
snd_soc_update_bits(codec, WM8994_ANTIPOP_1, snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
...@@ -3031,10 +3035,11 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, ...@@ -3031,10 +3035,11 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
/* Switch off startup biases */ /* Switch off startup biases */
snd_soc_update_bits(codec, WM8994_ANTIPOP_2, snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA | WM8994_BIAS_SRC |
WM8994_STARTUP_BIAS_ENA |
WM8994_VMID_BUF_ENA | WM8994_VMID_BUF_ENA |
WM8994_VMID_RAMP_MASK, 0); WM8994_VMID_RAMP_MASK, 0);
}
break; break;
} }
codec->bias_level = level; codec->bias_level = level;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment