1 /* $OpenBSD: ymvar.h,v 1.5 2002/03/14 01:26:57 millert Exp $ */ 2 /* $NetBSD: wssvar.h,v 1.1 1998/01/19 22:18:25 augustss Exp $ */ 3 4 /* 5 * Copyright (c) 1998 Constantine Sapuntzakis. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. The name of the author may not be used to endorse or promote products 16 * derived from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30 /* 31 * Mixer devices 32 */ 33 #define YM_MIDI_LVL 0 34 #define YM_CD_LVL 1 35 #define YM_DAC_LVL 2 36 #define YM_LINE_LVL 3 37 #define YM_SPEAKER_LVL 4 38 #define YM_MIC_LVL 5 39 #define YM_MONITOR_LVL 6 40 #define YM_MIDI_MUTE 7 41 #define YM_CD_MUTE 8 42 #define YM_DAC_MUTE 9 43 #define YM_LINE_MUTE 10 44 #define YM_SPEAKER_MUTE 11 45 #define YM_MIC_MUTE 12 46 #define YM_MONITOR_MUTE 13 47 48 #define YM_REC_LVL 14 49 #define YM_RECORD_SOURCE 15 50 51 #define YM_OUTPUT_LVL 16 52 #define YM_OUTPUT_MUTE 17 53 54 #define YM_MASTER_EQMODE 18 55 #define YM_MASTER_TREBLE 19 56 #define YM_MASTER_BASS 20 57 #define YM_MASTER_WIDE 21 58 59 /* Classes - don't change this without looking at mixer_classes array */ 60 #define YM_CLASS_TOP 22 61 #define YM_INPUT_CLASS (YM_CLASS_TOP + 0) 62 #define YM_RECORD_CLASS (YM_CLASS_TOP + 1) 63 #define YM_OUTPUT_CLASS (YM_CLASS_TOP + 2) 64 #define YM_MONITOR_CLASS (YM_CLASS_TOP + 3) 65 #define YM_EQ_CLASS (YM_CLASS_TOP + 4) 66 67 #define AudioNmode "mode" 68 #define AudioNdesktop "desktop" 69 #define AudioNlaptop "laptop" 70 #define AudioNsubnote "subnote" 71 #define AudioNhifi "hifi" 72 73 struct ym_softc { 74 struct device sc_dev; /* base device */ 75 struct isadev sc_id; /* ISA device */ 76 void *sc_ih; /* interrupt vectoring */ 77 bus_space_tag_t sc_iot; /* tag */ 78 bus_space_handle_t sc_ioh; /* handle */ 79 isa_chipset_tag_t sc_ic; 80 81 bus_space_handle_t sc_controlioh; 82 83 struct ad1848_softc sc_ad1848; 84 #define ym_irq sc_ad1848.sc_irq 85 #define ym_drq sc_ad1848.sc_drq 86 #define ym_recdrq sc_ad1848.sc_recdrq 87 88 int master_mute, mic_mute; 89 struct ad1848_volume master_gain; 90 u_int8_t mic_gain; 91 92 /* 3D enhancement */ 93 u_int8_t sc_eqmode; 94 struct ad1848_volume sc_treble, sc_bass, sc_wide; 95 #if NMIDI > 0 96 int sc_hasmpu; 97 struct mpu_softc sc_mpu_sc; /* MPU401 Uart state */ 98 #endif 99 }; 100 101 void ym_attach(struct ym_softc *);