summaryrefslogtreecommitdiff
path: root/sys/dev/pci/azalia_codec.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-06-17 18:38:13 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-06-17 18:38:13 +0000
commit016f1a0ab32171b68e64f9180970978adfa21a52 (patch)
treeb295c642f02ca3ce9205653305ebb966161c052d /sys/dev/pci/azalia_codec.c
parent195f03e89363f02728df665b8e92c6503762e882 (diff)
Fix a bug that AUDIO_MIXER_READ returns an incorrect
mixer_ctrl_t::un.value.num_channels in the case of the combination of a mono pin and a stereo mixer. From kent NetBSD
Diffstat (limited to 'sys/dev/pci/azalia_codec.c')
-rw-r--r--sys/dev/pci/azalia_codec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c
index a0a25e53d78..1e449c47915 100644
--- a/sys/dev/pci/azalia_codec.c
+++ b/sys/dev/pci/azalia_codec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia_codec.c,v 1.13 2006/06/16 08:03:42 brad Exp $ */
+/* $OpenBSD: azalia_codec.c,v 1.14 2006/06/17 18:38:12 brad Exp $ */
/* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */
/*-
@@ -854,6 +854,7 @@ int
azalia_generic_mixer_get(const codec_t *this, nid_t nid, int target, mixer_ctrl_t *mc)
{
uint32_t result;
+ nid_t n;
int err;
/* inamp mute */
@@ -875,7 +876,8 @@ azalia_generic_mixer_get(const codec_t *this, nid_t nid, int target, mixer_ctrl_
return err;
mc->un.value.level[0] = azalia_generic_mixer_from_device_value(this,
nid, target, CORB_GAGM_GAIN(result));
- mc->un.value.num_channels = WIDGET_CHANNELS(&this->w[nid]);
+ n = this->w[nid].connections[MI_TARGET_INAMP(target)];
+ mc->un.value.num_channels = WIDGET_CHANNELS(&this->w[n]);
if (mc->un.value.num_channels == 2) {
err = this->comresp(this, nid,
CORB_GET_AMPLIFIER_GAIN_MUTE, CORB_GAGM_INPUT |