All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Richard Zhao <linuxzsc@gmail.com>
Subject: [PATCH 4/8] ALSA: ASoC: add new param mux to dapm_mux_update_power
Date: Wed,  8 Oct 2008 10:37:56 +0100	[thread overview]
Message-ID: <1223458680-9506-4-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1223458680-9506-3-git-send-email-broonie@opensource.wolfsonmicro.com>

From: Richard Zhao <linuxzsc@gmail.com>

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>
---
 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 05ffba2..83fa9c4 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)
 /* 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 val, struct soc_enum* e)
+				 int mux, int val, struct soc_enum *e)
 {
 	struct snd_soc_dapm_path *path;
 	int found = 0;
@@ -709,12 +709,12 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
 		if (path->kcontrol != kcontrol)
 			continue;
 
-		if (!path->name || ! e->texts[val])
+		if (!path->name || !e->texts[mux])
 			continue;
 
 		found = 1;
 		/* 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 */
 		else
 			path->connect = 0; /* old connection must be powered down */
@@ -1291,7 +1291,7 @@ 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, e);
+	dapm_mux_update_power(widget, kcontrol, mask, mux, val, e);
 	if (widget->event) {
 		if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
 			ret = widget->event(widget,
-- 
1.5.6.5

  reply	other threads:[~2008-10-08  9:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08  9:36 [PATCH 0/8] ASoC updates Mark Brown
2008-10-08  9:37 ` [PATCH 1/8] ASoC: Add custom SOC_SINGLE_TLV for tlv320aic23 codec Mark Brown
2008-10-08  9:37   ` [PATCH 2/8] ASoC: Add WM8753 SPI support Mark Brown
2008-10-08  9:37     ` [PATCH 3/8] ASoC: Add WM8510 " Mark Brown
2008-10-08  9:37       ` Mark Brown [this message]
2008-10-08  9:37         ` [PATCH 5/8] ASoC: tlv320aic3x: Use uniform tlv320aic naming Mark Brown
2008-10-08  9:37           ` [PATCH 6/8] ASoC: Remove unused AUDIO_NAME define from codec drivers Mark Brown
2008-10-08  9:37             ` [PATCH 7/8] ASoC: Implement WM8510 bias level control Mark Brown
2008-10-08  9:38               ` [PATCH 8/8] ASoC: Make WM8510 microphone input a DAPM mixer Mark Brown
2008-10-08  9:49 ` [PATCH 0/8] ASoC updates Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1223458680-9506-4-git-send-email-broonie@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linuxzsc@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.