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