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 #define SBPRO_RECORDING_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
30
31 #define SBPRO_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_LINE | SOUND_MASK_MIC | \
32 SOUND_MASK_CD | SOUND_MASK_VOLUME)
33
34 #define SB16_RECORDING_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \
35 SOUND_MASK_CD)
36
37 #define SB16_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \
38 SOUND_MASK_CD | SOUND_MASK_RECLEV | \
39 SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE)
40
41
42
43
44
45
46
47
48
49
50 #define VOC_VOL 0x04
51 #define MIC_VOL 0x0A
52 #define MIC_MIX 0x0A
53 #define RECORD_SRC 0x0C
54 #define IN_FILTER 0x0C
55 #define OUT_FILTER 0x0E
56 #define MASTER_VOL 0x22
57 #define FM_VOL 0x26
58 #define CD_VOL 0x28
59 #define LINE_VOL 0x2E
60 #define IRQ_NR 0x80
61 #define DMA_NR 0x81
62 #define IRQ_STAT 0x82
63 #define OPSW 0x3c
64
65 #define FREQ_HI (1 << 3)
66 #define FREQ_LOW 0
67 #define FILT_ON 0
68 #define FILT_OFF (1 << 5)
69
70 #define MONO_DAC 0x00
71 #define STEREO_DAC 0x02
72
73
74
75
76 #define SB16_IMASK_L 0x3d
77 #define SB16_IMASK_R 0x3e
78
79 #define LEFT_CHN 0
80 #define RIGHT_CHN 1
81
82 struct mixer_def {
83 unsigned int regno: 8;
84 unsigned int bitoffs:4;
85 unsigned int nbits:4;
86 };
87
88
89 typedef struct mixer_def mixer_tab[32][2];
90 typedef struct mixer_def mixer_ent;
91
92 #define MIX_ENT(name, reg_l, bit_l, len_l, reg_r, bit_r, len_r) \
93 {{reg_l, bit_l, len_l}, {reg_r, bit_r, len_r}}
94
95 #ifdef __SB_MIXER_C__
96 mixer_tab sbpro_mix = {
97 MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
98 MIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
99 MIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0),
100 MIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
101 MIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
102 MIX_ENT(SOUND_MIXER_SPEAKER, 0x00, 0, 0, 0x00, 0, 0),
103 MIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
104 MIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
105 MIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
106 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
107 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
108 MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0)
109 };
110
111 mixer_tab sb16_mix = {
112 MIX_ENT(SOUND_MIXER_VOLUME, 0x30, 7, 5, 0x31, 7, 5),
113 MIX_ENT(SOUND_MIXER_BASS, 0x46, 7, 4, 0x47, 7, 4),
114 MIX_ENT(SOUND_MIXER_TREBLE, 0x44, 7, 4, 0x45, 7, 4),
115 MIX_ENT(SOUND_MIXER_SYNTH, 0x34, 7, 5, 0x35, 7, 5),
116 MIX_ENT(SOUND_MIXER_PCM, 0x32, 7, 5, 0x33, 7, 5),
117 MIX_ENT(SOUND_MIXER_SPEAKER, 0x3b, 7, 2, 0x00, 0, 0),
118 MIX_ENT(SOUND_MIXER_LINE, 0x38, 7, 5, 0x39, 7, 5),
119 MIX_ENT(SOUND_MIXER_MIC, 0x3a, 7, 5, 0x00, 0, 0),
120 MIX_ENT(SOUND_MIXER_CD, 0x36, 7, 5, 0x37, 7, 5),
121 MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
122 MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
123 MIX_ENT(SOUND_MIXER_RECLEV, 0x3f, 7, 2, 0x40, 7, 2)
124 };
125
126 static unsigned short levels[SOUND_MIXER_NRDEVICES] =
127 {
128 0x5a5a,
129 0x3232,
130 0x3232,
131 0x4b4b,
132 0x4b4b,
133 0x4b4b,
134 0x4b4b,
135 0x0000,
136 0x4b4b,
137 0x4b4b,
138 0x4b4b,
139 0x4b4b};
140
141 static unsigned char sb16_recmasks_L[SOUND_MIXER_NRDEVICES] =
142 {
143 0x00,
144 0x00,
145 0x00,
146 0x40,
147 0x00,
148 0x00,
149 0x10,
150 0x01,
151 0x04,
152 0x00,
153 0x00,
154 0x00
155 };
156
157 static unsigned char sb16_recmasks_R[SOUND_MIXER_NRDEVICES] =
158 {
159 0x00,
160 0x00,
161 0x00,
162 0x20,
163 0x00,
164 0x00,
165 0x08,
166 0x01,
167 0x02,
168 0x00,
169 0x00,
170 0x00
171 };
172 #endif