All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] snd-ac97-codec: fix ac97_enum mixer elements
@ 2005-04-24 11:21 Sergey Vlasov
  0 siblings, 0 replies; only message in thread
From: Sergey Vlasov @ 2005-04-24 11:21 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]

ac97_enum mixer elements (e.g., "Capture Source") did not work because
of wrong bitmask calculation in snd_ac97_get_enum_double() and
snd_ac97_put_enum_double().

https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1072

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>

--- alsa-driver/alsa-kernel/pci/ac97/ac97_codec.c.fix-enum	2005-04-09 16:57:02 +0400
+++ alsa-driver/alsa-kernel/pci/ac97/ac97_codec.c	2005-04-24 15:01:44 +0400
@@ -465,7 +465,7 @@ int snd_ac97_get_enum_double(snd_kcontro
 	struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
 	unsigned short val, bitmask;
 	
-	for (bitmask = 1; bitmask > e->mask; bitmask <<= 1)
+	for (bitmask = 1; bitmask < e->mask; bitmask <<= 1)
 		;
 	val = snd_ac97_read_cache(ac97, e->reg);
 	ucontrol->value.enumerated.item[0] = (val >> e->shift_l) & (bitmask - 1);
@@ -482,7 +482,7 @@ int snd_ac97_put_enum_double(snd_kcontro
 	unsigned short val;
 	unsigned short mask, bitmask;
 	
-	for (bitmask = 1; bitmask > e->mask; bitmask <<= 1)
+	for (bitmask = 1; bitmask < e->mask; bitmask <<= 1)
 		;
 	if (ucontrol->value.enumerated.item[0] > e->mask - 1)
 		return -EINVAL;

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-24 11:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-24 11:21 [PATCH] snd-ac97-codec: fix ac97_enum mixer elements Sergey Vlasov

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.