aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-08-17 06:55:38 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-08-17 07:57:59 -0400
commitb14b76a56e49946488637ee68926c5180c39fdb1 (patch)
treef050961f0527272bb9daffe6479deb363e579053 /sound/soc/soc-dapm.c
parent0c093fb5421a648fae46fce17277bdb358fe017b (diff)
ASoC: Fix handling of bias levels for non-DAPM codecs
If the system doesn't have any DAPM widgets then we can't use their state to check if the bias level for the codec should be up. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index c68c204a48ad..8997fb34dddd 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -966,6 +966,22 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
966 } 966 }
967 } 967 }
968 968
969 /* If there are no DAPM widgets then try to figure out power from the
970 * event type.
971 */
972 if (list_empty(&codec->dapm_widgets)) {
973 switch (event) {
974 case SND_SOC_DAPM_STREAM_START:
975 case SND_SOC_DAPM_STREAM_RESUME:
976 sys_power = 1;
977 break;
978 case SND_SOC_DAPM_STREAM_NOP:
979 sys_power = codec->bias_level != SND_SOC_BIAS_STANDBY;
980 default:
981 break;
982 }
983 }
984
969 /* If we're changing to all on or all off then prepare */ 985 /* If we're changing to all on or all off then prepare */
970 if ((sys_power && codec->bias_level == SND_SOC_BIAS_STANDBY) || 986 if ((sys_power && codec->bias_level == SND_SOC_BIAS_STANDBY) ||
971 (!sys_power && codec->bias_level == SND_SOC_BIAS_ON)) { 987 (!sys_power && codec->bias_level == SND_SOC_BIAS_ON)) {