Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148201
b: refs/heads/master
c: cd0f2d4
h: refs/heads/master
i:
  148199: c4fb983
v: v3
  • Loading branch information
Mark Brown committed Apr 20, 2009
1 parent 882fad6 commit b9a2ded
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 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: 9b5b0c01598f9782690b09ce6c49f4ba116dde44
refs/heads/master: cd0f2d4736ae8efabc60e54ecc8f677d0eddce02
19 changes: 14 additions & 5 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,19 @@ static int dapm_generic_apply_power(struct snd_soc_dapm_widget *w)
return 0;
}

/* Generic check to see if a widget should be powered.
*/
static int dapm_generic_check_power(struct snd_soc_dapm_widget *w)
{
int in, out;

in = is_connected_input_ep(w);
dapm_clear_walk(w->codec);
out = is_connected_output_ep(w);
dapm_clear_walk(w->codec);
return out != 0 && in != 0;
}

/*
* Scan a single DAPM widget for a complete audio path and update the
* power status appropriately.
Expand Down Expand Up @@ -653,11 +666,7 @@ static int dapm_power_widget(struct snd_soc_codec *codec, int event,
}

/* all other widgets */
in = is_connected_input_ep(w);
dapm_clear_walk(w->codec);
out = is_connected_output_ep(w);
dapm_clear_walk(w->codec);
power = (out != 0 && in != 0) ? 1 : 0;
power = dapm_generic_check_power(w);
power_change = (w->power == power) ? 0 : 1;
w->power = power;

Expand Down

0 comments on commit b9a2ded

Please sign in to comment.