All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] aureon.c - adc mux, master vol
@ 2004-07-03 15:46 Christoph Haderer
  2004-07-05 10:00 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Haderer @ 2004-07-03 15:46 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

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

The attached patch fixes a problem in adc_mux_put (without these
changes, wrong values a written to the right input mux);
it also reverts the changes of dac_vol_get and dac_vol_put which where
introduced in revision 1.11, because in the current version changing the
Master Volume control affects only DAC1 volume (IMHO WM_DAC_MASTER_ATTEN
is the right location - not WM_DAC_ATTEN).

Regards,
Christoph Haderer


[-- Attachment #2: aureon.c-patch --]
[-- Type: text/plain, Size: 1520 bytes --]

--- aureon.c.old	2004-07-03 14:13:05.000000000 +0200
+++ aureon.c	2004-07-03 17:18:40.000000000 +0200
@@ -227,7 +227,10 @@
 	unsigned short vol;
 
 	down(&ice->gpio_mutex);
-	idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_DAC_ATTEN;
+	if (kcontrol->private_value)
+		idx = WM_DAC_MASTER_ATTEN;
+	else
+		idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_DAC_ATTEN;
 	vol = wm_get(ice, idx) & 0x7f;
 	if (vol <= 0x1a)
 		ucontrol->value.integer.value[0] = 0;
@@ -245,7 +248,10 @@
 	int change;
 
 	snd_ice1712_save_gpio_status(ice);
-	idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_DAC_ATTEN;
+	if (kcontrol->private_value)
+		idx = WM_DAC_MASTER_ATTEN;
+	else
+		idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_DAC_ATTEN;
 	nvol = ucontrol->value.integer.value[0] + 0x1a;
 	ovol = wm_get(ice, idx) & 0x7f;
 	change = (ovol != nvol);
@@ -374,8 +380,7 @@
 
 	down(&ice->gpio_mutex);
 	val = wm_get(ice, WM_ADC_MUX);
-	ucontrol->value.integer.value[0] = val & 7;
-	ucontrol->value.integer.value[1] = (val >> 4) & 7;
+	ucontrol->value.integer.value = val & 7;
 	up(&ice->gpio_mutex);
 	return 0;
 }
@@ -389,8 +394,8 @@
 	snd_ice1712_save_gpio_status(ice);
 	oval = wm_get(ice, WM_ADC_MUX);
 	nval = oval & ~0x77;
-	nval |= ucontrol->value.integer.value[0] & 7;
-	nval |= (ucontrol->value.integer.value[1] & 7) << 4;
+	nval |= ucontrol->value.integer.value & 7;
+	nval |= (ucontrol->value.integer.value & 7) << 4;
 	change = (oval != nval);
 	if (change)
 		wm_put(ice, WM_ADC_MUX, nval);

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

end of thread, other threads:[~2004-07-16  9:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-03 15:46 [PATCH] aureon.c - adc mux, master vol Christoph Haderer
2004-07-05 10:00 ` Takashi Iwai
2004-07-07  1:05   ` Apostolos Dimitromanolakis
2004-07-15 15:39     ` Takashi Iwai
2004-07-15 17:40       ` Apostolos Dimitromanolakis
2004-07-16  9:43         ` Takashi Iwai

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.