Merge with Linux 2.4.0-test4-pre3.
[linux-2.6/linux-mips.git] / drivers / sound / sound_config.h
blob35c39e94744ab3f291e55f32c8e23382ec8b1747
1 /* sound_config.h
3 * A driver for sound cards, misc. configuration parameters.
4 */
5 /*
6 * Copyright (C) by Hannu Savolainen 1993-1997
8 * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
9 * Version 2 (June 1991). See the "COPYING" file distributed with this software
10 * for more info.
14 #ifndef _SOUND_CONFIG_H_
15 #define _SOUND_CONFIG_H_
17 #include <linux/config.h>
18 #include <linux/fs.h>
19 #include <linux/sound.h>
21 #include "os.h"
22 #include "soundvers.h"
25 #ifndef SND_DEFAULT_ENABLE
26 #define SND_DEFAULT_ENABLE 1
27 #endif
29 #ifndef MAX_REALTIME_FACTOR
30 #define MAX_REALTIME_FACTOR 4
31 #endif
34 * Use always 64k buffer size. There is no reason to use shorter.
36 #undef DSP_BUFFSIZE
37 #define DSP_BUFFSIZE (64*1024)
39 #ifndef DSP_BUFFCOUNT
40 #define DSP_BUFFCOUNT 1 /* 1 is recommended. */
41 #endif
43 #define FM_MONO 0x388 /* This is the I/O address used by AdLib */
45 #ifndef CONFIG_PAS_BASE
46 #define CONFIG_PAS_BASE 0x388
47 #endif
49 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
50 driver. (There is no need to alter this) */
51 #define SEQ_MAX_QUEUE 1024
53 #define SBFM_MAXINSTR (256) /* Size of the FM Instrument bank */
54 /* 128 instruments for general MIDI setup and 16 unassigned */
57 * Minor numbers for the sound driver.
59 * Unfortunately Creative called the codec chip of SB as a DSP. For this
60 * reason the /dev/dsp is reserved for digitized audio use. There is a
61 * device for true DSP processors but it will be called something else.
62 * In v3.0 it's /dev/sndproc but this could be a temporary solution.
65 #define SND_NDEVS 256 /* Number of supported devices */
66 #define SND_DEV_CTL 0 /* Control port /dev/mixer */
67 #define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM
68 synthesizer and MIDI output) */
69 #define SND_DEV_MIDIN 2 /* Raw midi access */
70 #define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */
71 #define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */
72 #define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */
73 #define SND_DEV_STATUS 6 /* /dev/sndstat */
74 #define SND_DEV_AWFM 7 /* Reserved */
75 #define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */
76 #define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */
77 #define SND_DEV_PSS SND_DEV_SNDPROC
79 #define DSP_DEFAULT_SPEED 8000
81 #define MAX_AUDIO_DEV 5
82 #define MAX_MIXER_DEV 5
83 #define MAX_SYNTH_DEV 5
84 #define MAX_MIDI_DEV 6
85 #define MAX_TIMER_DEV 4
87 struct address_info {
88 int io_base;
89 int irq;
90 int dma;
91 int dma2;
92 int always_detect; /* 1=Trust me, it's there */
93 char *name;
94 int driver_use_1; /* Driver defined field 1 */
95 int driver_use_2; /* Driver defined field 2 */
96 int *osp; /* OS specific info */
97 int card_subtype; /* Driver specific. Usually 0 */
98 void *memptr; /* Module memory chainer */
99 int slots[6]; /* To remember driver slot ids */
102 #define SYNTH_MAX_VOICES 32
104 struct voice_alloc_info {
105 int max_voice;
106 int used_voices;
107 int ptr; /* For device specific use */
108 unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
109 int timestamp;
110 int alloc_times[SYNTH_MAX_VOICES];
113 struct channel_info {
114 int pgm_num;
115 int bender_value;
116 int bender_range;
117 unsigned char controllers[128];
121 * Process wakeup reasons
123 #define WK_NONE 0x00
124 #define WK_WAKEUP 0x01
125 #define WK_TIMEOUT 0x02
126 #define WK_SIGNAL 0x04
127 #define WK_SLEEP 0x08
128 #define WK_SELECT 0x10
129 #define WK_ABORT 0x20
131 #define OPEN_READ PCM_ENABLE_INPUT
132 #define OPEN_WRITE PCM_ENABLE_OUTPUT
133 #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
135 #if OPEN_READ == FMODE_READ && OPEN_WRITE == FMODE_WRITE
137 extern __inline__ int translate_mode(struct file *file)
139 return file->f_mode;
142 #else
144 extern __inline__ int translate_mode(struct file *file)
146 return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) |
147 ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0);
150 #endif
153 #include "sound_calls.h"
154 #include "dev_table.h"
156 #ifndef DEB
157 #define DEB(x)
158 #endif
160 #ifndef DDB
161 #define DDB(x) {}
162 #endif
164 #ifndef MDB
165 #ifdef MODULE
166 #define MDB(x) x
167 #else
168 #define MDB(x)
169 #endif
170 #endif
172 #define TIMER_ARMED 121234
173 #define TIMER_NOT_ARMED 1
175 #endif