-/* $OpenBSD: ac97.c,v 1.3 1999/10/05 18:58:22 csapuntz Exp $ */
+/* $OpenBSD: ac97.c,v 1.4 2000/04/12 23:38:50 csapuntz Exp $ */
/*
* Copyright (c) 1999 Constantine Sapuntzakis
int error, i, j;
u_int16_t id1, id2, caps;
u_int32_t id;
-
+ mixer_ctrl_t ctl;
+
as = malloc(sizeof(struct ac97_softc), M_DEVBUF, M_WAITOK);
if (!as) return (ENOMEM);
ac97_setup_source_info(as);
+ /* Just enable the DAC and master volumes by default */
+ bzero(&ctl, sizeof(ctl));
+
+ ctl.type = AUDIO_MIXER_ENUM;
+ ctl.un.ord = 0; /* off */
+ ctl.dev = ac97_get_portnum_by_name(&as->codecIf, AudioCoutputs,
+ AudioNmaster, AudioNmute);
+ ac97_mixer_set_port(&as->codecIf, &ctl);
+ ctl.dev = ac97_get_portnum_by_name(&as->codecIf, AudioCinputs,
+ AudioNdac, AudioNmute);
+
+ ac97_mixer_set_port(&as->codecIf, &ctl);
+ ctl.dev = ac97_get_portnum_by_name(&as->codecIf, AudioCrecord,
+ AudioNvolume, AudioNmute);
+ ac97_mixer_set_port(&as->codecIf, &ctl);
+
+
+ ctl.dev = ac97_get_portnum_by_name(&as->codecIf, AudioCrecord,
+ AudioNsource, NULL);
+ ctl.type = AUDIO_MIXER_ENUM;
+ ctl.un.ord = 0;
+ ac97_mixer_set_port(&as->codecIf, &ctl);
+
return (0);
}