Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182781
b: refs/heads/master
c: 283375c
h: refs/heads/master
i:
  182779: 5dff2be
v: v3
  • Loading branch information
Mark Brown committed Dec 16, 2009
1 parent 0152aab commit 23fd62b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 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: ffbfd336f9eac361e1630cfcb17a70607551daf2
refs/heads/master: 283375cefbf4f91ce51d93d010634c48d0d39044
26 changes: 14 additions & 12 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,7 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,

/* test and update the power status of a mixer or switch widget */
static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int reg,
int val_mask, int val, int invert)
struct snd_kcontrol *kcontrol, int connect)
{
struct snd_soc_dapm_path *path;
int found = 0;
Expand All @@ -1273,22 +1272,14 @@ static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
widget->id != snd_soc_dapm_switch)
return -ENODEV;

if (!snd_soc_test_bits(widget->codec, reg, val_mask, val))
return 0;

/* find dapm widget path assoc with kcontrol */
list_for_each_entry(path, &widget->codec->dapm_paths, list) {
if (path->kcontrol != kcontrol)
continue;

/* found, now check type */
found = 1;
if (val)
/* new connection */
path->connect = invert ? 0:1;
else
/* old connection must be powered down */
path->connect = invert ? 1:0;
path->connect = connect;
break;
}

Expand Down Expand Up @@ -1695,6 +1686,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert;
unsigned int val, val2, val_mask;
int connect;
int ret;

val = (ucontrol->value.integer.value[0] & mask);
Expand All @@ -1721,7 +1713,17 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
return 1;
}

dapm_mixer_update_power(widget, kcontrol, reg, val_mask, val, invert);
if (snd_soc_test_bits(widget->codec, reg, val_mask, val)) {
if (val)
/* new connection */
connect = invert ? 0:1;
else
/* old connection must be powered down */
connect = invert ? 1:0;

dapm_mixer_update_power(widget, kcontrol, connect);
}

if (widget->event) {
if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
ret = widget->event(widget, kcontrol,
Expand Down

0 comments on commit 23fd62b

Please sign in to comment.