Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182837
b: refs/heads/master
c: a96ca33
h: refs/heads/master
i:
  182835: 9bfb9b7
v: v3
  • Loading branch information
Mark Brown committed Jan 21, 2010
1 parent c697f22 commit 3e8084b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b91b8fa02482a5a18f598ee5d2cd42970051731b
refs/heads/master: a96ca3387382498ec8b501db5acef3ed9eb1bd36
2 changes: 2 additions & 0 deletions trunk/include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ struct snd_soc_codec {
short reg_cache_size;
short reg_cache_step;

unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */

/* dapm */
u32 pop_time;
struct list_head dapm_widgets;
Expand Down
25 changes: 24 additions & 1 deletion trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,13 +1012,28 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
sys_power = 0;
break;
case SND_SOC_DAPM_STREAM_NOP:
sys_power = codec->bias_level != SND_SOC_BIAS_STANDBY;
switch (codec->bias_level) {
case SND_SOC_BIAS_STANDBY:
case SND_SOC_BIAS_OFF:
sys_power = 0;
break;
default:
sys_power = 1;
break;
}
break;
default:
break;
}
}

if (sys_power && codec->bias_level == SND_SOC_BIAS_OFF) {
ret = snd_soc_dapm_set_bias_level(socdev,
SND_SOC_BIAS_STANDBY);
if (ret != 0)
pr_err("Failed to turn on bias: %d\n", ret);
}

/* If we're changing to all on or all off then prepare */
if ((sys_power && codec->bias_level == SND_SOC_BIAS_STANDBY) ||
(!sys_power && codec->bias_level == SND_SOC_BIAS_ON)) {
Expand All @@ -1042,6 +1057,14 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
pr_err("Failed to apply standby bias: %d\n", ret);
}

/* If we're in standby and can support bias off then do that */
if (codec->bias_level == SND_SOC_BIAS_STANDBY &&
codec->idle_bias_off) {
ret = snd_soc_dapm_set_bias_level(socdev, SND_SOC_BIAS_OFF);
if (ret != 0)
pr_err("Failed to turn off bias: %d\n", ret);
}

/* If we just powered up then move to active bias */
if (codec->bias_level == SND_SOC_BIAS_PREPARE && sys_power) {
ret = snd_soc_dapm_set_bias_level(socdev,
Expand Down

0 comments on commit 3e8084b

Please sign in to comment.