0001
0002 #ifndef __SOUND_EMU8000_H
0003 #define __SOUND_EMU8000_H
0004
0005
0006
0007
0008
0009
0010
0011 #include <sound/emux_synth.h>
0012 #include <sound/seq_kernel.h>
0013
0014
0015
0016
0017 #define EMU8000_MAX_DRAM (28 * 1024 * 1024)
0018 #define EMU8000_DRAM_OFFSET 0x200000
0019 #define EMU8000_CHANNELS 32
0020 #define EMU8000_DRAM_VOICES 30
0021
0022
0023 #define EMU8000_RAM_READ 0
0024 #define EMU8000_RAM_WRITE 1
0025 #define EMU8000_RAM_CLOSE 2
0026 #define EMU8000_RAM_MODE_MASK 0x03
0027 #define EMU8000_RAM_RIGHT 0x10
0028
0029 enum {
0030 EMU8000_CONTROL_BASS = 0,
0031 EMU8000_CONTROL_TREBLE,
0032 EMU8000_CONTROL_CHORUS_MODE,
0033 EMU8000_CONTROL_REVERB_MODE,
0034 EMU8000_CONTROL_FM_CHORUS_DEPTH,
0035 EMU8000_CONTROL_FM_REVERB_DEPTH,
0036 EMU8000_NUM_CONTROLS,
0037 };
0038
0039
0040
0041
0042
0043
0044
0045
0046 struct snd_emu8000 {
0047
0048 struct snd_emux *emu;
0049
0050 int index;
0051 int seq_ports;
0052 int fm_chorus_depth;
0053 int fm_reverb_depth;
0054
0055 int mem_size;
0056 unsigned long port1;
0057 unsigned long port2;
0058 unsigned long port3;
0059 unsigned short last_reg;
0060 spinlock_t reg_lock;
0061
0062 int dram_checked;
0063
0064 struct snd_card *card;
0065
0066 int chorus_mode;
0067 int reverb_mode;
0068 int bass_level;
0069 int treble_level;
0070
0071 struct snd_util_memhdr *memhdr;
0072
0073 spinlock_t control_lock;
0074 struct snd_kcontrol *controls[EMU8000_NUM_CONTROLS];
0075
0076 struct snd_pcm *pcm;
0077
0078 };
0079
0080
0081 #define SNDRV_SEQ_DEV_ID_EMU8000 "emu8000-synth"
0082
0083
0084
0085 int snd_emu8000_new(struct snd_card *card, int device, long port, int seq_ports,
0086 struct snd_seq_device **ret);
0087 void snd_emu8000_poke(struct snd_emu8000 *emu, unsigned int port, unsigned int reg,
0088 unsigned int val);
0089 unsigned short snd_emu8000_peek(struct snd_emu8000 *emu, unsigned int port,
0090 unsigned int reg);
0091 void snd_emu8000_poke_dw(struct snd_emu8000 *emu, unsigned int port, unsigned int reg,
0092 unsigned int val);
0093 unsigned int snd_emu8000_peek_dw(struct snd_emu8000 *emu, unsigned int port,
0094 unsigned int reg);
0095 void snd_emu8000_dma_chan(struct snd_emu8000 *emu, int ch, int mode);
0096
0097 void snd_emu8000_init_fm(struct snd_emu8000 *emu);
0098
0099 void snd_emu8000_update_chorus_mode(struct snd_emu8000 *emu);
0100 void snd_emu8000_update_reverb_mode(struct snd_emu8000 *emu);
0101 void snd_emu8000_update_equalizer(struct snd_emu8000 *emu);
0102 int snd_emu8000_load_chorus_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len);
0103 int snd_emu8000_load_reverb_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len);
0104
0105 #endif