Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170163
b: refs/heads/master
c: 3a65577
h: refs/heads/master
i:
  170161: 24d41cb
  170159: 73eeede
v: v3
  • Loading branch information
Mark Brown committed Oct 6, 2009
1 parent f9a94d7 commit 85dcb18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: 1642e3d42a062221e4df18df260d4703d18ca519
refs/heads/master: 3a65577d2199a7b33c85fd32838020c39da200f3
16 changes: 9 additions & 7 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,8 +1202,8 @@ void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec)

/* test and update the power status of a mux widget */
static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int mask,
int mux, int val, struct soc_enum *e)
struct snd_kcontrol *kcontrol, int change,
int mux, struct soc_enum *e)
{
struct snd_soc_dapm_path *path;
int found = 0;
Expand All @@ -1212,7 +1212,7 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
widget->id != snd_soc_dapm_value_mux)
return -ENODEV;

if (!snd_soc_test_bits(widget->codec, e->reg, mask, val))
if (!change)
return 0;

/* find dapm widget path assoc with kcontrol */
Expand Down Expand Up @@ -1765,7 +1765,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
{
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int val, mux;
unsigned int val, mux, change;
unsigned int mask, bitmask;
int ret = 0;

Expand All @@ -1785,7 +1785,8 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,

mutex_lock(&widget->codec->mutex);
widget->value = val;
dapm_mux_update_power(widget, kcontrol, mask, mux, val, e);
change = snd_soc_test_bits(widget->codec, e->reg, mask, val);
dapm_mux_update_power(widget, kcontrol, change, mux, e);

if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
ret = widget->event(widget,
Expand Down Expand Up @@ -1864,7 +1865,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
{
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int val, mux;
unsigned int val, mux, change;
unsigned int mask;
int ret = 0;

Expand All @@ -1882,7 +1883,8 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,

mutex_lock(&widget->codec->mutex);
widget->value = val;
dapm_mux_update_power(widget, kcontrol, mask, mux, val, e);
change = snd_soc_test_bits(widget->codec, e->reg, mask, val);
dapm_mux_update_power(widget, kcontrol, change, mux, e);

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

0 comments on commit 85dcb18

Please sign in to comment.