提交 cb01e2b9 编写于 作者: R Richard Zhao 提交者: Jaroslav Kysela

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: NRichard Zhao <linuxzsc@gmail.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NJaroslav Kysela <perex@perex.cz>
上级 ff33f230
...@@ -693,7 +693,7 @@ static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action) ...@@ -693,7 +693,7 @@ static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action)
/* test and update the power status of a mux widget */ /* test and update the power status of a mux widget */
static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int mask, struct snd_kcontrol *kcontrol, int mask,
int val, struct soc_enum* e) int mux, int val, struct soc_enum *e)
{ {
struct snd_soc_dapm_path *path; struct snd_soc_dapm_path *path;
int found = 0; int found = 0;
...@@ -709,12 +709,12 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, ...@@ -709,12 +709,12 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
if (path->kcontrol != kcontrol) if (path->kcontrol != kcontrol)
continue; continue;
if (!path->name || ! e->texts[val]) if (!path->name || !e->texts[mux])
continue; continue;
found = 1; found = 1;
/* we now need to match the string in the enum to the path */ /* we now need to match the string in the enum to the path */
if (!(strcmp(path->name, e->texts[val]))) if (!(strcmp(path->name, e->texts[mux])))
path->connect = 1; /* new connection */ path->connect = 1; /* new connection */
else else
path->connect = 0; /* old connection must be powered down */ 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,7 +1291,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
mutex_lock(&widget->codec->mutex); mutex_lock(&widget->codec->mutex);
widget->value = val; widget->value = val;
dapm_mux_update_power(widget, kcontrol, mask, mux, e); dapm_mux_update_power(widget, kcontrol, mask, mux, val, e);
if (widget->event) { if (widget->event) {
if (widget->event_flags & SND_SOC_DAPM_PRE_REG) { if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
ret = widget->event(widget, ret = widget->event(widget,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册