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