From 5ee7d68df3b0e4b2b33416491c551bc719de1a65 Mon Sep 17 00:00:00 2001
From: Deanna Phillips <deanna@cvs.openbsd.org>
Date: Mon, 23 Jul 2007 03:41:04 +0000
Subject: STAC7661:

- enable internal mic and select it as the default recording source,

- create mixerctl record.source for selecting between internal and
external mics,

- mute input by default.
---
 sys/dev/pci/azalia_codec.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'sys/dev/pci/azalia_codec.c')

diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c
index fe3240f89c5..dbcae5b1332 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.26 2007/07/23 03:25:11 deanna Exp $	*/
+/*	$OpenBSD: azalia_codec.c,v 1.27 2007/07/23 03:41:03 deanna Exp $	*/
 /*	$NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $	*/
 
 /*-
@@ -2583,6 +2583,10 @@ static const mixer_item_t stac7661_mixer_items[] = {
 	    ENUM_OFFON}, 0x09, MI_TARGET_INAMP(0)},
 	{{0, {AudioNvolume}, AUDIO_MIXER_VALUE, AZ_CLASS_RECORD, 0, 0,
 	    .un.v={{""}, 2, MIXER_DELTA(15)}}, 0x09, MI_TARGET_INAMP(0)},
+	{{0, {AudioNsource}, AUDIO_MIXER_ENUM, AZ_CLASS_RECORD,
+	  0, 0, .un.e={3, {{{AudioNmicrophone}, 1}, {{AudioNmicrophone"2"}, 2},
+			   {{AudioNdac}, 3}}}},
+	 0x15, MI_TARGET_CONNLIST},
 	{{0, {AudioNmaster}, AUDIO_MIXER_VALUE, AZ_CLASS_OUTPUT,
 	  0, 0, .un.v={{""}, 2, MIXER_DELTA(127)}}, 0x02, STAC7661_TARGET_MASTER},
 	{{0, {AudioNmaster"."AudioNmute}, AUDIO_MIXER_ENUM, AZ_CLASS_OUTPUT,
@@ -2621,9 +2625,11 @@ azalia_stac7661_mixer_init(codec_t *this)
 	mc.un.ord = 1;
 	azalia_generic_mixer_set(this, 0x0a, MI_TARGET_PINDIR, &mc); /* headphones */
 	azalia_generic_mixer_set(this, 0x0f, MI_TARGET_PINDIR, &mc); /* speaker */
+	azalia_generic_mixer_set(this, 0x09, MI_TARGET_INAMP(0), &mc); /* mute input */
 	mc.un.ord = 0;
 	azalia_generic_mixer_set(this, 0x0d, MI_TARGET_PINDIR, &mc); /* mic */
-	mc.un.ord = 1;          /* select mic for recording */
+	azalia_generic_mixer_set(this, 0x14, MI_TARGET_PINDIR, &mc); /* internal mic */
+	mc.un.ord = 2;          /* select internal mic for recording */
 	azalia_generic_mixer_set(this, 0x15, MI_TARGET_CONNLIST, &mc);
 	mc.type = AUDIO_MIXER_VALUE;
 	mc.un.value.num_channels = 1;
-- 
cgit v1.2.3