All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Haderer <chris_web@gmx.at>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@lists.sourceforge.net
Subject: [PATCH] aureon.c - adc mux, master vol
Date: Sat, 03 Jul 2004 17:46:24 +0200	[thread overview]
Message-ID: <40E6D4D0.6000206@gmx.at> (raw)

[-- 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);

             reply	other threads:[~2004-07-03 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-03 15:46 Christoph Haderer [this message]
2004-07-05 10:00 ` [PATCH] aureon.c - adc mux, master vol 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

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=40E6D4D0.6000206@gmx.at \
    --to=chris_web@gmx.at \
    --cc=alsa-devel@lists.sourceforge.net \
    --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.