essvar.h revision 1.26.24.1 1 1.26.24.1 riz /* $NetBSD: essvar.h,v 1.26.24.1 2014/08/23 03:46:55 riz Exp $ */
2 1.1 augustss /*
3 1.1 augustss * Copyright 1997
4 1.1 augustss * Digital Equipment Corporation. All rights reserved.
5 1.1 augustss *
6 1.1 augustss * This software is furnished under license and may be used and
7 1.1 augustss * copied only in accordance with the following terms and conditions.
8 1.1 augustss * Subject to these conditions, you may download, copy, install,
9 1.1 augustss * use, modify and distribute this software in source and/or binary
10 1.1 augustss * form. No title or ownership is transferred hereby.
11 1.1 augustss *
12 1.1 augustss * 1) Any source code used, modified or distributed must reproduce
13 1.1 augustss * and retain this copyright notice and list of conditions as
14 1.1 augustss * they appear in the source file.
15 1.1 augustss *
16 1.1 augustss * 2) No right is granted to use any trade name, trademark, or logo of
17 1.1 augustss * Digital Equipment Corporation. Neither the "Digital Equipment
18 1.1 augustss * Corporation" name nor any trademark or logo of Digital Equipment
19 1.1 augustss * Corporation may be used to endorse or promote products derived
20 1.1 augustss * from this software without the prior written permission of
21 1.1 augustss * Digital Equipment Corporation.
22 1.1 augustss *
23 1.1 augustss * 3) This software is provided "AS-IS" and any express or implied
24 1.1 augustss * warranties, including but not limited to, any implied warranties
25 1.1 augustss * of merchantability, fitness for a particular purpose, or
26 1.1 augustss * non-infringement are disclaimed. In no event shall DIGITAL be
27 1.1 augustss * liable for any damages whatsoever, and in particular, DIGITAL
28 1.1 augustss * shall not be liable for special, indirect, consequential, or
29 1.1 augustss * incidental damages or damages for lost profits, loss of
30 1.1 augustss * revenue or loss of use, whether such damages arise in contract,
31 1.1 augustss * negligence, tort, under statute, in equity, at law or otherwise,
32 1.1 augustss * even if advised of the possibility of such damage.
33 1.1 augustss */
34 1.1 augustss
35 1.1 augustss /*
36 1.26.24.1 riz ** @(#) $RCSfile: essvar.h,v $ $Revision: 1.26.24.1 $ (SHARK) $Date: 2014/08/23 03:46:55 $
37 1.1 augustss **
38 1.1 augustss **++
39 1.1 augustss **
40 1.1 augustss ** essvar.h
41 1.1 augustss **
42 1.1 augustss ** FACILITY:
43 1.1 augustss **
44 1.1 augustss ** DIGITAL Network Appliance Reference Design (DNARD)
45 1.1 augustss **
46 1.1 augustss ** MODULE DESCRIPTION:
47 1.1 augustss **
48 1.1 augustss ** This module contains the structure definitions and function
49 1.1 augustss ** prototypes for the ESS Technologies 1887/888 sound chip
50 1.1 augustss ** driver.
51 1.1 augustss **
52 1.1 augustss ** AUTHORS:
53 1.1 augustss **
54 1.1 augustss ** Blair Fidler Software Engineering Australia
55 1.1 augustss ** Gold Coast, Australia.
56 1.1 augustss **
57 1.23 perry ** CREATION DATE:
58 1.1 augustss **
59 1.1 augustss ** May 12, 1997.
60 1.1 augustss **
61 1.1 augustss ** MODIFICATION HISTORY:
62 1.1 augustss **
63 1.1 augustss **--
64 1.1 augustss */
65 1.17 thorpej
66 1.17 thorpej #include <sys/callout.h>
67 1.17 thorpej
68 1.1 augustss #define ESS_DAC_PLAY_VOL 0
69 1.1 augustss #define ESS_MIC_PLAY_VOL 1
70 1.1 augustss #define ESS_LINE_PLAY_VOL 2
71 1.1 augustss #define ESS_SYNTH_PLAY_VOL 3
72 1.1 augustss #define ESS_CD_PLAY_VOL 4
73 1.1 augustss #define ESS_AUXB_PLAY_VOL 5
74 1.1 augustss #define ESS_INPUT_CLASS 6
75 1.1 augustss
76 1.1 augustss #define ESS_MASTER_VOL 7
77 1.1 augustss #define ESS_PCSPEAKER_VOL 8
78 1.1 augustss #define ESS_OUTPUT_CLASS 9
79 1.1 augustss
80 1.12 nathanw #define ESS_RECORD_MONITOR 10
81 1.12 nathanw #define ESS_MONITOR_CLASS 11
82 1.1 augustss
83 1.12 nathanw #define ESS_RECORD_VOL 12
84 1.12 nathanw #define ESS_RECORD_SOURCE 13
85 1.12 nathanw #define ESS_RECORD_CLASS 14
86 1.12 nathanw
87 1.12 nathanw #define ESS_1788_NDEVS 15
88 1.12 nathanw
89 1.26.24.1 riz #define ESS_SPATIALIZER 15
90 1.26.24.1 riz #define ESS_SPATIALIZER_ENABLE 16
91 1.26.24.1 riz
92 1.26.24.1 riz #define ESS_18X9_NDEVS 17
93 1.26.24.1 riz
94 1.12 nathanw #define ESS_DAC_REC_VOL 15
95 1.12 nathanw #define ESS_MIC_REC_VOL 16
96 1.12 nathanw #define ESS_LINE_REC_VOL 17
97 1.12 nathanw #define ESS_SYNTH_REC_VOL 18
98 1.12 nathanw #define ESS_CD_REC_VOL 19
99 1.12 nathanw #define ESS_AUXB_REC_VOL 20
100 1.12 nathanw #define ESS_MIC_PREAMP 21
101 1.1 augustss
102 1.12 nathanw #define ESS_1888_NDEVS 22
103 1.12 nathanw #define ESS_MAX_NDEVS 22
104 1.1 augustss
105 1.1 augustss struct ess_audio_channel
106 1.1 augustss {
107 1.1 augustss int drq; /* DMA channel */
108 1.16 thorpej bus_size_t maxsize; /* max size for DMA channel */
109 1.4 augustss #define IS16BITDRQ(drq) ((drq) >= 4)
110 1.1 augustss int irq; /* IRQ line for this DMA channel */
111 1.2 augustss int ist;
112 1.1 augustss void *ih; /* interrupt vectoring */
113 1.1 augustss u_long nintr; /* number of interrupts taken */
114 1.22 kent void (*intr)(void*); /* ISR for DMA complete */
115 1.1 augustss void *arg; /* arg for intr() */
116 1.1 augustss
117 1.1 augustss /* Status information */
118 1.1 augustss int active; /* boolean: channel in use? */
119 1.14 mycroft
120 1.14 mycroft /* Polling state */
121 1.14 mycroft int polled; /* 1 if channel is polled */
122 1.14 mycroft int dmapos; /* last DMA pointer */
123 1.14 mycroft int buffersize; /* size of DMA buffer */
124 1.14 mycroft /* (The following is only needed due to the stupid block interface.) */
125 1.14 mycroft int dmacount; /* leftover partial block */
126 1.14 mycroft int blksize; /* current block size */
127 1.1 augustss };
128 1.1 augustss
129 1.1 augustss struct ess_softc
130 1.1 augustss {
131 1.25 tsutsui device_t sc_dev; /* base device */
132 1.1 augustss isa_chipset_tag_t sc_ic;
133 1.1 augustss bus_space_tag_t sc_iot; /* tag */
134 1.1 augustss bus_space_handle_t sc_ioh; /* handle */
135 1.26 jmcneill kmutex_t sc_lock;
136 1.26 jmcneill kmutex_t sc_intr_lock;
137 1.17 thorpej
138 1.26 jmcneill callout_t sc_poll1_ch; /* audio1 poll */
139 1.26 jmcneill callout_t sc_poll2_ch; /* audio2 poll */
140 1.1 augustss
141 1.1 augustss int sc_iobase; /* I/O port base address */
142 1.1 augustss
143 1.1 augustss u_short sc_open; /* reference count of open calls */
144 1.1 augustss
145 1.22 kent int ndevs;
146 1.12 nathanw u_char gain[ESS_MAX_NDEVS][2]; /* kept in input levels */
147 1.1 augustss #define ESS_LEFT 0
148 1.1 augustss #define ESS_RIGHT 1
149 1.22 kent
150 1.1 augustss u_int out_port; /* output port */
151 1.1 augustss u_int in_mask; /* input ports */
152 1.1 augustss u_int in_port; /* XXX needed for MI interface */
153 1.1 augustss
154 1.1 augustss u_int spkr_state; /* non-null is on */
155 1.22 kent
156 1.13 mycroft struct ess_audio_channel sc_audio1; /* audio channel for record */
157 1.13 mycroft struct ess_audio_channel sc_audio2; /* audio channel for playback */
158 1.1 augustss
159 1.1 augustss u_int sc_model;
160 1.1 augustss #define ESS_UNSUPPORTED 0
161 1.21 mycroft #define ESS_688 1
162 1.21 mycroft #define ESS_1688 2
163 1.21 mycroft #define ESS_1788 3
164 1.21 mycroft #define ESS_1868 4
165 1.21 mycroft #define ESS_1869 5
166 1.21 mycroft #define ESS_1878 6
167 1.21 mycroft #define ESS_1879 7
168 1.21 mycroft #define ESS_888 8
169 1.21 mycroft #define ESS_1887 9
170 1.21 mycroft #define ESS_1888 10
171 1.1 augustss
172 1.1 augustss u_int sc_version; /* Legacy ES688/ES1688 ID */
173 1.19 drochner
174 1.26.24.1 riz u_int sc_spatializer; /* spatializer enable */
175 1.26.24.1 riz
176 1.19 drochner /* game port on es1888 */
177 1.19 drochner bus_space_tag_t sc_joy_iot;
178 1.19 drochner bus_space_handle_t sc_joy_ioh;
179 1.1 augustss };
180 1.1 augustss
181 1.22 kent int essmatch(struct ess_softc *);
182 1.22 kent void essattach(struct ess_softc *, int);
183 1.22 kent int ess_config_addr(struct ess_softc *);
184 1.1 augustss
185