|
|
1.1 root 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 [email protected]
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: * 4. The name of the Laboratory may not be used to endorse or promote
39: * products derived from this software without specific prior written
40: * permission.
41: *
42: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
43: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
46: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52: * SUCH DAMAGE.
53: */
54:
55: #ifndef _DEVICE_AUDIO_STATUS_H_
56: #define _DEVICE_AUDIO_STATUS_H_
57:
58: /*
59: * Access to ADC devices, such as the AMD 79C30A/32A.
60: */
61:
62: /*
63: * Programmable gains, see tables in device drivers
64: * for detailed mapping to device specifics.
65: */
66: #define AUDIO_MIN_GAIN (0)
67: #define AUDIO_MAX_GAIN (255)
68:
69: /*
70: * Encoding of audio samples
71: */
72: #define AUDIO_ENCODING_ULAW (1)
73: #define AUDIO_ENCODING_ALAW (2)
74:
75: /*
76: * Selection of input/output jack
77: */
78: #define AUDIO_MIKE 1
79:
80: #define AUDIO_SPEAKER 1
81: #define AUDIO_HEADPHONE 2
82:
83: /*
84: * Programming information from/to user application.
85: * Only portions of this might be available on any given chip.
86: */
87: struct audio_prinfo {
88: unsigned int sample_rate;
89: unsigned int channels;
90: unsigned int precision;
91: unsigned int encoding;
92: unsigned int gain;
93: unsigned int port; /* input/output jack */
94: unsigned int seek; /* BSD extension */
95: unsigned int ispare[3];
96: unsigned int samples;
97: unsigned int eof;
98:
99: unsigned char pause;
100: unsigned char error;
101: unsigned char waiting;
102: unsigned char cspare[3];
103: unsigned char open;
104: unsigned char active;
105:
106: };
107:
108: struct audio_info {
109: struct audio_prinfo play;
110: struct audio_prinfo record;
111: unsigned int monitor_gain;
112: /* BSD extensions */
113: unsigned int blocksize; /* input blocking threshold */
114: unsigned int hiwat; /* output high water mark */
115: unsigned int lowat; /* output low water mark */
116: unsigned int backlog; /* samples of output backlog to gen. */
117: };
118:
119: typedef struct audio_info audio_info_t;
120:
121: #define AUDIO_INITINFO(p)\
122: (void)memset((void *)(p), 0xff, sizeof(struct audio_info))
123:
124: #define AUDIO_GETINFO _IOR('A', 21, audio_info_t)
125: #define AUDIO_SETINFO _IOWR('A', 22, audio_info_t)
126: #define AUDIO_DRAIN _IO('A', 23)
127: #define AUDIO_FLUSH _IO('A', 24)
128: #define AUDIO_WSEEK _IOR('A', 25, unsigned int)
129: #define AUDIO_RERROR _IOR('A', 26, int)
130: #define AUDIO_WERROR _IOR('A', 27, int)
131:
132: /*
133: * Low level interface to the amd79c30.
134: * Internal registers of the MAP block,
135: * the Main Audio Processor.
136: */
137: struct mapreg {
138: unsigned short mr_x[8];
139: unsigned short mr_r[8];
140: unsigned short mr_gx;
141: unsigned short mr_gr;
142: unsigned short mr_ger;
143: unsigned short mr_stgr;
144: unsigned short mr_ftgr;
145: unsigned short mr_atgr;
146: unsigned char mr_mmr1;
147: unsigned char mr_mmr2;
148: };
149:
150: #define AUDIO_GETMAP _IOR('A', 27, struct mapreg)
151: #define AUDIO_SETMAP _IOW('A', 28, struct mapreg)
152:
153: /*
154: * Compatibility with Sun interface
155: */
156: struct audio_ioctl {
157: short control;
158: unsigned char data[46];
159: };
160:
161: #define AUDIOGETREG _IOWR('i',1,struct audio_ioctl)
162: #define AUDIOSETREG _IOW('i',2,struct audio_ioctl)
163:
164: #endif /* _DEVICE_AUDIO_STATUS_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.