esovar.h revision 1.1 1 /* $NetBSD: esovar.h,v 1.1 1999/07/12 15:13:31 kleink Exp $ */
2
3 /*
4 * Copyright (c) 1999 Klaus J. Klein
5 * 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,
23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31 #ifndef _DEV_PCI_ESOVAR_H_
32 #define _DEV_PCI_ESOVAR_H_
33
34 /*
35 * Definitions exported for the purpose of sharing with attached
36 * device drivers.
37 */
38
39 /*
40 * Mixer identifiers
41 */
42 /* Identifiers that have a gain value associated with them */
43 #define ESO_DAC_PLAY_VOL 0
44 #define ESO_MIC_PLAY_VOL 1
45 #define ESO_LINE_PLAY_VOL 2
46 #define ESO_SYNTH_PLAY_VOL 3
47 #define ESO_MONO_PLAY_VOL 4
48 #define ESO_CD_PLAY_VOL 5 /* AuxA */
49 #define ESO_AUXB_PLAY_VOL 6
50
51 #define ESO_MASTER_VOL 7
52 #define ESO_PCSPEAKER_VOL 8
53 #define ESO_SPATIALIZER 9
54
55 #define ESO_RECORD_VOL 10
56 #define ESO_DAC_REC_VOL 11
57 #define ESO_MIC_REC_VOL 12
58 #define ESO_LINE_REC_VOL 13
59 #define ESO_SYNTH_REC_VOL 14
60 #define ESO_MONO_REC_VOL 15
61 #define ESO_CD_REC_VOL 16
62 #define ESO_AUXB_REC_VOL 17
63 /* Used to keep software state */
64 #define ESO_NGAINDEVS (ESO_AUXB_REC_VOL + 1)
65
66 /* Other, non-gain related mixer identifiers */
67 #define ESO_RECORD_SOURCE 18
68 #define ESO_MONOOUT_SOURCE 19
69 #define ESO_RECORD_MONITOR 20
70 #define ESO_MIC_PREAMP 21
71 #define ESO_SPATIALIZER_ENABLE 22
72
73 /* Classes of the above */
74 #define ESO_INPUT_CLASS 23
75 #define ESO_OUTPUT_CLASS 24
76 #define ESO_MICROPHONE_CLASS 25
77 #define ESO_MONITOR_CLASS 26
78 #define ESO_RECORD_CLASS 27
79
80
81 /*
82 * Software state
83 */
84 struct eso_softc {
85 struct device sc_dev;
86 pci_intr_handle_t * sc_ih;
87 unsigned int sc_revision; /* PCI Revision ID */
88
89 /* Optionally deferred configuration of Audio 1 DMAC I/O space */
90 struct pci_attach_args sc_pa;
91 bus_size_t sc_vcsize; /* original size of mapping */
92
93 /* DMA */
94 bus_dma_tag_t sc_dmat;
95 struct eso_dma * sc_dmas;
96
97 /* I/O Base device */
98 bus_space_tag_t sc_iot;
99 bus_space_handle_t sc_ioh;
100
101 /* Audio/FM device */
102 bus_space_tag_t sc_sb_iot;
103 bus_space_handle_t sc_sb_ioh;
104
105 /* Audio 1 DMAC device */
106 unsigned int sc_dmac_configured;
107 bus_space_tag_t sc_dmac_iot;
108 bus_space_handle_t sc_dmac_ioh;
109
110 /* MPU-401 device */
111 struct mpu_softc sc_mpu;
112
113 /* Game device */
114 bus_space_tag_t sc_game_iot;
115 bus_space_handle_t sc_game_ioh;
116
117 /* MI audio interface: play/record interrupt callbacks and arguments */
118 void (*sc_pintr) __P((void *));
119 void * sc_parg;
120 void (*sc_rintr) __P((void *));
121 void * sc_rarg;
122
123 /* Audio 2 state */
124 uint8_t sc_a2c2; /* Audio 2 Control 2 */
125
126 /* Mixer state */
127 uint8_t sc_gain[ESO_NGAINDEVS][2];
128 #define ESO_LEFT 0
129 #define ESO_RIGHT 1
130 unsigned int sc_recsrc; /* record source selection */
131 unsigned int sc_monooutsrc; /* MONO_OUT source selection */
132 unsigned int sc_recmon; /* record monitor setting */
133 unsigned int sc_preamp; /* microphone preamp */
134 unsigned int sc_spatializer; /* spatializer enable */
135 };
136
137 #endif /* !_DEV_PCI_ESOVAR_H_ */
138