All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: dapm: Fix snd_soc_dapm_put_volsw() connect
@ 2012-06-18 20:41 Benoît Thébaudeau
  2012-06-19 11:36 ` Mark Brown
  2012-06-29  6:25 ` Takashi Iwai
  0 siblings, 2 replies; 27+ messages in thread
From: Benoît Thébaudeau @ 2012-06-18 20:41 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, alsa-devel

snd_soc_dapm_put_volsw() 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.

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                           |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git linux-next-HEAD-6c86b58.orig/sound/soc/soc-dapm.c linux-next-HEAD-6c86b58/sound/soc/soc-dapm.c
index 405841c..5ef082f 100644
--- linux-next-HEAD-6c86b58.orig/sound/soc/soc-dapm.c
+++ linux-next-HEAD-6c86b58/sound/soc/soc-dapm.c
@@ -2515,19 +2515,13 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
 	int wi;
 
 	val = (ucontrol->value.integer.value[0] & mask);
+	connect = !!val;
 
 	if (invert)
 		val = max - val;
 	mask = mask << shift;
 	val = val << shift;
 
-	if (val)
-		/* new connection */
-		connect = invert ? 0 : 1;
-	else
-		/* old connection must be powered down */
-		connect = invert ? 1 : 0;
-
 	mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
 
 	change = snd_soc_test_bits(widget->codec, reg, mask, val);
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2012-07-03 19:08 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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                 ` [PATCH] ASoC: dapm: Fix dapm_set_path_status() connect Benoît Thébaudeau
2012-07-03 19:08                   ` Mark Brown

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.