Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sound_config.h
Go to the documentation of this file.
1 /* sound_config.h
2  *
3  * A driver for sound cards, misc. configuration parameters.
4  */
5 /*
6  * Copyright (C) by Hannu Savolainen 1993-1997
7  *
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.
11  */
12 
13 
14 #ifndef _SOUND_CONFIG_H_
15 #define _SOUND_CONFIG_H_
16 
17 #include <linux/fs.h>
18 #include <linux/sound.h>
19 
20 #include "os.h"
21 #include "soundvers.h"
22 
23 
24 #ifndef SND_DEFAULT_ENABLE
25 #define SND_DEFAULT_ENABLE 1
26 #endif
27 
28 #ifndef MAX_REALTIME_FACTOR
29 #define MAX_REALTIME_FACTOR 4
30 #endif
31 
32 /*
33  * Use always 64k buffer size. There is no reason to use shorter.
34  */
35 #undef DSP_BUFFSIZE
36 #define DSP_BUFFSIZE (64*1024)
37 
38 #ifndef DSP_BUFFCOUNT
39 #define DSP_BUFFCOUNT 1 /* 1 is recommended. */
40 #endif
41 
42 #define FM_MONO 0x388 /* This is the I/O address used by AdLib */
43 
44 #ifndef CONFIG_PAS_BASE
45 #define CONFIG_PAS_BASE 0x388
46 #endif
47 
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
51 
52 #define SBFM_MAXINSTR (256) /* Size of the FM Instrument bank */
53 /* 128 instruments for general MIDI setup and 16 unassigned */
54 
55 #define SND_NDEVS 256 /* Number of supported devices */
56 
57 #define DSP_DEFAULT_SPEED 8000
58 
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
64 
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 */
78 };
79 
80 #define SYNTH_MAX_VOICES 32
81 
83  int max_voice;
85  int ptr; /* For device specific use */
86  unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
87  int timestamp;
89  };
90 
91 struct channel_info {
92  int pgm_num;
95  unsigned char controllers[128];
96  };
97 
98 /*
99  * Process wakeup reasons
100  */
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
108 
109 #define OPEN_READ PCM_ENABLE_INPUT
110 #define OPEN_WRITE PCM_ENABLE_OUTPUT
111 #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
112 
113 static inline int translate_mode(struct file *file)
114 {
115  if (OPEN_READ == (__force int)FMODE_READ &&
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);
121 }
122 
123 #include "sound_calls.h"
124 #include "dev_table.h"
125 
126 #ifndef DEB
127 #define DEB(x)
128 #endif
129 
130 #ifndef DDB
131 #define DDB(x) do {} while (0)
132 #endif
133 
134 #ifndef MDB
135 #ifdef MODULE
136 #define MDB(x) x
137 #else
138 #define MDB(x)
139 #endif
140 #endif
141 
142 #define TIMER_ARMED 121234
143 #define TIMER_NOT_ARMED 1
144 
145 #define MAX_MEM_BLOCKS 1024
146 
147 #endif