1
2 #ifndef __SOUND_EMU8000_H
3 #define __SOUND_EMU8000_H
4
5
6
7
8
9
10
11 #include <sound/emux_synth.h>
12 #include <sound/seq_kernel.h>
13
14
15
16
17 #define EMU8000_MAX_DRAM (28 * 1024 * 1024)
18 #define EMU8000_DRAM_OFFSET 0x200000
19 #define EMU8000_CHANNELS 32
20 #define EMU8000_DRAM_VOICES 30
21
22
23 #define EMU8000_RAM_READ 0
24 #define EMU8000_RAM_WRITE 1
25 #define EMU8000_RAM_CLOSE 2
26 #define EMU8000_RAM_MODE_MASK 0x03
27 #define EMU8000_RAM_RIGHT 0x10
28
29 enum {
30 EMU8000_CONTROL_BASS = 0,
31 EMU8000_CONTROL_TREBLE,
32 EMU8000_CONTROL_CHORUS_MODE,
33 EMU8000_CONTROL_REVERB_MODE,
34 EMU8000_CONTROL_FM_CHORUS_DEPTH,
35 EMU8000_CONTROL_FM_REVERB_DEPTH,
36 EMU8000_NUM_CONTROLS,
37 };
38
39
40
41
42
43
44
45
46 struct snd_emu8000 {
47
48 struct snd_emux *emu;
49
50 int index;
51 int seq_ports;
52 int fm_chorus_depth;
53 int fm_reverb_depth;
54
55 int mem_size;
56 unsigned long port1;
57 unsigned long port2;
58 unsigned long port3;
59 struct resource *res_port1;
60 struct resource *res_port2;
61 struct resource *res_port3;
62 unsigned short last_reg;
63 spinlock_t reg_lock;
64
65 int dram_checked;
66
67 struct snd_card *card;
68
69 int chorus_mode;
70 int reverb_mode;
71 int bass_level;
72 int treble_level;
73
74 struct snd_util_memhdr *memhdr;
75
76 spinlock_t control_lock;
77 struct snd_kcontrol *controls[EMU8000_NUM_CONTROLS];
78
79 struct snd_pcm *pcm;
80
81 };
82
83
84 #define SNDRV_SEQ_DEV_ID_EMU8000 "emu8000-synth"
85
86
87
88 int snd_emu8000_new(struct snd_card *card, int device, long port, int seq_ports,
89 struct snd_seq_device **ret);
90 void snd_emu8000_poke(struct snd_emu8000 *emu, unsigned int port, unsigned int reg,
91 unsigned int val);
92 unsigned short snd_emu8000_peek(struct snd_emu8000 *emu, unsigned int port,
93 unsigned int reg);
94 void snd_emu8000_poke_dw(struct snd_emu8000 *emu, unsigned int port, unsigned int reg,
95 unsigned int val);
96 unsigned int snd_emu8000_peek_dw(struct snd_emu8000 *emu, unsigned int port,
97 unsigned int reg);
98 void snd_emu8000_dma_chan(struct snd_emu8000 *emu, int ch, int mode);
99
100 void snd_emu8000_init_fm(struct snd_emu8000 *emu);
101
102 void snd_emu8000_update_chorus_mode(struct snd_emu8000 *emu);
103 void snd_emu8000_update_reverb_mode(struct snd_emu8000 *emu);
104 void snd_emu8000_update_equalizer(struct snd_emu8000 *emu);
105 int snd_emu8000_load_chorus_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len);
106 int snd_emu8000_load_reverb_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len);
107
108 #endif