OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [sound/] [sb_mixer.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
2
 * sound/sb_mixer.h
3
 *
4
 * Definitions for the SB Pro and SB16 mixers
5
 */
6
/*
7
 * Copyright (C) by Hannu Savolainen 1993-1996
8
 *
9
 * USS/Lite for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
10
 * Version 2 (June 1991). See the "COPYING" file distributed with this software
11
 * for more info.
12
 */
13
 
14
/*
15
 * Modified:
16
 *      Hunyue Yau      Jan 6 1994
17
 *      Added defines for the Sound Galaxy NX Pro mixer.
18
 *
19
 */
20
 
21
#define SBPRO_RECORDING_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
22
 
23
/* Same as SB Pro, unless I find otherwise */
24
#define SGNXPRO_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
25
 
26
#define SBPRO_MIXER_DEVICES             (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_LINE | SOUND_MASK_MIC | \
27
                                         SOUND_MASK_CD | SOUND_MASK_VOLUME)
28
 
29
/* SG NX Pro has treble and bass settings on the mixer. The 'speaker'
30
 * channel is the COVOX/DisneySoundSource emulation volume control
31
 * on the mixer. It does NOT control speaker volume. Should have own
32
 * mask eventually?
33
 */
34
#define SGNXPRO_MIXER_DEVICES   (SBPRO_MIXER_DEVICES|SOUND_MASK_BASS| \
35
                                 SOUND_MASK_TREBLE|SOUND_MASK_SPEAKER )
36
 
37
#define SB16_RECORDING_DEVICES          (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \
38
                                         SOUND_MASK_CD)
39
 
40
#define ES688_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
41
#define ES688_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_LINE2|SOUND_MASK_SPEAKER)
42
 
43
#define SB16_MIXER_DEVICES              (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \
44
                                         SOUND_MASK_CD | \
45
                                         SOUND_MASK_IGAIN | SOUND_MASK_OGAIN | \
46
                                         SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE)
47
 
48
/*
49
 * Mixer registers
50
 *
51
 * NOTE!        RECORD_SRC == IN_FILTER
52
 */
53
 
54
/*
55
 * Mixer registers of SB Pro
56
 */
57
#define VOC_VOL         0x04
58
#define MIC_VOL         0x0A
59
#define MIC_MIX         0x0A
60
#define RECORD_SRC      0x0C
61
#define IN_FILTER       0x0C
62
#define OUT_FILTER      0x0E
63
#define MASTER_VOL      0x22
64
#define FM_VOL          0x26
65
#define CD_VOL          0x28
66
#define LINE_VOL        0x2E
67
#define IRQ_NR          0x80
68
#define DMA_NR          0x81
69
#define IRQ_STAT        0x82
70
#define OPSW            0x3c
71
 
72
/*
73
 * Additional registers on the SG NX Pro
74
 */
75
#define COVOX_VOL       0x42
76
#define TREBLE_LVL      0x44
77
#define BASS_LVL        0x46
78
 
79
#define FREQ_HI         (1 << 3)/* Use High-frequency ANFI filters */
80
#define FREQ_LOW        0       /* Use Low-frequency ANFI filters */
81
#define FILT_ON         0       /* Yes, 0 to turn it on, 1 for off */
82
#define FILT_OFF        (1 << 5)
83
 
84
#define MONO_DAC        0x00
85
#define STEREO_DAC      0x02
86
 
87
/*
88
 * Mixer registers of SB16
89
 */
90
#define SB16_IMASK_L    0x3d
91
#define SB16_IMASK_R    0x3e
92
 
93
#define LEFT_CHN        0
94
#define RIGHT_CHN       1
95
 
96
#define MIX_ENT(name, reg_l, bit_l, len_l, reg_r, bit_r, len_r) \
97
        {{reg_l, bit_l, len_l}, {reg_r, bit_r, len_r}}
98
 
99
#ifdef __SB_MIXER_C__
100
mixer_tab sbpro_mix = {
101
MIX_ENT(SOUND_MIXER_VOLUME,     0x22, 7, 4, 0x22, 3, 4),
102
MIX_ENT(SOUND_MIXER_BASS,       0x00, 0, 0, 0x00, 0, 0),
103
MIX_ENT(SOUND_MIXER_TREBLE,     0x00, 0, 0, 0x00, 0, 0),
104
MIX_ENT(SOUND_MIXER_SYNTH,      0x26, 7, 4, 0x26, 3, 4),
105
MIX_ENT(SOUND_MIXER_PCM,        0x04, 7, 4, 0x04, 3, 4),
106
MIX_ENT(SOUND_MIXER_SPEAKER,    0x00, 0, 0, 0x00, 0, 0),
107
MIX_ENT(SOUND_MIXER_LINE,       0x2e, 7, 4, 0x2e, 3, 4),
108
MIX_ENT(SOUND_MIXER_MIC,        0x0a, 2, 3, 0x00, 0, 0),
109
MIX_ENT(SOUND_MIXER_CD,         0x28, 7, 4, 0x28, 3, 4),
110
MIX_ENT(SOUND_MIXER_IMIX,       0x00, 0, 0, 0x00, 0, 0),
111
MIX_ENT(SOUND_MIXER_ALTPCM,     0x00, 0, 0, 0x00, 0, 0),
112
MIX_ENT(SOUND_MIXER_RECLEV,     0x00, 0, 0, 0x00, 0, 0)
113
};
114
mixer_tab es688_mix = {
115
MIX_ENT(SOUND_MIXER_VOLUME,     0x32, 7, 4, 0x32, 3, 4),
116
MIX_ENT(SOUND_MIXER_BASS,       0x00, 0, 0, 0x00, 0, 0),
117
MIX_ENT(SOUND_MIXER_TREBLE,     0x00, 0, 0, 0x00, 0, 0),
118
MIX_ENT(SOUND_MIXER_SYNTH,      0x36, 7, 4, 0x36, 3, 4),
119
MIX_ENT(SOUND_MIXER_PCM,        0x14, 7, 4, 0x14, 3, 4),
120
MIX_ENT(SOUND_MIXER_SPEAKER,    0x3c, 2, 3, 0x00, 0, 0),
121
MIX_ENT(SOUND_MIXER_LINE,       0x3e, 7, 4, 0x3e, 3, 4),
122
MIX_ENT(SOUND_MIXER_MIC,        0x1a, 7, 4, 0x1a, 3, 4),
123
MIX_ENT(SOUND_MIXER_CD,         0x38, 7, 4, 0x38, 3, 4),
124
MIX_ENT(SOUND_MIXER_IMIX,       0x00, 0, 0, 0x00, 0, 0),
125
MIX_ENT(SOUND_MIXER_ALTPCM,     0x00, 0, 0, 0x00, 0, 0),
126
MIX_ENT(SOUND_MIXER_RECLEV,     0x00, 0, 0, 0x00, 0, 0),
127
MIX_ENT(SOUND_MIXER_IGAIN,      0x00, 0, 0, 0x00, 0, 0),
128
MIX_ENT(SOUND_MIXER_OGAIN,      0x00, 0, 0, 0x00, 0, 0),
129
MIX_ENT(SOUND_MIXER_LINE1,      0x00, 0, 0, 0x00, 0, 0),
130
MIX_ENT(SOUND_MIXER_LINE2,      0x3a, 7, 4, 0x3a, 3, 4),
131
MIX_ENT(SOUND_MIXER_LINE3,      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
MIX_ENT(SOUND_MIXER_IGAIN,      0x00, 0, 0, 0x00, 0, 0),
149
MIX_ENT(SOUND_MIXER_OGAIN,      0x00, 0, 0, 0x00, 0, 0)
150
};
151
#endif
152
 
153
mixer_tab sb16_mix = {
154
MIX_ENT(SOUND_MIXER_VOLUME,     0x30, 7, 5, 0x31, 7, 5),
155
MIX_ENT(SOUND_MIXER_BASS,       0x46, 7, 4, 0x47, 7, 4),
156
MIX_ENT(SOUND_MIXER_TREBLE,     0x44, 7, 4, 0x45, 7, 4),
157
MIX_ENT(SOUND_MIXER_SYNTH,      0x34, 7, 5, 0x35, 7, 5),
158
MIX_ENT(SOUND_MIXER_PCM,        0x32, 7, 5, 0x33, 7, 5),
159
MIX_ENT(SOUND_MIXER_SPEAKER,    0x3b, 7, 2, 0x00, 0, 0),
160
MIX_ENT(SOUND_MIXER_LINE,       0x38, 7, 5, 0x39, 7, 5),
161
MIX_ENT(SOUND_MIXER_MIC,        0x3a, 7, 5, 0x00, 0, 0),
162
MIX_ENT(SOUND_MIXER_CD,         0x36, 7, 5, 0x37, 7, 5),
163
MIX_ENT(SOUND_MIXER_IMIX,       0x00, 0, 0, 0x00, 0, 0),
164
MIX_ENT(SOUND_MIXER_ALTPCM,     0x00, 0, 0, 0x00, 0, 0),
165
MIX_ENT(SOUND_MIXER_RECLEV,     0x3f, 7, 2, 0x40, 7, 2), /* Obsolete. Use IGAIN */
166
MIX_ENT(SOUND_MIXER_IGAIN,      0x3f, 7, 2, 0x40, 7, 2),
167
MIX_ENT(SOUND_MIXER_OGAIN,      0x41, 7, 2, 0x42, 7, 2)
168
};
169
 
170
#ifdef SM_GAMES       /* Master volume is lower and PCM & FM volumes
171
                             higher than with SB Pro. This improves the
172
                             sound quality */
173
 
174
static unsigned short default_levels[SOUND_MIXER_NRDEVICES] =
175
{
176
  0x2020,                       /* Master Volume */
177
  0x4b4b,                       /* Bass */
178
  0x4b4b,                       /* Treble */
179
  0x6464,                       /* FM */
180
  0x6464,                       /* PCM */
181
  0x4b4b,                       /* PC Speaker */
182
  0x4b4b,                       /* Ext Line */
183
  0x0000,                       /* Mic */
184
  0x4b4b,                       /* CD */
185
  0x4b4b,                       /* Recording monitor */
186
  0x4b4b,                       /* SB PCM */
187
  0x4b4b,                       /* Recording level */
188
  0x4b4b,                       /* Input gain */
189
  0x4b4b,                       /* Output gain */
190
  0x4040,                       /* Line1 */
191
  0x4040,                       /* Line2 */
192
  0x1515                        /* Line3 */
193
};
194
 
195
#else  /* If the user selected just plain SB Pro */
196
 
197
static unsigned short default_levels[SOUND_MIXER_NRDEVICES] =
198
{
199
  0x5a5a,                       /* Master Volume */
200
  0x4b4b,                       /* Bass */
201
  0x4b4b,                       /* Treble */
202
  0x4b4b,                       /* FM */
203
  0x4b4b,                       /* PCM */
204
  0x4b4b,                       /* PC Speaker */
205
  0x4b4b,                       /* Ext Line */
206
  0x1010,                       /* Mic */
207
  0x4b4b,                       /* CD */
208
  0x4b4b,                       /* Recording monitor */
209
  0x4b4b,                       /* SB PCM */
210
  0x4b4b,                       /* Recording level */
211
  0x4b4b,                       /* Input gain */
212
  0x4b4b,                       /* Output gain */
213
  0x4040,                       /* Line1 */
214
  0x4040,                       /* Line2 */
215
  0x1515                        /* Line3 */
216
};
217
#endif /* SM_GAMES */
218
 
219
static unsigned char sb16_recmasks_L[SOUND_MIXER_NRDEVICES] =
220
{
221
        0x00,   /* SOUND_MIXER_VOLUME   */
222
        0x00,   /* SOUND_MIXER_BASS     */
223
        0x00,   /* SOUND_MIXER_TREBLE   */
224
        0x40,   /* SOUND_MIXER_SYNTH    */
225
        0x00,   /* SOUND_MIXER_PCM      */
226
        0x00,   /* SOUND_MIXER_SPEAKER  */
227
        0x10,   /* SOUND_MIXER_LINE     */
228
        0x01,   /* SOUND_MIXER_MIC      */
229
        0x04,   /* SOUND_MIXER_CD       */
230
        0x00,   /* SOUND_MIXER_IMIX     */
231
        0x00,   /* SOUND_MIXER_ALTPCM   */
232
        0x00,   /* SOUND_MIXER_RECLEV   */
233
        0x00,   /* SOUND_MIXER_IGAIN    */
234
        0x00    /* SOUND_MIXER_OGAIN    */
235
};
236
 
237
static unsigned char sb16_recmasks_R[SOUND_MIXER_NRDEVICES] =
238
{
239
        0x00,   /* SOUND_MIXER_VOLUME   */
240
        0x00,   /* SOUND_MIXER_BASS     */
241
        0x00,   /* SOUND_MIXER_TREBLE   */
242
        0x20,   /* SOUND_MIXER_SYNTH    */
243
        0x00,   /* SOUND_MIXER_PCM      */
244
        0x00,   /* SOUND_MIXER_SPEAKER  */
245
        0x08,   /* SOUND_MIXER_LINE     */
246
        0x01,   /* SOUND_MIXER_MIC      */
247
        0x02,   /* SOUND_MIXER_CD       */
248
        0x00,   /* SOUND_MIXER_IMIX     */
249
        0x00,   /* SOUND_MIXER_ALTPCM   */
250
        0x00,   /* SOUND_MIXER_RECLEV   */
251
        0x00,   /* SOUND_MIXER_IGAIN    */
252
        0x00    /* SOUND_MIXER_OGAIN    */
253
};
254
 
255
static char     smw_mix_regs[] =        /* Left mixer registers */
256
{
257
  0x0b,                         /* SOUND_MIXER_VOLUME */
258
  0x0d,                         /* SOUND_MIXER_BASS */
259
  0x0d,                         /* SOUND_MIXER_TREBLE */
260
  0x05,                         /* SOUND_MIXER_SYNTH */
261
  0x09,                         /* SOUND_MIXER_PCM */
262
  0x00,                         /* SOUND_MIXER_SPEAKER */
263
  0x03,                         /* SOUND_MIXER_LINE */
264
  0x01,                         /* SOUND_MIXER_MIC */
265
  0x07,                         /* SOUND_MIXER_CD */
266
  0x00,                         /* SOUND_MIXER_IMIX */
267
  0x00,                         /* SOUND_MIXER_ALTPCM */
268
  0x00,                         /* SOUND_MIXER_RECLEV */
269
  0x00,                         /* SOUND_MIXER_IGAIN */
270
  0x00,                         /* SOUND_MIXER_OGAIN */
271
  0x00,                         /* SOUND_MIXER_LINE1 */
272
  0x00,                         /* SOUND_MIXER_LINE2 */
273
  0x00                          /* SOUND_MIXER_LINE3 */
274
};
275
 
276
/*
277
 *      Recording sources (SB Pro)
278
 */
279
 
280
#define SRC__MIC         1      /* Select Microphone recording source */
281
#define SRC__CD          3      /* Select CD recording source */
282
#define SRC__LINE        7      /* Use Line-in for recording source */
283
 
284
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.