1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #define SBPRO_RECORDING_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
35
36
37 #define SGNXPRO_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
38
39 #define SBPRO_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_LINE | SOUND_MASK_MIC | \
40 SOUND_MASK_CD | SOUND_MASK_VOLUME)
41
42
43
44
45
46
47 #define SGNXPRO_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_BASS| \
48 SOUND_MASK_TREBLE|SOUND_MASK_SPEAKER )
49
50 #define SB16_RECORDING_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \
51 SOUND_MASK_CD)
52
53 #define ES688_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
54 #define ES688_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_LINE2|SOUND_MASK_SPEAKER)
55
56 #define SB16_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \
57 SOUND_MASK_CD | \
58 SOUND_MASK_IGAIN | SOUND_MASK_OGAIN | \
59 SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE)
60
61
62
63
64
65
66
67
68
69
70 #define VOC_VOL 0x04
71 #define MIC_VOL 0x0A
72 #define MIC_MIX 0x0A
73 #define RECORD_SRC 0x0C
74 #define IN_FILTER 0x0C
75 #define OUT_FILTER 0x0E
76 #define MASTER_VOL 0x22
77 #define FM_VOL 0x26
78 #define CD_VOL 0x28
79 #define LINE_VOL 0x2E
80 #define IRQ_NR 0x80
81 #define DMA_NR 0x81
82 #define IRQ_STAT 0x82
83 #define OPSW 0x3c
84
85
86
87
88 #define COVOX_VOL 0x42
89 #define TREBLE_LVL 0x44
90 #define BASS_LVL 0x46
91
92 #define FREQ_HI (1 << 3)
93 #define FREQ_LOW 0
94 #define FILT_ON 0
95 #define FILT_OFF (1 << 5)
96
97 #define MONO_DAC 0x00
98 #define STEREO_DAC 0x02
99
100
101
102
103 #define SB16_IMASK_L 0x3d
104 #define SB16_IMASK_R 0x3e
105
106 #define LEFT_CHN 0
107 #define RIGHT_CHN 1
108
109 struct mixer_def {
110 unsigned int regno: 8;
111 unsigned int bitoffs:4;
112 unsigned int nbits:4;
113 };
114
115
116 typedef struct mixer_def mixer_tab[32][2];
117 typedef struct mixer_def mixer_ent;
118
119 #define MIX_ENT(name, reg_l, bit_l, len_l, reg_r, bit_r, len_r) \
120 {{reg_l, bit_l, len_l}, {reg_r, bit_r, len_r}}
121
122 #ifdef __SB_MIXER_C__
123 mixer_tab sbpro_mix = {
124 MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
125 MIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
126 MIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0),
127 MIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
128 MIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
129 MIX_ENT(SOUND_MIXER_SPEAKER, 0x00, 0, 0, 0x00, 0, 0),
130 MIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
131 MIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
132 MIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
133 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
134 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
135 MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0)
136 };
137 mixer_tab es688_mix = {
138 MIX_ENT(SOUND_MIXER_VOLUME, 0x32, 7, 4, 0x32, 3, 4),
139 MIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
140 MIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0),
141 MIX_ENT(SOUND_MIXER_SYNTH, 0x36, 7, 4, 0x36, 3, 4),
142 MIX_ENT(SOUND_MIXER_PCM, 0x14, 7, 4, 0x14, 3, 4),
143 MIX_ENT(SOUND_MIXER_SPEAKER, 0x3c, 2, 3, 0x00, 0, 0),
144 MIX_ENT(SOUND_MIXER_LINE, 0x3e, 7, 4, 0x3e, 3, 4),
145 MIX_ENT(SOUND_MIXER_MIC, 0x1a, 7, 4, 0x1a, 3, 4),
146 MIX_ENT(SOUND_MIXER_CD, 0x38, 7, 4, 0x38, 3, 4),
147 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
148 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
149 MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0),
150 MIX_ENT(SOUND_MIXER_IGAIN, 0x00, 0, 0, 0x00, 0, 0),
151 MIX_ENT(SOUND_MIXER_OGAIN, 0x00, 0, 0, 0x00, 0, 0),
152 MIX_ENT(SOUND_MIXER_LINE1, 0x00, 0, 0, 0x00, 0, 0),
153 MIX_ENT(SOUND_MIXER_LINE2, 0x3a, 7, 4, 0x3a, 3, 4),
154 MIX_ENT(SOUND_MIXER_LINE3, 0x00, 0, 0, 0x00, 0, 0)
155 };
156
157 #ifdef __SGNXPRO__
158 mixer_tab sgnxpro_mix = {
159 MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
160 MIX_ENT(SOUND_MIXER_BASS, 0x46, 2, 3, 0x00, 0, 0),
161 MIX_ENT(SOUND_MIXER_TREBLE, 0x44, 2, 3, 0x00, 0, 0),
162 MIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
163 MIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
164 MIX_ENT(SOUND_MIXER_SPEAKER, 0x42, 2, 3, 0x00, 0, 0),
165 MIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
166 MIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
167 MIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
168 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
169 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
170 MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0),
171 MIX_ENT(SOUND_MIXER_IGAIN, 0x00, 0, 0, 0x00, 0, 0),
172 MIX_ENT(SOUND_MIXER_OGAIN, 0x00, 0, 0, 0x00, 0, 0)
173 };
174 #endif
175
176 mixer_tab sb16_mix = {
177 MIX_ENT(SOUND_MIXER_VOLUME, 0x30, 7, 5, 0x31, 7, 5),
178 MIX_ENT(SOUND_MIXER_BASS, 0x46, 7, 4, 0x47, 7, 4),
179 MIX_ENT(SOUND_MIXER_TREBLE, 0x44, 7, 4, 0x45, 7, 4),
180 MIX_ENT(SOUND_MIXER_SYNTH, 0x34, 7, 5, 0x35, 7, 5),
181 MIX_ENT(SOUND_MIXER_PCM, 0x32, 7, 5, 0x33, 7, 5),
182 MIX_ENT(SOUND_MIXER_SPEAKER, 0x3b, 7, 2, 0x00, 0, 0),
183 MIX_ENT(SOUND_MIXER_LINE, 0x38, 7, 5, 0x39, 7, 5),
184 MIX_ENT(SOUND_MIXER_MIC, 0x3a, 7, 5, 0x00, 0, 0),
185 MIX_ENT(SOUND_MIXER_CD, 0x36, 7, 5, 0x37, 7, 5),
186 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
187 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
188 MIX_ENT(SOUND_MIXER_RECLEV, 0x3f, 7, 2, 0x40, 7, 2),
189 MIX_ENT(SOUND_MIXER_IGAIN, 0x3f, 7, 2, 0x40, 7, 2),
190 MIX_ENT(SOUND_MIXER_OGAIN, 0x41, 7, 2, 0x42, 7, 2)
191 };
192
193 #ifdef SM_GAMES
194
195
196
197 static unsigned short levels[SOUND_MIXER_NRDEVICES] =
198 {
199 0x2020,
200 0x4b4b,
201 0x4b4b,
202 0x6464,
203 0x6464,
204 0x4b4b,
205 0x4b4b,
206 0x0000,
207 0x4b4b,
208 0x4b4b,
209 0x4b4b,
210 0x4b4b,
211 0x4b4b,
212 0x4b4b,
213 0x4040,
214 0x4040,
215 0x1515
216
217 #else
218
219 static unsigned short levels[SOUND_MIXER_NRDEVICES] =
220 {
221 0x5a5a,
222 0x4b4b,
223 0x4b4b,
224 0x4b4b,
225 0x4b4b,
226 0x4b4b,
227 0x4b4b,
228 0x1010,
229 0x4b4b,
230 0x4b4b,
231 0x4b4b,
232 0x4b4b,
233 0x4b4b,
234 0x4b4b,
235 0x4040,
236 0x4040,
237 0x1515
238 };
239 #endif
240
241 static unsigned char sb16_recmasks_L[SOUND_MIXER_NRDEVICES] =
242 {
243 0x00,
244 0x00,
245 0x00,
246 0x40,
247 0x00,
248 0x00,
249 0x10,
250 0x01,
251 0x04,
252 0x00,
253 0x00,
254 0x00,
255 0x00,
256 0x00
257 };
258
259 static unsigned char sb16_recmasks_R[SOUND_MIXER_NRDEVICES] =
260 {
261 0x00,
262 0x00,
263 0x00,
264 0x20,
265 0x00,
266 0x00,
267 0x08,
268 0x01,
269 0x02,
270 0x00,
271 0x00,
272 0x00,
273 0x00,
274 0x00
275 };
276
277
278
279
280
281 #define SRC_MIC 1
282 #define SRC_CD 3
283 #define SRC_LINE 7
284
285 #endif