v2.6.22.24-op1
[linux-2.6.22.y-op.git] / sound / oss / sound_config.h
blob1a00a3210616231f7c271fe2f621d8a29c21b27c
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/fs.h>
18 #include <linux/sound.h>
20 #include "os.h"
21 #include "soundvers.h"
24 #ifndef SND_DEFAULT_ENABLE
25 #define SND_DEFAULT_ENABLE 1
26 #endif
28 #ifndef MAX_REALTIME_FACTOR
29 #define MAX_REALTIME_FACTOR 4
30 #endif
33 * Use always 64k buffer size. There is no reason to use shorter.
35 #undef DSP_BUFFSIZE
36 #define DSP_BUFFSIZE (64*1024)
38 #ifndef DSP_BUFFCOUNT
39 #define DSP_BUFFCOUNT 1 /* 1 is recommended. */
40 #endif
42 #define FM_MONO 0x388 /* This is the I/O address used by AdLib */
44 #ifndef CONFIG_PAS_BASE
45 #define CONFIG_PAS_BASE 0x388
46 #endif
48 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
49 driver. (There is no need to alter this) */
50 #define SEQ_MAX_QUEUE 1024
52 #define SBFM_MAXINSTR (256) /* Size of the FM Instrument bank */
53 /* 128 instruments for general MIDI setup and 16 unassigned */
55 #define SND_NDEVS 256 /* Number of supported devices */
57 #define DSP_DEFAULT_SPEED 8000
59 #define MAX_AUDIO_DEV 5
60 #define MAX_MIXER_DEV 5
61 #define MAX_SYNTH_DEV 5
62 #define MAX_MIDI_DEV 6
63 #define MAX_TIMER_DEV 4
65 struct address_info {
66 int io_base;
67 int irq;
68 int dma;
69 int dma2;
70 int always_detect; /* 1=Trust me, it's there */
71 char *name;
72 int driver_use_1; /* Driver defined field 1 */
73 int driver_use_2; /* Driver defined field 2 */
74 int *osp; /* OS specific info */
75 int card_subtype; /* Driver specific. Usually 0 */
76 void *memptr; /* Module memory chainer */
77 int slots[6]; /* To remember driver slot ids */
80 #define SYNTH_MAX_VOICES 32
82 struct voice_alloc_info {
83 int max_voice;
84 int used_voices;
85 int ptr; /* For device specific use */
86 unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
87 int timestamp;
88 int alloc_times[SYNTH_MAX_VOICES];
91 struct channel_info {
92 int pgm_num;
93 int bender_value;
94 int bender_range;
95 unsigned char controllers[128];
99 * Process wakeup reasons
101 #define WK_NONE 0x00
102 #define WK_WAKEUP 0x01
103 #define WK_TIMEOUT 0x02
104 #define WK_SIGNAL 0x04
105 #define WK_SLEEP 0x08
106 #define WK_SELECT 0x10
107 #define WK_ABORT 0x20
109 #define OPEN_READ PCM_ENABLE_INPUT
110 #define OPEN_WRITE PCM_ENABLE_OUTPUT
111 #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
113 #if OPEN_READ == FMODE_READ && OPEN_WRITE == FMODE_WRITE
115 static inline int translate_mode(struct file *file)
117 return file->f_mode;
120 #else
122 static inline int translate_mode(struct file *file)
124 return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) |
125 ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0);
128 #endif
131 #include "sound_calls.h"
132 #include "dev_table.h"
134 #ifndef DEB
135 #define DEB(x)
136 #endif
138 #ifndef DDB
139 #define DDB(x) do {} while (0)
140 #endif
142 #ifndef MDB
143 #ifdef MODULE
144 #define MDB(x) x
145 #else
146 #define MDB(x)
147 #endif
148 #endif
150 #define TIMER_ARMED 121234
151 #define TIMER_NOT_ARMED 1
153 #endif