Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305527
b: refs/heads/master
c: 4edbb34
h: refs/heads/master
i:
  305525: 7aee431
  305523: fc1d05c
  305519: dbc7b9c
v: v3
  • Loading branch information
Liam Girdwood authored and Mark Brown committed Apr 1, 2012
1 parent 2988981 commit b47b120
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 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: a73fb2df01866b772a48fab93401fe3edbe0b38d
refs/heads/master: 4edbb34577c98297f958f131e093a150b9f3226f
36 changes: 30 additions & 6 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ static inline void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm)
#endif

/* test and update the power status of a mux widget */
int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
static int soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e)
{
struct snd_soc_dapm_path *path;
Expand Down Expand Up @@ -1758,10 +1758,22 @@ int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,

return 0;
}

int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e)
{
struct snd_soc_card *card = widget->dapm->card;
int ret;

mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM);
ret = soc_dapm_mux_update_power(widget, kcontrol, mux, e);
mutex_unlock(&card->dapm_mutex);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power);

/* test and update the power status of a mixer or switch widget */
int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
static int soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int connect)
{
struct snd_soc_dapm_path *path;
Expand Down Expand Up @@ -1790,6 +1802,18 @@ int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,

return 0;
}

int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int connect)
{
struct snd_soc_card *card = widget->dapm->card;
int ret;

mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM);
ret = soc_dapm_mixer_update_power(widget, kcontrol, connect);
mutex_unlock(&card->dapm_mutex);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power);

/* show dapm widget status in sys fs */
Expand Down Expand Up @@ -2393,7 +2417,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
update.val = val;
widget->dapm->update = &update;

snd_soc_dapm_mixer_update_power(widget, kcontrol, connect);
soc_dapm_mixer_update_power(widget, kcontrol, connect);

widget->dapm->update = NULL;
}
Expand Down Expand Up @@ -2485,7 +2509,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
update.val = val;
widget->dapm->update = &update;

snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e);
soc_dapm_mux_update_power(widget, kcontrol, mux, e);

widget->dapm->update = NULL;
}
Expand Down Expand Up @@ -2547,7 +2571,7 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,

widget->value = ucontrol->value.enumerated.item[0];

snd_soc_dapm_mux_update_power(widget, kcontrol, widget->value, e);
soc_dapm_mux_update_power(widget, kcontrol, widget->value, e);
}
}

Expand Down Expand Up @@ -2651,7 +2675,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
update.val = val;
widget->dapm->update = &update;

snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e);
soc_dapm_mux_update_power(widget, kcontrol, mux, e);

widget->dapm->update = NULL;
}
Expand Down

0 comments on commit b47b120

Please sign in to comment.