essvar.h revision 1.2 1 /*
2 * Copyright 1997
3 * Digital Equipment Corporation. All rights reserved.
4 *
5 * This software is furnished under license and may be used and
6 * copied only in accordance with the following terms and conditions.
7 * Subject to these conditions, you may download, copy, install,
8 * use, modify and distribute this software in source and/or binary
9 * form. No title or ownership is transferred hereby.
10 *
11 * 1) Any source code used, modified or distributed must reproduce
12 * and retain this copyright notice and list of conditions as
13 * they appear in the source file.
14 *
15 * 2) No right is granted to use any trade name, trademark, or logo of
16 * Digital Equipment Corporation. Neither the "Digital Equipment
17 * Corporation" name nor any trademark or logo of Digital Equipment
18 * Corporation may be used to endorse or promote products derived
19 * from this software without the prior written permission of
20 * Digital Equipment Corporation.
21 *
22 * 3) This software is provided "AS-IS" and any express or implied
23 * warranties, including but not limited to, any implied warranties
24 * of merchantability, fitness for a particular purpose, or
25 * non-infringement are disclaimed. In no event shall DIGITAL be
26 * liable for any damages whatsoever, and in particular, DIGITAL
27 * shall not be liable for special, indirect, consequential, or
28 * incidental damages or damages for lost profits, loss of
29 * revenue or loss of use, whether such damages arise in contract,
30 * negligence, tort, under statute, in equity, at law or otherwise,
31 * even if advised of the possibility of such damage.
32 */
33
34 /*
35 ** @(#) $RCSfile: essvar.h,v $ $Revision: 1.2 $ (SHARK) $Date: 1998/07/30 14:11:45 $
36 **
37 **++
38 **
39 ** essvar.h
40 **
41 ** FACILITY:
42 **
43 ** DIGITAL Network Appliance Reference Design (DNARD)
44 **
45 ** MODULE DESCRIPTION:
46 **
47 ** This module contains the structure definitions and function
48 ** prototypes for the ESS Technologies 1887/888 sound chip
49 ** driver.
50 **
51 ** AUTHORS:
52 **
53 ** Blair Fidler Software Engineering Australia
54 ** Gold Coast, Australia.
55 **
56 ** CREATION DATE:
57 **
58 ** May 12, 1997.
59 **
60 ** MODIFICATION HISTORY:
61 **
62 **--
63 */
64 #define ESS_DAC_PLAY_VOL 0
65 #define ESS_MIC_PLAY_VOL 1
66 #define ESS_LINE_PLAY_VOL 2
67 #define ESS_SYNTH_PLAY_VOL 3
68 #define ESS_CD_PLAY_VOL 4
69 #define ESS_AUXB_PLAY_VOL 5
70 #define ESS_INPUT_CLASS 6
71
72 #define ESS_MASTER_VOL 7
73 #define ESS_PCSPEAKER_VOL 8
74 #define ESS_OUTPUT_CLASS 9
75
76 #define ESS_DAC_REC_VOL 10
77 #define ESS_MIC_REC_VOL 11
78 #define ESS_LINE_REC_VOL 12
79 #define ESS_SYNTH_REC_VOL 13
80 #define ESS_CD_REC_VOL 14
81 #define ESS_AUXB_REC_VOL 15
82 #define ESS_MIC_PREAMP 16
83 #define ESS_RECORD_VOL 17
84 #define ESS_RECORD_SOURCE 18
85 #define ESS_RECORD_CLASS 19
86
87 #define ESS_RECORD_MONITOR 20
88 #define ESS_MONITOR_CLASS 21
89
90 #define ESS_NDEVS 22
91
92 struct ess_audio_channel
93 {
94 int drq; /* DMA channel */
95 int mode; /* DMA mode */
96 #define ESS_MODE_8BIT 0
97 #define ESS_MODE_16BIT 1
98 int irq; /* IRQ line for this DMA channel */
99 int ist;
100 void *ih; /* interrupt vectoring */
101 u_long nintr; /* number of interrupts taken */
102 void (*intr)__P((void*)); /* ISR for DMA complete */
103 void *arg; /* arg for intr() */
104
105 /* Status information */
106 int active; /* boolean: channel in use? */
107 int dmaflags; /* value last passed to isa_dmastart */
108 caddr_t dmaaddr; /* value last passed to isa_dmastart */
109 vm_size_t dmacnt; /* value last passed to isa_dmastart */
110
111 u_int channels; /* 1:mono, 2:stereo */
112 };
113
114 struct ess_softc
115 {
116 struct device sc_dev; /* base device */
117 struct isadev sc_id; /* ISA device */
118 isa_chipset_tag_t sc_ic;
119 bus_space_tag_t sc_iot; /* tag */
120 bus_space_handle_t sc_ioh; /* handle */
121 void *sc_ih; /* interrupt vectoring */
122
123 int sc_iobase; /* I/O port base address */
124
125 u_short sc_open; /* reference count of open calls */
126
127 u_char gain[ESS_NDEVS][2]; /* kept in input levels */
128 #define ESS_LEFT 0
129 #define ESS_RIGHT 1
130
131 u_int out_port; /* output port */
132 u_int in_mask; /* input ports */
133 u_int in_port; /* XXX needed for MI interface */
134
135 u_int spkr_state; /* non-null is on */
136
137 struct ess_audio_channel sc_in; /* audio channel for record */
138 struct ess_audio_channel sc_out;/* audio channel for playback */
139
140 u_int sc_model;
141 #define ESS_UNSUPPORTED 0
142 #define ESS_1888 1
143 #define ESS_1887 2
144 #define ESS_888 3
145
146 u_int sc_version; /* Legacy ES688/ES1688 ID */
147 };
148
149 int essmatch __P((struct ess_softc *));
150 void essattach __P((struct ess_softc *));
151
152