mm: improve page_lock_anon_vma() comment
[linux-2.6.git] / sound / oss / sound_config.h
blob9d35c4c65b9b0f0f4eb8f1026f89344ae8528415
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 static inline int translate_mode(struct file *file)
115 if (OPEN_READ == (__force int)FMODE_READ &&
116 OPEN_WRITE == (__force int)FMODE_WRITE)
117 return (__force int)(file->f_mode & (FMODE_READ | FMODE_WRITE));
118 else
119 return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) |
120 ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0);
123 #include "sound_calls.h"
124 #include "dev_table.h"
126 #ifndef DEB
127 #define DEB(x)
128 #endif
130 #ifndef DDB
131 #define DDB(x) do {} while (0)
132 #endif
134 #ifndef MDB
135 #ifdef MODULE
136 #define MDB(x) x
137 #else
138 #define MDB(x)
139 #endif
140 #endif
142 #define TIMER_ARMED 121234
143 #define TIMER_NOT_ARMED 1
145 #define MAX_MEM_BLOCKS 1024
147 #endif