Annotation of Gnu-Mach/include/device/audio_status.h, revision 1.1.1.1

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:  * 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: 
                     59: #ifndef _DEVICE_AUDIO_STATUS_H_
                     60: #define _DEVICE_AUDIO_STATUS_H_
                     61: 
                     62: /*
                     63:  *     Access to ADC devices, such as the AMD 79C30A/32A.
                     64:  */
                     65: 
                     66: /*
                     67:  * Programmable gains, see tables in device drivers
                     68:  * for detailed mapping to device specifics.
                     69:  */
                     70: #define AUDIO_MIN_GAIN (0)
                     71: #define AUDIO_MAX_GAIN (255)
                     72: 
                     73: /*
                     74:  * Encoding of audio samples
                     75:  */
                     76: #define AUDIO_ENCODING_ULAW (1)
                     77: #define AUDIO_ENCODING_ALAW (2)
                     78: 
                     79: /*
                     80:  * Selection of input/output jack
                     81:  */
                     82: #define        AUDIO_MIKE              1
                     83: 
                     84: #define AUDIO_SPEAKER          1
                     85: #define AUDIO_HEADPHONE                2
                     86: 
                     87: /*
                     88:  * Programming information from/to user application.
                     89:  * Only portions of this might be available on any given chip.
                     90:  */
                     91: struct audio_prinfo {
                     92:        unsigned int    sample_rate;
                     93:        unsigned int    channels;
                     94:        unsigned int    precision;
                     95:        unsigned int    encoding;
                     96:        unsigned int    gain;
                     97:        unsigned int    port;           /* input/output jack */
                     98:        unsigned int    seek;           /* BSD extension */
                     99:        unsigned int    ispare[3];
                    100:        unsigned int    samples;
                    101:        unsigned int    eof;
                    102: 
                    103:        unsigned char   pause;
                    104:        unsigned char   error;
                    105:        unsigned char   waiting;
                    106:        unsigned char   cspare[3];
                    107:        unsigned char   open;
                    108:        unsigned char   active;
                    109: 
                    110: };
                    111: 
                    112: struct audio_info {
                    113:        struct  audio_prinfo play;
                    114:        struct  audio_prinfo record;
                    115:        unsigned int    monitor_gain;
                    116:        /* BSD extensions */
                    117:        unsigned int    blocksize;      /* input blocking threshold */
                    118:        unsigned int    hiwat;          /* output high water mark */
                    119:        unsigned int    lowat;          /* output low water mark */
                    120:        unsigned int    backlog;        /* samples of output backlog to gen. */
                    121: };
                    122: 
                    123: typedef struct audio_info audio_info_t;
                    124: 
                    125: #define AUDIO_INITINFO(p)\
                    126:        (void)memset((void *)(p), 0xff, sizeof(struct audio_info))
                    127: 
                    128: #define AUDIO_GETINFO  _IOR('A', 21, audio_info_t)
                    129: #define AUDIO_SETINFO  _IOWR('A', 22, audio_info_t)
                    130: #define AUDIO_DRAIN    _IO('A', 23)
                    131: #define AUDIO_FLUSH    _IO('A', 24)
                    132: #define AUDIO_WSEEK    _IOR('A', 25, unsigned int)
                    133: #define AUDIO_RERROR   _IOR('A', 26, int)
                    134: #define AUDIO_WERROR   _IOR('A', 27, int)
                    135: 
                    136: /*
                    137:  * Low level interface to the amd79c30.
                    138:  * Internal registers of the MAP block,
                    139:  * the Main Audio Processor.
                    140:  */
                    141: struct mapreg {
                    142:        unsigned short  mr_x[8];
                    143:        unsigned short  mr_r[8];
                    144:        unsigned short  mr_gx;
                    145:        unsigned short  mr_gr;
                    146:        unsigned short  mr_ger;
                    147:        unsigned short  mr_stgr;
                    148:        unsigned short  mr_ftgr;
                    149:        unsigned short  mr_atgr;
                    150:        unsigned char   mr_mmr1;
                    151:        unsigned char   mr_mmr2;
                    152: };
                    153: 
                    154: #define AUDIO_GETMAP   _IOR('A', 27, struct mapreg)
                    155: #define        AUDIO_SETMAP    _IOW('A', 28, struct mapreg)
                    156: 
                    157: /*
                    158:  * Compatibility with Sun interface
                    159:  */
                    160: struct audio_ioctl {
                    161:        short   control;
                    162:        unsigned char   data[46];
                    163: };
                    164: 
                    165: #define AUDIOGETREG            _IOWR('i',1,struct audio_ioctl)
                    166: #define AUDIOSETREG            _IOW('i',2,struct audio_ioctl)
                    167: 
                    168: #endif /* _DEVICE_AUDIO_STATUS_H_ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.