1 /*
2 * Mach Operating System
3 * Copyright (c) 1993 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * Copyright (c) 1991, 1992 The Regents of the University of California.
28 * All rights reserved.
29 *
30 * Redistribution and use in source and binary forms, with or without
31 * modification, are permitted provided that the following conditions
32 * are met:
33 * 1. Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * 2. Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in the
37 * documentation and/or other materials provided with the distribution.
38 * 3. All advertising materials mentioning features or use of this software
39 * must display the following acknowledgement:
40 * This product includes software developed by the Computer Systems
41 * Engineering Group at Lawrence Berkeley Laboratory.
42 * 4. The name of the Laboratory may not be used to endorse or promote
43 * products derived from this software without specific prior written
44 * permission.
45 *
46 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
47 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
50 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
51 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
52 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
53 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
54 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
55 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 * SUCH DAMAGE.
57 *
58 * $Header: audio_status.h,v 2.2 93/03/18 10:37:14 mrt Exp $ (LBL)
59 */
60 /*
61 * HISTORY
62 * $Log: audio_status.h,v $
63 * Revision 2.2 93/03/18 10:37:14 mrt
64 * Created from Berkeley driver.
65 * [93/03/12 af]
66 *
67 */
68
69 #ifndef _DEVICE_AUDIO_STATUS_H_
70 #define _DEVICE_AUDIO_STATUS_H_
71
72 /*
73 * Access to ADC devices, such as the AMD 79C30A/32A.
74 */
75
76 /*
77 * Programmable gains, see tables in device drivers
78 * for detailed mapping to device specifics.
79 */
80 #define AUDIO_MIN_GAIN (0)
81 #define AUDIO_MAX_GAIN (255)
82
83 /*
84 * Encoding of audio samples
85 */
86 #define AUDIO_ENCODING_ULAW (1)
87 #define AUDIO_ENCODING_ALAW (2)
88
89 /*
90 * Selection of input/output jack
91 */
92 #define AUDIO_MIKE 1
93
94 #define AUDIO_SPEAKER 1
95 #define AUDIO_HEADPHONE 2
96
97 /*
98 * Programming information from/to user application.
99 * Only portions of this might be available on any given chip.
100 */
101 struct audio_prinfo {
102 unsigned int sample_rate;
103 unsigned int channels;
104 unsigned int precision;
105 unsigned int encoding;
106 unsigned int gain;
107 unsigned int port; /* input/output jack */
108 unsigned int seek; /* BSD extension */
109 unsigned int ispare[3];
110 unsigned int samples;
111 unsigned int eof;
112
113 unsigned char pause;
114 unsigned char error;
115 unsigned char waiting;
116 unsigned char cspare[3];
117 unsigned char open;
118 unsigned char active;
119
120 };
121
122 struct audio_info {
123 struct audio_prinfo play;
124 struct audio_prinfo record;
125 unsigned int monitor_gain;
126 /* BSD extensions */
127 unsigned int blocksize; /* input blocking threshold */
128 unsigned int hiwat; /* output high water mark */
129 unsigned int lowat; /* output low water mark */
130 unsigned int backlog; /* samples of output backlog to gen. */
131 };
132
133 typedef struct audio_info audio_info_t;
134
135 #define AUDIO_INITINFO(p)\
136 (void)memset((void *)(p), 0xff, sizeof(struct audio_info))
137
138 #define AUDIO_GETINFO _IOR('A', 21, audio_info_t)
139 #define AUDIO_SETINFO _IOWR('A', 22, audio_info_t)
140 #define AUDIO_DRAIN _IO('A', 23)
141 #define AUDIO_FLUSH _IO('A', 24)
142 #define AUDIO_WSEEK _IOR('A', 25, unsigned int)
143 #define AUDIO_RERROR _IOR('A', 26, int)
144 #define AUDIO_WERROR _IOR('A', 27, int)
145
146 /*
147 * Low level interface to the amd79c30.
148 * Internal registers of the MAP block,
149 * the Main Audio Processor.
150 */
151 struct mapreg {
152 unsigned short mr_x[8];
153 unsigned short mr_r[8];
154 unsigned short mr_gx;
155 unsigned short mr_gr;
156 unsigned short mr_ger;
157 unsigned short mr_stgr;
158 unsigned short mr_ftgr;
159 unsigned short mr_atgr;
160 unsigned char mr_mmr1;
161 unsigned char mr_mmr2;
162 };
163
164 #define AUDIO_GETMAP _IOR('A', 27, struct mapreg)
165 #define AUDIO_SETMAP _IOW('A', 28, struct mapreg)
166
167 /*
168 * Compatibility with Sun interface
169 */
170 struct audio_ioctl {
171 short control;
172 unsigned char data[46];
173 };
174
175 #define AUDIOGETREG _IOWR('i',1,struct audio_ioctl)
176 #define AUDIOSETREG _IOW('i',2,struct audio_ioctl)
177
178 #endif /* _DEVICE_AUDIO_STATUS_H_ */
Cache object: 2f0f26e9099b33fbd8fef3d5ad724288
|