essvar.h revision 1.22.4.1 1 1.22.4.1 yamt /* $NetBSD: essvar.h,v 1.22.4.1 2005/03/19 08:34:33 yamt 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.22.4.1 yamt ** @(#) $RCSfile: essvar.h,v $ $Revision: 1.22.4.1 $ (SHARK) $Date: 2005/03/19 08:34:33 $
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.22.4.1 yamt ** 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.12 nathanw #define ESS_DAC_REC_VOL 15
90 1.12 nathanw #define ESS_MIC_REC_VOL 16
91 1.12 nathanw #define ESS_LINE_REC_VOL 17
92 1.12 nathanw #define ESS_SYNTH_REC_VOL 18
93 1.12 nathanw #define ESS_CD_REC_VOL 19
94 1.12 nathanw #define ESS_AUXB_REC_VOL 20
95 1.12 nathanw #define ESS_MIC_PREAMP 21
96 1.1 augustss
97 1.12 nathanw #define ESS_1888_NDEVS 22
98 1.12 nathanw #define ESS_MAX_NDEVS 22
99 1.1 augustss
100 1.1 augustss struct ess_audio_channel
101 1.1 augustss {
102 1.1 augustss int drq; /* DMA channel */
103 1.16 thorpej bus_size_t maxsize; /* max size for DMA channel */
104 1.4 augustss #define IS16BITDRQ(drq) ((drq) >= 4)
105 1.1 augustss int irq; /* IRQ line for this DMA channel */
106 1.2 augustss int ist;
107 1.1 augustss void *ih; /* interrupt vectoring */
108 1.1 augustss u_long nintr; /* number of interrupts taken */
109 1.22 kent void (*intr)(void*); /* ISR for DMA complete */
110 1.1 augustss void *arg; /* arg for intr() */
111 1.1 augustss
112 1.1 augustss /* Status information */
113 1.1 augustss int active; /* boolean: channel in use? */
114 1.14 mycroft
115 1.14 mycroft /* Polling state */
116 1.14 mycroft int polled; /* 1 if channel is polled */
117 1.14 mycroft int dmapos; /* last DMA pointer */
118 1.14 mycroft int buffersize; /* size of DMA buffer */
119 1.14 mycroft /* (The following is only needed due to the stupid block interface.) */
120 1.14 mycroft int dmacount; /* leftover partial block */
121 1.14 mycroft int blksize; /* current block size */
122 1.1 augustss };
123 1.1 augustss
124 1.1 augustss struct ess_softc
125 1.1 augustss {
126 1.1 augustss struct device sc_dev; /* base device */
127 1.1 augustss isa_chipset_tag_t sc_ic;
128 1.1 augustss bus_space_tag_t sc_iot; /* tag */
129 1.1 augustss bus_space_handle_t sc_ioh; /* handle */
130 1.17 thorpej
131 1.17 thorpej struct callout sc_poll1_ch; /* audio1 poll */
132 1.17 thorpej struct callout sc_poll2_ch; /* audio2 poll */
133 1.1 augustss
134 1.1 augustss int sc_iobase; /* I/O port base address */
135 1.1 augustss
136 1.1 augustss u_short sc_open; /* reference count of open calls */
137 1.1 augustss
138 1.22 kent int ndevs;
139 1.12 nathanw u_char gain[ESS_MAX_NDEVS][2]; /* kept in input levels */
140 1.1 augustss #define ESS_LEFT 0
141 1.1 augustss #define ESS_RIGHT 1
142 1.22 kent
143 1.1 augustss u_int out_port; /* output port */
144 1.1 augustss u_int in_mask; /* input ports */
145 1.1 augustss u_int in_port; /* XXX needed for MI interface */
146 1.1 augustss
147 1.1 augustss u_int spkr_state; /* non-null is on */
148 1.22 kent
149 1.13 mycroft struct ess_audio_channel sc_audio1; /* audio channel for record */
150 1.13 mycroft struct ess_audio_channel sc_audio2; /* audio channel for playback */
151 1.1 augustss
152 1.1 augustss u_int sc_model;
153 1.1 augustss #define ESS_UNSUPPORTED 0
154 1.21 mycroft #define ESS_688 1
155 1.21 mycroft #define ESS_1688 2
156 1.21 mycroft #define ESS_1788 3
157 1.21 mycroft #define ESS_1868 4
158 1.21 mycroft #define ESS_1869 5
159 1.21 mycroft #define ESS_1878 6
160 1.21 mycroft #define ESS_1879 7
161 1.21 mycroft #define ESS_888 8
162 1.21 mycroft #define ESS_1887 9
163 1.21 mycroft #define ESS_1888 10
164 1.1 augustss
165 1.1 augustss u_int sc_version; /* Legacy ES688/ES1688 ID */
166 1.19 drochner
167 1.19 drochner /* game port on es1888 */
168 1.19 drochner bus_space_tag_t sc_joy_iot;
169 1.19 drochner bus_space_handle_t sc_joy_ioh;
170 1.1 augustss };
171 1.1 augustss
172 1.22 kent int essmatch(struct ess_softc *);
173 1.22 kent void essattach(struct ess_softc *, int);
174 1.22 kent int ess_config_addr(struct ess_softc *);
175 1.1 augustss
176