From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>
Subject: [PATCH] ASoC: dapm: Fix dapm_set_path_status() connect
Date: Mon, 2 Jul 2012 13:45:21 +0200 (CEST) [thread overview]
Message-ID: <1035078102.502287.1341229521711.JavaMail.root@advansee.com> (raw)
In-Reply-To: <1535746789.386644.1341061383351.JavaMail.root@advansee.com>
dapm_set_path_status() sets connect incorrectly in the case max > 1 with invert.
In that case, the raw disconnect value should be max, which corresponds to the
userspace value 0.
This use case currently does not appear upstream, but it could break
SOC_DAPM_SINGLE() or SOC_DAPM_SINGLE_TLV() elsewhere or in the future.
This patch completes commit 3a9abe8.
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: <alsa-devel@alsa-project.org>
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
.../sound/soc/soc-dapm.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git linux-next-HEAD-d1d2d3a.orig/sound/soc/soc-dapm.c linux-next-HEAD-d1d2d3a/sound/soc/soc-dapm.c
index 9670668..7f2a4bb 100644
--- linux-next-HEAD-d1d2d3a.orig/sound/soc/soc-dapm.c
+++ linux-next-HEAD-d1d2d3a/sound/soc/soc-dapm.c
@@ -324,11 +324,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
val = soc_widget_read(w, reg);
val = (val >> shift) & mask;
+ if (invert)
+ val = max - val;
- if ((invert && !val) || (!invert && val))
- p->connect = 1;
- else
- p->connect = 0;
+ p->connect = !!val;
}
break;
case snd_soc_dapm_mux: {
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2012-07-02 11:40 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-18 20:41 [PATCH] ASoC: dapm: Fix snd_soc_dapm_put_volsw() connect Benoît Thébaudeau
2012-06-19 11:36 ` Mark Brown
2012-06-29 6:25 ` Takashi Iwai
2012-06-29 7:23 ` Mark Brown
2012-06-29 7:26 ` Takashi Iwai
2012-06-29 11:53 ` Benoît Thébaudeau
2012-06-29 12:03 ` Takashi Iwai
2012-06-29 14:29 ` Benoît Thébaudeau
2012-06-29 15:43 ` Takashi Iwai
2012-06-29 15:44 ` Takashi Iwai
2012-06-29 16:09 ` Benoît Thébaudeau
2012-06-29 16:22 ` Takashi Iwai
2012-06-29 19:09 ` Benoît Thébaudeau
2012-06-29 20:18 ` Benoît Thébaudeau
2012-06-30 11:39 ` Mark Brown
2012-06-30 13:03 ` Benoît Thébaudeau
2012-06-30 18:24 ` Mark Brown
2012-07-02 11:46 ` [RFC/PATCH] ASoC: dapm: Fix/add support for stereo widgets Benoît Thébaudeau
2012-07-02 12:27 ` Mark Brown
2012-07-03 6:57 ` [PATCH] ASoC: dapm: Fix snd_soc_dapm_put_volsw() connect Takashi Iwai
2012-06-30 11:38 ` Mark Brown
2012-06-29 16:05 ` Benoît Thébaudeau
2012-06-29 16:11 ` Takashi Iwai
2012-06-30 11:54 ` Mark Brown
2012-06-30 13:03 ` Benoît Thébaudeau
2012-07-02 11:45 ` Benoît Thébaudeau [this message]
2012-07-03 19:08 ` [PATCH] ASoC: dapm: Fix dapm_set_path_status() connect Mark Brown
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=1035078102.502287.1341229521711.JavaMail.root@advansee.com \
--to=benoit.thebaudeau@advansee.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@ti.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.