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