summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-06-17 21:06:14 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-06-17 21:06:14 +0000
commitaf6ffbfb320eca34e3f90188b63acc905b032258 (patch)
tree72bef5a905ef0a68be12c20db3209f2159597ab0 /sys/dev
parent2af31d3a1affd4966c6ee444f59f9c0c5164071e (diff)
Set the delta for the particular source so telling mixerctl to decrease the
volume (using --) adjusts it far enough to stick. from Eric Haszlakiewicz <erh@netbsd.org>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/ac97.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/ic/ac97.c b/sys/dev/ic/ac97.c
index 0773944d7c8..02975289bd0 100644
--- a/sys/dev/ic/ac97.c
+++ b/sys/dev/ic/ac97.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ac97.c,v 1.19 2001/05/16 23:34:53 mickey Exp $ */
+/* $OpenBSD: ac97.c,v 1.20 2001/06/17 21:06:13 mickey Exp $ */
/*
* Copyright (c) 1999, 2000 Constantine Sapuntzakis
@@ -100,6 +100,11 @@ const struct audio_mixer_enum ac97_source = {
{ { "phone" }, 7 }}
};
+/*
+ * Due to different values for each source that uses these structures,
+ * the ac97_query_devinfo function sets delta in mixer_devinfo_t using
+ * ac97_source_info.bits.
+ */
const struct audio_mixer_value ac97_volume_stereo = {
{ AudioNvolume },
2
@@ -725,6 +730,11 @@ ac97_query_devinfo(codec_if, dip)
strcpy(dip->label.name, name);
bcopy(si->info, &dip->un, si->info_size);
+
+ /* Set the delta for volume sources */
+ if (dip->type == AUDIO_MIXER_VALUE)
+ dip->un.v.delta = 1 << (8 - si->bits);
+
return (0);
}