15 #include <linux/types.h>
21 #define SND_DEV_MIDIN 2
23 #define SND_DEV_AUDIO 4
24 #define SND_DEV_DSP16 5
25 #define SND_DEV_STATUS 6
27 #define SND_DEV_SEQ2 8
28 #define SND_DEV_SNDPROC 9
29 #define SND_DEV_PSS SND_DEV_SNDPROC
32 #define DEBUG_DMASOUND 1
34 #define MAX_AUDIO_DEV 5
35 #define MAX_MIXER_DEV 4
36 #define MAX_SYNTH_DEV 3
37 #define MAX_MIDI_DEV 6
38 #define MAX_TIMER_DEV 3
40 #define MAX_CATCH_RADIUS 10
42 #define le2be16(x) (((x)<<8 & 0xff00) | ((x)>>8 & 0x00ff))
43 #define le2be16dbl(x) (((x)<<8 & 0xff00ff00) | ((x)>>8 & 0x00ff00ff))
45 #define IOCTL_IN(arg, ret) \
46 do { int error = get_user(ret, (int __user *)(arg)); \
47 if (error) return error; \
49 #define IOCTL_OUT(arg, ret) ioctl_return((int __user *)(arg), ret)
51 static inline int ioctl_return(
int __user *
addr,
int value)
53 return value < 0 ? value :
put_user(value, addr);
61 #undef HAS_8BIT_TABLES
63 #if defined(CONFIG_DMASOUND_ATARI) || defined(CONFIG_DMASOUND_ATARI_MODULE) ||\
64 defined(CONFIG_DMASOUND_PAULA) || defined(CONFIG_DMASOUND_PAULA_MODULE) ||\
65 defined(CONFIG_DMASOUND_Q40) || defined(CONFIG_DMASOUND_Q40_MODULE)
66 #define HAS_8BIT_TABLES
68 #define MIN_BUFSIZE (1<<12)
69 #define MIN_FRAG_SIZE 8
70 #define MAX_BUFSIZE (1<<17)
71 #define MAX_FRAG_SIZE 15
76 #define MIN_BUFSIZE (1<<8)
77 #define MIN_FRAG_SIZE 8
78 #define MAX_BUFSIZE (1<<18)
79 #define MAX_FRAG_SIZE 16
82 #define DEFAULT_N_BUFFERS 4
83 #define DEFAULT_BUFF_SIZE (1<<15)
93 #define dmasound_deinit() do { } while (0)
177 #ifdef HAS_8BIT_TABLES
178 extern char dmasound_ulaw2dma8[];
179 extern char dmasound_alaw2dma8[];
186 static inline int dmasound_set_volume(
int volume)
188 return dmasound.mach.setVolume(volume);
191 static inline int dmasound_set_bass(
int bass)
196 static inline int dmasound_set_treble(
int treble)
201 static inline int dmasound_set_gain(
int gain)
242 #define SLEEP(queue) interruptible_sleep_on_timeout(&queue, HZ)
243 #define WAKE_UP(queue) (wake_up_interruptible(&queue))
246 #define write_sq dmasound_write_sq
249 #define catchRadius dmasound_catchRadius
256 #define SW_INPUT_VOLUME_SCALE 4
257 #define SW_INPUT_VOLUME_DEFAULT (128 / SW_INPUT_VOLUME_SCALE)