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 SB16_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \
54 SOUND_MASK_CD | SOUND_MASK_RECLEV | \
55 SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE)
56
57
58
59
60
61
62
63
64
65
66 #define VOC_VOL 0x04
67 #define MIC_VOL 0x0A
68 #define MIC_MIX 0x0A
69 #define RECORD_SRC 0x0C
70 #define IN_FILTER 0x0C
71 #define OUT_FILTER 0x0E
72 #define MASTER_VOL 0x22
73 #define FM_VOL 0x26
74 #define CD_VOL 0x28
75 #define LINE_VOL 0x2E
76 #define IRQ_NR 0x80
77 #define DMA_NR 0x81
78 #define IRQ_STAT 0x82
79 #define OPSW 0x3c
80
81
82
83
84 #define COVOX_VOL 0x42
85 #define TREBLE_LVL 0x44
86 #define BASS_LVL 0x46
87
88 #define FREQ_HI (1 << 3)
89 #define FREQ_LOW 0
90 #define FILT_ON 0
91 #define FILT_OFF (1 << 5)
92
93 #define MONO_DAC 0x00
94 #define STEREO_DAC 0x02
95
96
97
98
99 #define SB16_IMASK_L 0x3d
100 #define SB16_IMASK_R 0x3e
101
102 #define LEFT_CHN 0
103 #define RIGHT_CHN 1
104
105 struct mixer_def {
106 unsigned int regno: 8;
107 unsigned int bitoffs:4;
108 unsigned int nbits:4;
109 };
110
111
112 typedef struct mixer_def mixer_tab[32][2];
113 typedef struct mixer_def mixer_ent;
114
115 #define MIX_ENT(name, reg_l, bit_l, len_l, reg_r, bit_r, len_r) \
116 {{reg_l, bit_l, len_l}, {reg_r, bit_r, len_r}}
117
118 #ifdef __SB_MIXER_C__
119 mixer_tab sbpro_mix = {
120 MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
121 MIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
122 MIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0),
123 MIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
124 MIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
125 MIX_ENT(SOUND_MIXER_SPEAKER, 0x00, 0, 0, 0x00, 0, 0),
126 MIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
127 MIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
128 MIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
129 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
130 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
131 MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0)
132 };
133
134 #ifdef __SGNXPRO__
135 mixer_tab sgnxpro_mix = {
136 MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
137 MIX_ENT(SOUND_MIXER_BASS, 0x46, 2, 3, 0x00, 0, 0),
138 MIX_ENT(SOUND_MIXER_TREBLE, 0x44, 2, 3, 0x00, 0, 0),
139 MIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
140 MIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
141 MIX_ENT(SOUND_MIXER_SPEAKER, 0x42, 2, 3, 0x00, 0, 0),
142 MIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
143 MIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
144 MIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
145 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
146 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
147 MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0)
148 };
149 #endif
150
151 mixer_tab sb16_mix = {
152 MIX_ENT(SOUND_MIXER_VOLUME, 0x30, 7, 5, 0x31, 7, 5),
153 MIX_ENT(SOUND_MIXER_BASS, 0x46, 7, 4, 0x47, 7, 4),
154 MIX_ENT(SOUND_MIXER_TREBLE, 0x44, 7, 4, 0x45, 7, 4),
155 MIX_ENT(SOUND_MIXER_SYNTH, 0x34, 7, 5, 0x35, 7, 5),
156 MIX_ENT(SOUND_MIXER_PCM, 0x32, 7, 5, 0x33, 7, 5),
157 MIX_ENT(SOUND_MIXER_SPEAKER, 0x3b, 7, 2, 0x00, 0, 0),
158 MIX_ENT(SOUND_MIXER_LINE, 0x38, 7, 5, 0x39, 7, 5),
159 MIX_ENT(SOUND_MIXER_MIC, 0x3a, 7, 5, 0x00, 0, 0),
160 MIX_ENT(SOUND_MIXER_CD, 0x36, 7, 5, 0x37, 7, 5),
161 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
162 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
163 MIX_ENT(SOUND_MIXER_RECLEV, 0x3f, 7, 2, 0x40, 7, 2)
164 };
165
166 static unsigned short levels[SOUND_MIXER_NRDEVICES] =
167 {
168 0x5a5a,
169 0x3232,
170 0x3232,
171 0x4b4b,
172 0x4b4b,
173 0x4b4b,
174 0x4b4b,
175 0x0000,
176 0x4b4b,
177 0x4b4b,
178 0x4b4b,
179 0x4b4b};
180
181 static unsigned char sb16_recmasks_L[SOUND_MIXER_NRDEVICES] =
182 {
183 0x00,
184 0x00,
185 0x00,
186 0x40,
187 0x00,
188 0x00,
189 0x10,
190 0x01,
191 0x04,
192 0x00,
193 0x00,
194 0x00
195 };
196
197 static unsigned char sb16_recmasks_R[SOUND_MIXER_NRDEVICES] =
198 {
199 0x00,
200 0x00,
201 0x00,
202 0x20,
203 0x00,
204 0x00,
205 0x08,
206 0x01,
207 0x02,
208 0x00,
209 0x00,
210 0x00
211 };
212
213
214
215
216
217 #define SRC_MIC 1
218 #define SRC_CD 3
219 #define SRC_LINE 7
220
221 #endif