summaryrefslogtreecommitdiff
path: root/sys/arch/macppc
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2008-11-05 21:38:04 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2008-11-05 21:38:04 +0000
commitc28c51194de3bf93149e4e1f2918ac1e6d008a7c (patch)
treee103ad7059d70d9bcaddf2354217509bc21a5601 /sys/arch/macppc
parentf09c88f1166e7178640071eeaaaa5f8446b8af7c (diff)
return an error when trying to get stereo values from a mono
control. makes mixerctl(1) output more sensible. ok drahn, todd
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r--sys/arch/macppc/dev/i2s.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c
index e7ccfe87aeb..949426e658e 100644
--- a/sys/arch/macppc/dev/i2s.c
+++ b/sys/arch/macppc/dev/i2s.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2s.c,v 1.15 2008/10/30 06:12:47 todd Exp $ */
+/* $OpenBSD: i2s.c,v 1.16 2008/11/05 21:38:03 jakemsr Exp $ */
/* $NetBSD: i2s.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
@@ -605,12 +605,16 @@ i2s_get_port(h, mc)
return 0;
case I2S_BASS:
+ if (mc->un.value.num_channels != 1)
+ return ENXIO;
mc->un.value.level[AUDIO_MIXER_LEVEL_MONO] = sc->sc_bass;
- return (0);
+ return 0;
case I2S_TREBLE:
+ if (mc->un.value.num_channels != 1)
+ return ENXIO;
mc->un.value.level[AUDIO_MIXER_LEVEL_MONO] = sc->sc_treble;
- return (0);
+ return 0;
case I2S_VOL_INPUT:
/* XXX TO BE DONE */