diff options
author | Richard Zhao <linuxzsc@gmail.com> | 2008-10-06 20:05:20 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-10-10 07:41:54 -0400 |
commit | cb01e2b99264d579085c63966744d91b87c6b35d (patch) | |
tree | ff93cff44a66a3deb30c69900206b5eda7a7b485 /sound/soc/soc-dapm.c | |
parent | ff33f2303b0ea8e5ac15af91de8d8538a5d58db1 (diff) |
ALSA: ASoC: add new param mux to dapm_mux_update_power
Function dapm_mux_update_power needs enum index mux and register mask value val
as parameters, but it only has a parameter val, and uses it as both val and mux.
snd_soc_test_bits(widget->codec, e->reg, mask, val) val is register mask here,
e->texts[val] but val should be enum index mux here.
This patch adds a new param mux to fix it.
Signed-off-by: Richard Zhao <linuxzsc@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index c016426fb896..9ca9c08610fa 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -693,7 +693,7 @@ static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action) | |||
693 | /* test and update the power status of a mux widget */ | 693 | /* test and update the power status of a mux widget */ |
694 | static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | 694 | static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, |
695 | struct snd_kcontrol *kcontrol, int mask, | 695 | struct snd_kcontrol *kcontrol, int mask, |
696 | int val, struct soc_enum* e) | 696 | int mux, int val, struct soc_enum *e) |
697 | { | 697 | { |
698 | struct snd_soc_dapm_path *path; | 698 | struct snd_soc_dapm_path *path; |
699 | int found = 0; | 699 | int found = 0; |
@@ -709,12 +709,12 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | |||
709 | if (path->kcontrol != kcontrol) | 709 | if (path->kcontrol != kcontrol) |
710 | continue; | 710 | continue; |
711 | 711 | ||
712 | if (!path->name || ! e->texts[val]) | 712 | if (!path->name || !e->texts[mux]) |
713 | continue; | 713 | continue; |
714 | 714 | ||
715 | found = 1; | 715 | found = 1; |
716 | /* we now need to match the string in the enum to the path */ | 716 | /* we now need to match the string in the enum to the path */ |
717 | if (!(strcmp(path->name, e->texts[val]))) | 717 | if (!(strcmp(path->name, e->texts[mux]))) |
718 | path->connect = 1; /* new connection */ | 718 | path->connect = 1; /* new connection */ |
719 | else | 719 | else |
720 | path->connect = 0; /* old connection must be powered down */ | 720 | path->connect = 0; /* old connection must be powered down */ |
@@ -1291,7 +1291,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, | |||
1291 | 1291 | ||
1292 | mutex_lock(&widget->codec->mutex); | 1292 | mutex_lock(&widget->codec->mutex); |
1293 | widget->value = val; | 1293 | widget->value = val; |
1294 | dapm_mux_update_power(widget, kcontrol, mask, mux, e); | 1294 | dapm_mux_update_power(widget, kcontrol, mask, mux, val, e); |
1295 | if (widget->event) { | 1295 | if (widget->event) { |
1296 | if (widget->event_flags & SND_SOC_DAPM_PRE_REG) { | 1296 | if (widget->event_flags & SND_SOC_DAPM_PRE_REG) { |
1297 | ret = widget->event(widget, | 1297 | ret = widget->event(widget, |