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