Import 2.3.18pre1
[davej-history.git] / drivers / sound / dev_table.h
blob0ce2c49b06febc509107432180ed845a953d8173
1 /*
2 * dev_table.h
4 * Global definitions for device call tables
7 * Copyright (C) by Hannu Savolainen 1993-1997
9 * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
10 * Version 2 (June 1991). See the "COPYING" file distributed with this software
11 * for more info.
15 #ifndef _DEV_TABLE_H_
16 #define _DEV_TABLE_H_
18 #include <linux/config.h>
21 * Sound card numbers 27 to 999. (1 to 26 are defined in soundcard.h)
22 * Numbers 1000 to N are reserved for driver's internal use.
25 #define SNDCARD_DESKPROXL 27 /* Compaq Deskpro XL */
26 #define SNDCARD_VIDC 28 /* ARMs VIDC */
27 #define SNDCARD_SBPNP 29
28 #define SNDCARD_SOFTOSS 36
29 #define SNDCARD_VMIDI 37
30 #define SNDCARD_OPL3SA1 38 /* Note: clash in msnd.h */
31 #define SNDCARD_OPL3SA1_SB 39
32 #define SNDCARD_OPL3SA1_MPU 40
33 #define SNDCARD_WAVEFRONT 41
34 #define SNDCARD_OPL3SA2 42
35 #define SNDCARD_OPL3SA2_MPU 43
36 #define SNDCARD_WAVEARTIST 44 /* Rebel Waveartist */
37 #define SNDCARD_OPL3SA2_MSS 45 /* Originally missed */
38 #define SNDCARD_AD1816 88
41 * NOTE! NOTE! NOTE! NOTE!
43 * If you modify this file, please check the dev_table.c also.
45 * NOTE! NOTE! NOTE! NOTE!
48 extern int sound_started;
50 struct driver_info
52 char *driver_id;
53 int card_subtype; /* Driver specific. Usually 0 */
54 int card_type; /* From soundcard.h */
55 char *name;
56 void (*attach) (struct address_info *hw_config);
57 int (*probe) (struct address_info *hw_config);
58 void (*unload) (struct address_info *hw_config);
61 struct card_info
63 int card_type; /* Link (search key) to the driver list */
64 struct address_info config;
65 int enabled;
66 void *for_driver_use;
71 * Device specific parameters (used only by dmabuf.c)
73 #define MAX_SUB_BUFFERS (32*MAX_REALTIME_FACTOR)
75 #define DMODE_NONE 0
76 #define DMODE_OUTPUT PCM_ENABLE_OUTPUT
77 #define DMODE_INPUT PCM_ENABLE_INPUT
79 struct dma_buffparms
81 int dma_mode; /* DMODE_INPUT, DMODE_OUTPUT or DMODE_NONE */
82 int closing;
85 * Pointers to raw buffers
88 char *raw_buf;
89 unsigned long raw_buf_phys;
90 int buffsize;
93 * Device state tables
96 unsigned long flags;
97 #define DMA_BUSY 0x00000001
98 #define DMA_RESTART 0x00000002
99 #define DMA_ACTIVE 0x00000004
100 #define DMA_STARTED 0x00000008
101 #define DMA_EMPTY 0x00000010
102 #define DMA_ALLOC_DONE 0x00000020
103 #define DMA_SYNCING 0x00000040
104 #define DMA_DIRTY 0x00000080
105 #define DMA_POST 0x00000100
106 #define DMA_NODMA 0x00000200
107 #define DMA_NOTIMEOUT 0x00000400
109 int open_mode;
112 * Queue parameters.
114 int qlen;
115 int qhead;
116 int qtail;
117 int cfrag; /* Current incomplete fragment (write) */
119 int nbufs;
120 int counts[MAX_SUB_BUFFERS];
121 int subdivision;
123 int fragment_size;
124 int needs_reorg;
125 int max_fragments;
127 int bytes_in_use;
129 int underrun_count;
130 unsigned long byte_counter;
131 unsigned long user_counter;
132 unsigned long max_byte_counter;
133 int data_rate; /* Bytes/second */
135 int mapping_flags;
136 #define DMA_MAP_MAPPED 0x00000001
137 char neutral_byte;
138 int dma; /* DMA channel */
140 #ifdef OS_DMA_PARMS
141 OS_DMA_PARMS
142 #endif
143 int applic_profile; /* Application profile (APF_*) */
144 /* Interrupt callback stuff */
145 void (*audio_callback) (int dev, int parm);
146 int callback_parm;
148 int buf_flags[MAX_SUB_BUFFERS];
149 #define BUFF_EOF 0x00000001 /* Increment eof count */
150 #define BUFF_DIRTY 0x00000002 /* Buffer written */
154 * Structure for use with various microcontrollers and DSP processors
155 * in the recent sound cards.
157 typedef struct coproc_operations
159 char name[64];
160 int (*open) (void *devc, int sub_device);
161 void (*close) (void *devc, int sub_device);
162 int (*ioctl) (void *devc, unsigned int cmd, caddr_t arg, int local);
163 void (*reset) (void *devc);
165 void *devc; /* Driver specific info */
166 } coproc_operations;
168 struct audio_driver
170 int (*open) (int dev, int mode);
171 void (*close) (int dev);
172 void (*output_block) (int dev, unsigned long buf,
173 int count, int intrflag);
174 void (*start_input) (int dev, unsigned long buf,
175 int count, int intrflag);
176 int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
177 int (*prepare_for_input) (int dev, int bufsize, int nbufs);
178 int (*prepare_for_output) (int dev, int bufsize, int nbufs);
179 void (*halt_io) (int dev);
180 int (*local_qlen)(int dev);
181 void (*copy_user) (int dev,
182 char *localbuf, int localoffs,
183 const char *userbuf, int useroffs,
184 int max_in, int max_out,
185 int *used, int *returned,
186 int len);
187 void (*halt_input) (int dev);
188 void (*halt_output) (int dev);
189 void (*trigger) (int dev, int bits);
190 int (*set_speed)(int dev, int speed);
191 unsigned int (*set_bits)(int dev, unsigned int bits);
192 short (*set_channels)(int dev, short channels);
193 void (*postprocess_write)(int dev); /* Device spesific postprocessing for written data */
194 void (*preprocess_read)(int dev); /* Device spesific preprocessing for read data */
195 void (*mmap)(int dev);
198 struct audio_operations
200 char name[128];
201 int flags;
202 #define NOTHING_SPECIAL 0x00
203 #define NEEDS_RESTART 0x01
204 #define DMA_AUTOMODE 0x02
205 #define DMA_DUPLEX 0x04
206 #define DMA_PSEUDO_AUTOMODE 0x08
207 #define DMA_HARDSTOP 0x10
208 #define DMA_EXACT 0x40
209 #define DMA_NORESET 0x80
210 int format_mask; /* Bitmask for supported audio formats */
211 void *devc; /* Driver specific info */
212 struct audio_driver *d;
213 void *portc; /* Driver spesific info */
214 struct dma_buffparms *dmap_in, *dmap_out;
215 struct coproc_operations *coproc;
216 int mixer_dev;
217 int enable_bits;
218 int open_mode;
219 int go;
220 int min_fragment; /* 0 == unlimited */
221 int max_fragment; /* 0 == unlimited */
222 int parent_dev; /* 0 -> no parent, 1 to n -> parent=parent_dev+1 */
224 /* fields formerly in dmabuf.c */
225 wait_queue_head_t in_sleeper;
226 wait_queue_head_t out_sleeper;
227 wait_queue_head_t poll_sleeper;
229 /* fields formerly in audio.c */
230 int audio_mode;
232 #define AM_NONE 0
233 #define AM_WRITE OPEN_WRITE
234 #define AM_READ OPEN_READ
236 int local_format;
237 int audio_format;
238 int local_conversion;
239 #define CNV_MU_LAW 0x00000001
241 /* large structures at the end to keep offsets small */
242 struct dma_buffparms dmaps[2];
245 int *load_mixer_volumes(char *name, int *levels, int present);
247 struct mixer_operations
249 char id[16];
250 char name[64];
251 int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
253 void *devc;
254 int modify_counter;
257 struct synth_operations
259 char *id; /* Unique identifier (ASCII) max 29 char */
260 struct synth_info *info;
261 int midi_dev;
262 int synth_type;
263 int synth_subtype;
265 int (*open) (int dev, int mode);
266 void (*close) (int dev);
267 int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
268 int (*kill_note) (int dev, int voice, int note, int velocity);
269 int (*start_note) (int dev, int voice, int note, int velocity);
270 int (*set_instr) (int dev, int voice, int instr);
271 void (*reset) (int dev);
272 void (*hw_control) (int dev, unsigned char *event);
273 int (*load_patch) (int dev, int format, const char *addr,
274 int offs, int count, int pmgr_flag);
275 void (*aftertouch) (int dev, int voice, int pressure);
276 void (*controller) (int dev, int voice, int ctrl_num, int value);
277 void (*panning) (int dev, int voice, int value);
278 void (*volume_method) (int dev, int mode);
279 void (*bender) (int dev, int chn, int value);
280 int (*alloc_voice) (int dev, int chn, int note, struct voice_alloc_info *alloc);
281 void (*setup_voice) (int dev, int voice, int chn);
282 int (*send_sysex)(int dev, unsigned char *bytes, int len);
284 struct voice_alloc_info alloc;
285 struct channel_info chn_info[16];
286 int emulation;
287 #define EMU_GM 1 /* General MIDI */
288 #define EMU_XG 2 /* Yamaha XG */
289 #define MAX_SYSEX_BUF 64
290 unsigned char sysex_buf[MAX_SYSEX_BUF];
291 int sysex_ptr;
294 struct midi_input_info
296 /* MIDI input scanner variables */
297 #define MI_MAX 10
298 int m_busy;
299 unsigned char m_buf[MI_MAX];
300 unsigned char m_prev_status; /* For running status */
301 int m_ptr;
302 #define MST_INIT 0
303 #define MST_DATA 1
304 #define MST_SYSEX 2
305 int m_state;
306 int m_left;
309 struct midi_operations
311 struct midi_info info;
312 struct synth_operations *converter;
313 struct midi_input_info in_info;
314 int (*open) (int dev, int mode,
315 void (*inputintr)(int dev, unsigned char data),
316 void (*outputintr)(int dev)
318 void (*close) (int dev);
319 int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
320 int (*outputc) (int dev, unsigned char data);
321 int (*start_read) (int dev);
322 int (*end_read) (int dev);
323 void (*kick)(int dev);
324 int (*command) (int dev, unsigned char *data);
325 int (*buffer_status) (int dev);
326 int (*prefix_cmd) (int dev, unsigned char status);
327 struct coproc_operations *coproc;
328 void *devc;
331 struct sound_lowlev_timer
333 int dev;
334 int priority;
335 unsigned int (*tmr_start)(int dev, unsigned int usecs);
336 void (*tmr_disable)(int dev);
337 void (*tmr_restart)(int dev);
340 struct sound_timer_operations
342 struct sound_timer_info info;
343 int priority;
344 int devlink;
345 int (*open)(int dev, int mode);
346 void (*close)(int dev);
347 int (*event)(int dev, unsigned char *ev);
348 unsigned long (*get_time)(int dev);
349 int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
350 void (*arm_timer)(int dev, long time);
353 #ifdef _DEV_TABLE_C_
355 struct audio_operations *audio_devs[MAX_AUDIO_DEV] = {NULL}; int num_audiodevs = 0;
356 struct mixer_operations *mixer_devs[MAX_MIXER_DEV] = {NULL}; int num_mixers = 0;
357 struct synth_operations *synth_devs[MAX_SYNTH_DEV+MAX_MIDI_DEV] = {NULL}; int num_synths = 0;
358 struct midi_operations *midi_devs[MAX_MIDI_DEV] = {NULL}; int num_midis = 0;
360 #if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS) && !defined(VMIDI)
361 extern struct sound_timer_operations default_sound_timer;
362 struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = {
363 &default_sound_timer, NULL
365 int num_sound_timers = 1;
366 #else
367 struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = {
368 NULL
370 int num_sound_timers = 0;
371 #endif
374 * List of low level drivers compiled into the kernel.
377 struct driver_info sound_drivers[] =
379 #ifdef CONFIG_SOUND_PSS
380 {"PSS", 0, SNDCARD_PSS, "Echo Personal Sound System PSS (ESC614)", attach_pss, probe_pss, unload_pss},
381 {"PSSMPU", 0, SNDCARD_PSS_MPU, "PSS-MPU", attach_pss_mpu, probe_pss_mpu, unload_pss_mpu},
382 {"PSSMSS", 0, SNDCARD_PSS_MSS, "PSS-MSS", attach_pss_mss, probe_pss_mss, unload_pss_mss},
383 #endif
385 #ifdef CONFIG_SOUND_GUS
386 #ifdef CONFIG_GUS16
387 {"GUS16", 0, SNDCARD_GUS16, "Ultrasound 16-bit opt.", attach_gus_db16, probe_gus_db16, unload_gus_db16},
388 #endif
389 #ifdef CONFIG_GUS
390 {"GUS", 0, SNDCARD_GUS, "Gravis Ultrasound", attach_gus_card, probe_gus, unload_gus},
391 {"GUSPNP", 1, SNDCARD_GUSPNP, "GUS PnP", attach_gus_card, probe_gus, unload_gus},
392 #endif
393 #endif
395 #ifdef CONFIG_SOUND_MSS
396 {"MSS", 0, SNDCARD_MSS, "MS Sound System", attach_ms_sound, probe_ms_sound, unload_ms_sound},
397 /* Compaq Deskpro XL */
398 {"DESKPROXL", 2, SNDCARD_DESKPROXL, "Compaq Deskpro XL", attach_ms_sound, probe_ms_sound, unload_ms_sound},
399 #endif
401 #ifdef CONFIG_SOUND_MAD16
402 {"MAD16", 0, SNDCARD_MAD16, "MAD16/Mozart (MSS)", attach_mad16, probe_mad16, unload_mad16},
403 {"MAD16MPU", 0, SNDCARD_MAD16_MPU, "MAD16/Mozart (MPU)", attach_mad16_mpu, probe_mad16_mpu, unload_mad16_mpu},
404 #endif
406 #ifdef CONFIG_SOUND_CS4232
407 {"CS4232", 0, SNDCARD_CS4232, "CS4232", attach_cs4232, probe_cs4232, unload_cs4232},
408 #endif
409 #ifdef CONFIG_CS4232_MPU_BASE
410 {"CS4232MPU", 0, SNDCARD_CS4232_MPU, "CS4232 MIDI", attach_cs4232_mpu, probe_cs4232_mpu, unload_cs4232_mpu},
411 #endif
413 #ifdef CONFIG_SOUND_OPL3SA2
414 {"OPL3SA2", 0, SNDCARD_OPL3SA2, "OPL3SA2", attach_opl3sa2, probe_opl3sa2, unload_opl3sa2},
415 {"OPL3SA2MSS", 1, SNDCARD_OPL3SA2_MSS, "OPL3SA2 MSS", attach_opl3sa2_mss, probe_opl3sa2_mss, unload_opl3sa2_mss},
416 {"OPL3SA2MPU", 0, SNDCARD_OPL3SA2_MPU, "OPL3SA2 MIDI", attach_opl3sa2_mpu, probe_opl3sa2_mpu, unload_opl3sa2_mpu},
417 #endif
419 #ifdef CONFIG_SGALAXY
420 {"SGALAXY", 0, SNDCARD_SGALAXY, "Sound Galaxy WSS", attach_sgalaxy, probe_sgalaxy, unload_sgalaxy},
421 #endif
423 #ifdef CONFIG_SOUND_AD1816
424 {"AD1816", 0, SNDCARD_AD1816, "AD1816", attach_ad1816,
425 probe_ad1816, unload_ad1816},
426 #endif
428 #ifdef CONFIG_SOUND_YM3812
429 {"OPL3", 0, SNDCARD_ADLIB, "OPL-2/OPL-3 FM", attach_adlib_card, probe_adlib, unload_adlib},
430 #endif
432 #ifdef CONFIG_SOUND_PAS
433 {"PAS16", 0, SNDCARD_PAS, "ProAudioSpectrum", attach_pas_card, probe_pas, unload_pas},
434 #endif
436 #if (defined(CONFIG_SOUND_MPU401) || defined(CONFIG_SOUND_MPU_EMU)) && defined(CONFIG_MIDI)
437 {"MPU401", 0, SNDCARD_MPU401,"Roland MPU-401", attach_mpu401, probe_mpu401, unload_mpu401},
438 #endif
440 #if defined(CONFIG_SOUND_UART401) && defined(CONFIG_MIDI)
441 {"UART401", 0, SNDCARD_UART401,"MPU-401 (UART)",
442 attach_uart401, probe_uart401, unload_uart401},
443 #endif
445 #if defined(CONFIG_SOUND_WAVEFRONT)
446 {"WAVEFRONT", 0, SNDCARD_WAVEFRONT,"TB WaveFront", attach_wavefront, probe_wavefront, unload_wavefront},
447 #endif
449 #if defined(CONFIG_SOUND_MAUI)
450 {"MAUI", 0, SNDCARD_MAUI,"TB Maui", attach_maui, probe_maui, unload_maui},
451 #endif
453 #if defined(CONFIG_SOUND_UART6850) && defined(CONFIG_MIDI)
454 {"MIDI6850", 0, SNDCARD_UART6850,"6860 UART Midi", attach_uart6850, probe_uart6850, unload_uart6850},
455 #endif
460 #ifdef CONFIG_SOUND_SBDSP
461 {"SBLAST", 0, SNDCARD_SB, "Sound Blaster", attach_sb_card, probe_sb, unload_sb},
462 {"SBPNP", 6, SNDCARD_SBPNP, "Sound Blaster PnP", attach_sb_card, probe_sb, unload_sb},
464 #ifdef CONFIG_MIDI
465 {"SBMPU", 0, SNDCARD_SB16MIDI,"SB MPU-401", attach_sbmpu, probe_sbmpu, unload_sbmpu},
466 #endif
467 #endif
469 #ifdef CONFIG_SOUND_SSCAPE
470 {"SSCAPE", 0, SNDCARD_SSCAPE, "Ensoniq SoundScape", attach_sscape, probe_sscape, unload_sscape},
471 {"SSCAPEMSS", 0, SNDCARD_SSCAPE_MSS, "MS Sound System (SoundScape)", attach_ss_ms_sound, probe_ss_ms_sound, unload_ss_ms_sound},
472 #endif
474 #ifdef CONFIG_SOUND_OPL3SA1
475 {"OPL3SA", 0, SNDCARD_OPL3SA1, "Yamaha OPL3-SA", attach_opl3sa_wss, probe_opl3sa_wss, unload_opl3sa_wss},
476 /* {"OPL3SASB", 0, SNDCARD_OPL3SA1_SB, "OPL3-SA (SB mode)", attach_opl3sa_sb, probe_opl3sa_sb, unload_opl3sa_sb}, */
477 {"OPL3SAMPU", 0, SNDCARD_OPL3SA1_MPU, "OPL3-SA MIDI", attach_opl3sa_mpu, probe_opl3sa_mpu, unload_opl3sa_mpu},
478 #endif
480 #ifdef CONFIG_SOUND_TRIX
481 {"TRXPRO", 0, SNDCARD_TRXPRO, "MediaTrix AudioTrix Pro", attach_trix_wss, probe_trix_wss, unload_trix_wss},
482 {"TRXPROSB", 0, SNDCARD_TRXPRO_SB, "AudioTrix (SB mode)", attach_trix_sb, probe_trix_sb, unload_trix_sb},
483 {"TRXPROMPU", 0, SNDCARD_TRXPRO_MPU, "AudioTrix MIDI", attach_trix_mpu, probe_trix_mpu, unload_trix_mpu},
484 #endif
486 #ifdef CONFIG_SOUND_SOFTOSS
487 {"SOFTSYN", 0, SNDCARD_SOFTOSS, "SoftOSS Virtual Wave Table",
488 attach_softsyn_card, probe_softsyn, unload_softsyn},
489 #endif
491 #if defined(CONFIG_SOUND_VMIDI) && defined(CONFIG_MIDI)
492 {"VMIDI", 0, SNDCARD_VMIDI,"Loopback MIDI Device", attach_v_midi, probe_v_midi, unload_v_midi},
493 #endif
494 #ifdef CONFIG_SOUND_VIDC
495 {"VIDC", 0, SNDCARD_VIDC, "ARM VIDC 16-bit D/A", attach_vidc, probe_vidc, unload_vidc },
496 #endif
497 #ifdef CONFIG_SOUND_WAVEARTIST
498 {"WaveArtist", 0, SNDCARD_WAVEARTIST, "NetWinder WaveArtist", attach_waveartist, probe_waveartist, unload_waveartist },
499 #endif
500 {NULL, 0, 0, "*?*", NULL, NULL, NULL}
503 int num_sound_drivers = sizeof(sound_drivers) / sizeof (struct driver_info);
506 #ifndef FULL_SOUND
509 * List of devices actually configured in the system.
511 * Note! The detection order is significant. Don't change it.
514 struct card_info snd_installed_cards[] =
516 #ifdef CONFIG_SOUND_PSS
517 {SNDCARD_PSS, {CONFIG_PSS_BASE, 0, -1, -1}, SND_DEFAULT_ENABLE},
518 #ifdef CONFIG_PSS_MPU_BASE
519 {SNDCARD_PSS_MPU, {CONFIG_PSS_MPU_BASE, CONFIG_PSS_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
520 #endif
521 #ifdef CONFIG_PSS_MSS_BASE
522 {SNDCARD_PSS_MSS, {CONFIG_PSS_MSS_BASE, CONFIG_PSS_MSS_IRQ, CONFIG_PSS_MSS_DMA, -1}, SND_DEFAULT_ENABLE},
523 #endif
524 #endif
526 #ifdef CONFIG_SOUND_TRIX
527 #ifndef CONFIG_TRIX_DMA2
528 #define CONFIG_TRIX_DMA2 CONFIG_TRIX_DMA
529 #endif
530 {SNDCARD_TRXPRO, {CONFIG_TRIX_BASE, CONFIG_TRIX_IRQ, CONFIG_TRIX_DMA, CONFIG_TRIX_DMA2}, SND_DEFAULT_ENABLE},
531 #ifdef CONFIG_TRIX_SB_BASE
532 {SNDCARD_TRXPRO_SB, {CONFIG_TRIX_SB_BASE, CONFIG_TRIX_SB_IRQ, CONFIG_TRIX_SB_DMA, -1}, SND_DEFAULT_ENABLE},
533 #endif
534 #ifdef CONFIG_TRIX_MPU_BASE
535 {SNDCARD_TRXPRO_MPU, {CONFIG_TRIX_MPU_BASE, CONFIG_TRIX_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
536 #endif
537 #endif
539 #ifdef CONFIG_SOUND_OPL3SA1
540 {SNDCARD_OPL3SA1, {CONFIG_OPL3SA1_BASE, CONFIG_OPL3SA1_IRQ, CONFIG_OPL3SA1_DMA, CONFIG_OPL3SA1_DMA2}, SND_DEFAULT_ENABLE},
541 #ifdef CONFIG_OPL3SA1_MPU_BASE
542 {SNDCARD_OPL3SA1_MPU, {CONFIG_OPL3SA1_MPU_BASE, CONFIG_OPL3SA1_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
543 #endif
544 #endif
546 #ifdef CONFIG_SOUND_SOFTOSS
547 {SNDCARD_SOFTOSS, {0, 0, -1, -1}, SND_DEFAULT_ENABLE},
548 #endif
550 #ifdef CONFIG_SOUND_SSCAPE
551 {SNDCARD_SSCAPE, {CONFIG_SSCAPE_BASE, CONFIG_SSCAPE_IRQ, CONFIG_SSCAPE_DMA, -1}, SND_DEFAULT_ENABLE},
552 {SNDCARD_SSCAPE_MSS, {CONFIG_SSCAPE_MSS_BASE, CONFIG_SSCAPE_MSS_IRQ, CONFIG_SSCAPE_DMA, -1}, SND_DEFAULT_ENABLE},
553 #endif
555 #ifdef CONFIG_SOUND_MAD16
556 #ifndef CONFIG_MAD16_DMA2
557 #define CONFIG_MAD16_DMA2 CONFIG_MAD16_DMA
558 #endif
559 {SNDCARD_MAD16, {CONFIG_MAD16_BASE, CONFIG_MAD16_IRQ, CONFIG_MAD16_DMA, CONFIG_MAD16_DMA2}, SND_DEFAULT_ENABLE},
560 #ifdef CONFIG_MAD16_MPU_BASE
561 {SNDCARD_MAD16_MPU, {CONFIG_MAD16_MPU_BASE, CONFIG_MAD16_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
562 #endif
563 #endif
565 #ifdef CONFIG_SOUND_CS4232
566 #ifndef CONFIG_CS4232_DMA2
567 #define CONFIG_CS4232_DMA2 CONFIG_CS4232_DMA
568 #endif
569 #ifdef CONFIG_CS4232_MPU_BASE
570 {SNDCARD_CS4232_MPU, {CONFIG_CS4232_MPU_BASE, CONFIG_CS4232_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
571 #endif
572 {SNDCARD_CS4232, {CONFIG_CS4232_BASE, CONFIG_CS4232_IRQ, CONFIG_CS4232_DMA, CONFIG_CS4232_DMA2}, SND_DEFAULT_ENABLE},
573 #endif
575 #ifdef CONFIG_SOUND_OPL3SA2
576 #ifndef CONFIG_OPL3SA2_DMA2
577 #define CONFIG_OPL3SA2_DMA2 CONFIG_OPL3SA2_DMA
578 #endif
579 {SNDCARD_OPL3SA2, {CONFIG_OPL3SA2_CTRL_BASE, CONFIG_OPL3SA2_IRQ, CONFIG_OPL3SA2_DMA, CONFIG_OPL3SA2_DMA2}, SND_DEFAULT_ENABLE},
580 {SNDCARD_OPL3SA2_MSS, {CONFIG_OPL3SA2_BASE, CONFIG_OPL3SA2_IRQ, CONFIG_OPL3SA2_DMA, CONFIG_OPL3SA2_DMA2}, SND_DEFAULT_ENABLE},
581 #ifdef CONFIG_OPL3SA2_MPU_BASE
582 {SNDCARD_OPL3SA2_MPU, {CONFIG_OPL3SA2_MPU_BASE, CONFIG_OPL3SA2_MPU_IRQ, CONFIG_OPL3SA2_DMA, -1}, SND_DEFAULT_ENABLE},
583 #endif
584 #endif
586 #ifdef CONFIG_SGALAXY
587 #ifndef CONFIG_SGALAXY_DMA2
588 #define CONFIG_SGALAXY_DMA2 CONFIG_SGALAXY_DMA
589 #endif
590 {SNDCARD_SGALAXY, {CONFIG_SGALAXY_BASE, CONFIG_SGALAXY_IRQ, CONFIG_SGALAXY_DMA, CONFIG_SGALAXY_DMA2, 0, NULL, CONFIG_SGALAXY_SGBASE}, SND_DEFAULT_ENABLE},
591 #endif
594 #ifdef CONFIG_SOUND_MSS
595 #ifndef CONFIG_MSS_DMA2
596 #define CONFIG_MSS_DMA2 -1
597 #endif
599 #ifdef DESKPROXL
600 {SNDCARD_DESKPROXL, {CONFIG_MSS_BASE, CONFIG_MSS_IRQ, CONFIG_MSS_DMA, CONFIG_MSS_DMA2}, SND_DEFAULT_ENABLE},
601 #else
602 {SNDCARD_MSS, {CONFIG_MSS_BASE, CONFIG_MSS_IRQ, CONFIG_MSS_DMA, CONFIG_MSS_DMA2}, SND_DEFAULT_ENABLE},
603 #endif
605 #ifdef MSS2_BASE
606 {SNDCARD_MSS, {MSS2_BASE, MSS2_IRQ, MSS2_DMA, MSS2_DMA2}, SND_DEFAULT_ENABLE},
607 #endif
608 #endif
610 #ifdef CONFIG_SOUND_PAS
611 {SNDCARD_PAS, {CONFIG_PAS_BASE, CONFIG_PAS_IRQ, CONFIG_PAS_DMA, -1}, SND_DEFAULT_ENABLE},
612 #endif
614 #ifdef CONFIG_SOUND_SB
615 #ifndef CONFIG_SB_DMA
616 #define CONFIG_SB_DMA 1
617 #endif
618 #ifndef CONFIG_SB_DMA2
619 #define CONFIG_SB_DMA2 -1
620 #endif
621 {SNDCARD_SB, {CONFIG_SB_BASE, CONFIG_SB_IRQ, CONFIG_SB_DMA, CONFIG_SB_DMA2}, SND_DEFAULT_ENABLE},
622 #ifdef SB2_BASE
623 {SNDCARD_SB, {SB2_BASE, SB2_IRQ, SB2_DMA, SB2_DMA2}, SND_DEFAULT_ENABLE},
624 #endif
625 #endif
627 #if defined(CONFIG_WAVEFRONT)
628 {SNDCARD_WAVEFRONT, {WAVEFRONT_BASE, WAVEFRONT_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
629 #endif
631 #ifdef CONFIG_SOUND_MAUI
632 {SNDCARD_MAUI, {CONFIG_MAUI_BASE, CONFIG_MAUI_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
633 #endif
635 #if defined(CONFIG_SOUND_MPU401) && defined(CONFIG_MIDI)
636 {SNDCARD_MPU401, {CONFIG_MPU_BASE, CONFIG_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
637 #ifdef MPU2_BASE
638 {SNDCARD_MPU401, {MPU2_BASE, MPU2_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
639 #endif
640 #ifdef MPU3_BASE
641 {SNDCARD_MPU401, {MPU3_BASE, MPU3_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
642 #endif
643 #endif
645 #if defined(CONFIG_SOUND_UART6850) && defined(CONFIG_MIDI)
646 {SNDCARD_UART6850, {CONFIG_U6850_BASE, CONFIG_U6850_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
647 #endif
649 #ifdef CONFIG_SOUND_SB
650 #if defined(CONFIG_MIDI) && defined(CONFIG_SB_MPU_BASE)
651 {SNDCARD_SB16MIDI,{CONFIG_SB_MPU_BASE, CONFIG_SB_MPU_IRQ, 0, -1}, SND_DEFAULT_ENABLE},
652 #endif
653 #endif
655 #ifdef CONFIG_SOUND_GUS
656 #ifndef CONFIG_GUS_DMA2
657 #define CONFIG_GUS_DMA2 CONFIG_GUS_DMA
658 #endif
659 #ifdef CONFIG_GUS16
660 {SNDCARD_GUS16, {CONFIG_GUS16_BASE, CONFIG_GUS16_IRQ, CONFIG_GUS16_DMA, -1}, SND_DEFAULT_ENABLE},
661 #endif
662 {SNDCARD_GUS, {CONFIG_GUS_BASE, CONFIG_GUS_IRQ, CONFIG_GUS_DMA, CONFIG_GUS_DMA2}, SND_DEFAULT_ENABLE},
663 #endif
665 #ifdef CONFIG_SOUND_YM3812
666 {SNDCARD_ADLIB, {FM_MONO, 0, 0, -1}, SND_DEFAULT_ENABLE},
667 #endif
669 #if defined(CONFIG_SOUND_VMIDI) && defined(CONFIG_MIDI)
670 {SNDCARD_VMIDI, {0, 0, 0, -1}, SND_DEFAULT_ENABLE},
671 #endif
673 #ifdef CONFIG_SOUND_VIDC
674 { SNDCARD_VIDC, {0, 0, 0, 0}, SND_DEFAULT_ENABLE },
675 #endif
677 #ifdef CONFIG_SOUND_WAVEARTIST
678 { SNDCARD_WAVEARTIST, { CONFIG_WAVEARTIST_BASE, CONFIG_WAVEARTIST_IRQ, CONFIG_WAVEARTIST_DMA, CONFIG_WAVEARTIST_DMA2 }, SND_DEFAULT_ENABLE },
679 #endif
680 {0, {0}, 0}
683 int num_sound_cards = sizeof(snd_installed_cards) / sizeof (struct card_info);
684 static int max_sound_cards = sizeof(snd_installed_cards) / sizeof (struct card_info);
686 #else
687 int num_sound_cards = 0;
688 struct card_info snd_installed_cards[20] = {{0}};
689 static int max_sound_cards = 20;
690 #endif
692 #if defined(MODULE) || (!defined(linux) && !defined(_AIX))
693 int trace_init = 0;
694 #else
695 int trace_init = 1;
696 #endif
698 #else
699 extern struct audio_operations * audio_devs[MAX_AUDIO_DEV]; extern int num_audiodevs;
700 extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
701 extern struct synth_operations * synth_devs[MAX_SYNTH_DEV+MAX_MIDI_DEV]; extern int num_synths;
702 extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
703 extern struct sound_timer_operations * sound_timer_devs[MAX_TIMER_DEV]; extern int num_sound_timers;
705 extern struct driver_info sound_drivers[];
706 extern int num_sound_drivers;
707 extern struct card_info snd_installed_cards[];
708 extern int num_sound_cards;
710 extern int trace_init;
711 #endif /* _DEV_TABLE_C_ */
712 void sndtable_init(void);
713 int sndtable_get_cardcount (void);
714 struct address_info *sound_getconf(int card_type);
715 void sound_chconf(int card_type, int ioaddr, int irq, int dma);
716 int snd_find_driver(int type);
717 void sound_unload_drivers(void);
718 void sound_unload_driver(int type);
719 int sndtable_identify_card(char *name);
720 void sound_setup (char *str, int *ints);
722 extern int sound_map_buffer (int dev, struct dma_buffparms *dmap, buffmem_desc *info);
723 int sndtable_probe (int unit, struct address_info *hw_config);
724 int sndtable_init_card (int unit, struct address_info *hw_config);
725 int sndtable_start_card (int unit, struct address_info *hw_config);
726 void sound_timer_init (struct sound_lowlev_timer *t, char *name);
727 void sound_dma_intr (int dev, struct dma_buffparms *dmap, int chan);
729 #define AUDIO_DRIVER_VERSION 2
730 #define MIXER_DRIVER_VERSION 2
731 int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
732 int driver_size, int flags, unsigned int format_mask,
733 void *devc, int dma1, int dma2);
734 int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
735 int driver_size, void *devc);
737 void sound_unload_audiodev(int dev);
738 void sound_unload_mixerdev(int dev);
739 void sound_unload_mididev(int dev);
740 void sound_unload_synthdev(int dev);
741 void sound_unload_timerdev(int dev);
742 int sound_alloc_audiodev(void);
743 int sound_alloc_mixerdev(void);
744 int sound_alloc_timerdev(void);
745 int sound_alloc_synthdev(void);
746 int sound_alloc_mididev(void);
747 #endif /* _DEV_TABLE_H_ */