[IRDA]: Avoid a label defined but not used warning in irda_init()
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / sound / usb / usbmixer_maps.c
blob7c4dcb3f436af09f3afa0e0ae88a6612d7edd503
1 /*
2 * Additional mixer mapping
4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 struct usbmix_name_map {
24 int id;
25 const char *name;
26 int control;
29 struct usbmix_selector_map {
30 int id;
31 int count;
32 const char **names;
35 struct usbmix_ctl_map {
36 u32 id;
37 const struct usbmix_name_map *map;
38 const struct usbmix_selector_map *selector_map;
39 int ignore_ctl_error;
43 * USB control mappers for SB Exitigy
47 * Topology of SB Extigy (see on the wide screen :)
49 USB_IN[1] --->FU[2]------------------------------+->MU[16]-->PU[17]-+->FU[18]--+->EU[27]--+->EU[21]-->FU[22]--+->FU[23] > Dig_OUT[24]
50 ^ | | | |
51 USB_IN[3] -+->SU[5]-->FU[6]--+->MU[14] ->PU[15]->+ | | | +->FU[25] > Dig_OUT[26]
52 ^ ^ | | | |
53 Dig_IN[4] -+ | | | | +->FU[28]---------------------> Spk_OUT[19]
54 | | | |
55 Lin-IN[7] -+-->FU[8]---------+ | | +----------------------------------------> Hph_OUT[20]
56 | | |
57 Mic-IN[9] --+->FU[10]----------------------------+ |
58 || |
59 || +----------------------------------------------------+
60 VV V
61 ++--+->SU[11]-->FU[12] --------------------------------------------------------------------------------------> USB_OUT[13]
64 static struct usbmix_name_map extigy_map[] = {
65 /* 1: IT pcm */
66 { 2, "PCM Playback" }, /* FU */
67 /* 3: IT pcm */
68 /* 4: IT digital in */
69 { 5, NULL }, /* DISABLED: this seems to be bogus on some firmware */
70 { 6, "Digital In" }, /* FU */
71 /* 7: IT line */
72 { 8, "Line Playback" }, /* FU */
73 /* 9: IT mic */
74 { 10, "Mic Playback" }, /* FU */
75 { 11, "Capture Input Source" }, /* SU */
76 { 12, "Capture" }, /* FU */
77 /* 13: OT pcm capture */
78 /* 14: MU (w/o controls) */
79 /* 15: PU (3D enh) */
80 /* 16: MU (w/o controls) */
81 { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */
82 { 17, "Channel Routing", 2 }, /* PU: mode select */
83 { 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */
84 { 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */
85 { 18, "Master Playback" }, /* FU; others */
86 /* 19: OT speaker */
87 /* 20: OT headphone */
88 { 21, NULL }, /* DISABLED: EU (for what?) */
89 { 22, "Digital Out Playback" }, /* FU */
90 { 23, "Digital Out1 Playback" }, /* FU */ /* FIXME: corresponds to 24 */
91 /* 24: OT digital out */
92 { 25, "IEC958 Optical Playback" }, /* FU */
93 { 26, "IEC958 Optical Playback" }, /* OT */
94 { 27, NULL }, /* DISABLED: EU (for what?) */
95 /* 28: FU speaker (mute) */
96 { 29, NULL }, /* Digital Input Playback Source? */
97 { 0 } /* terminator */
100 /* Sound Blaster MP3+ controls mapping
101 * The default mixer channels have totally misleading names,
102 * e.g. no Master and fake PCM volume
103 * Pavel Mihaylov <bin@bash.info>
105 static struct usbmix_name_map mp3plus_map[] = {
106 /* 1: IT pcm */
107 /* 2: IT mic */
108 /* 3: IT line */
109 /* 4: IT digital in */
110 /* 5: OT digital out */
111 /* 6: OT speaker */
112 /* 7: OT pcm capture */
113 { 8, "Capture Input Source" }, /* FU, default PCM Capture Source */
114 /* (Mic, Input 1 = Line input, Input 2 = Optical input) */
115 { 9, "Master Playback" }, /* FU, default Speaker 1 */
116 /* { 10, "Mic Capture", 1 }, */ /* FU, Mic Capture */
117 /* { 10, "Mic Capture", 2 }, */ /* FU, Mic Capture */
118 { 10, "Mic Boost", 7 }, /* FU, default Auto Gain Input */
119 { 11, "Line Capture" }, /* FU, default PCM Capture */
120 { 12, "Digital In Playback" }, /* FU, default PCM 1 */
121 /* { 13, "Mic Playback" }, */ /* FU, default Mic Playback */
122 { 14, "Line Playback" }, /* FU, default Speaker */
123 /* 15: MU */
124 { 0 } /* terminator */
127 /* Topology of SB Audigy 2 NX
129 +----------------------------->EU[27]--+
131 | +----------------------------------->SU[29]---->FU[22]-->Dig_OUT[24]
132 | | ^
133 USB_IN[1]-+------------+ +->EU[17]->+->FU[11]-+
134 | v | v |
135 Dig_IN[4]---+->FU[6]-->MU[16]->FU[18]-+->EU[21]->SU[31]----->FU[30]->Hph_OUT[20]
136 | ^ | |
137 Lin_IN[7]-+--->FU[8]---+ +->EU[23]->FU[28]------------->Spk_OUT[19]
138 | | v
139 +--->FU[12]------------------------------------->SU[14]--->USB_OUT[15]
141 +->FU[13]--------------------------------------+
143 static struct usbmix_name_map audigy2nx_map[] = {
144 /* 1: IT pcm playback */
145 /* 4: IT digital in */
146 { 6, "Digital In Playback" }, /* FU */
147 /* 7: IT line in */
148 { 8, "Line Playback" }, /* FU */
149 { 11, "What-U-Hear Capture" }, /* FU */
150 { 12, "Line Capture" }, /* FU */
151 { 13, "Digital In Capture" }, /* FU */
152 { 14, "Capture Source" }, /* SU */
153 /* 15: OT pcm capture */
154 /* 16: MU w/o controls */
155 { 17, NULL }, /* DISABLED: EU (for what?) */
156 { 18, "Master Playback" }, /* FU */
157 /* 19: OT speaker */
158 /* 20: OT headphone */
159 { 21, NULL }, /* DISABLED: EU (for what?) */
160 { 22, "Digital Out Playback" }, /* FU */
161 { 23, NULL }, /* DISABLED: EU (for what?) */
162 /* 24: OT digital out */
163 { 27, NULL }, /* DISABLED: EU (for what?) */
164 { 28, "Speaker Playback" }, /* FU */
165 { 29, "Digital Out Source" }, /* SU */
166 { 30, "Headphone Playback" }, /* FU */
167 { 31, "Headphone Source" }, /* SU */
168 { 0 } /* terminator */
171 static struct usbmix_selector_map audigy2nx_selectors[] = {
173 .id = 14, /* Capture Source */
174 .count = 3,
175 .names = (const char*[]) {"Line", "Digital In", "What-U-Hear"}
178 .id = 29, /* Digital Out Source */
179 .count = 3,
180 .names = (const char*[]) {"Front", "PCM", "Digital In"}
183 .id = 31, /* Headphone Source */
184 .count = 2,
185 .names = (const char*[]) {"Front", "Side"}
187 { 0 } /* terminator */
190 /* LineX FM Transmitter entry - needed to bypass controls bug */
191 static struct usbmix_name_map linex_map[] = {
192 /* 1: IT pcm */
193 /* 2: OT Speaker */
194 { 3, "Master" }, /* FU: master volume - left / right / mute */
195 { 0 } /* terminator */
198 static struct usbmix_name_map maya44_map[] = {
199 /* 1: IT line */
200 { 2, "Line Playback" }, /* FU */
201 /* 3: IT line */
202 { 4, "Line Playback" }, /* FU */
203 /* 5: IT pcm playback */
204 /* 6: MU */
205 { 7, "Master Playback" }, /* FU */
206 /* 8: OT speaker */
207 /* 9: IT line */
208 { 10, "Line Capture" }, /* FU */
209 /* 11: MU */
210 /* 12: OT pcm capture */
214 /* Section "justlink_map" below added by James Courtier-Dutton <James@superbug.demon.co.uk>
215 * sourced from Maplin Electronics (http://www.maplin.co.uk), part number A56AK
216 * Part has 2 connectors that act as a single output. (TOSLINK Optical for digital out, and 3.5mm Jack for Analogue out.)
217 * The USB Mixer publishes a Microphone and extra Volume controls for it, but none exist on the device,
218 * so this map removes all unwanted sliders from alsamixer
221 static struct usbmix_name_map justlink_map[] = {
222 /* 1: IT pcm playback */
223 /* 2: Not present */
224 { 3, NULL}, /* IT mic (No mic input on device) */
225 /* 4: Not present */
226 /* 5: OT speacker */
227 /* 6: OT pcm capture */
228 { 7, "Master Playback" }, /* Mute/volume for speaker */
229 { 8, NULL }, /* Capture Switch (No capture inputs on device) */
230 { 9, NULL }, /* Capture Mute/volume (No capture inputs on device */
231 /* 0xa: Not present */
232 /* 0xb: MU (w/o controls) */
233 { 0xc, NULL }, /* Mic feedback Mute/volume (No capture inputs on device) */
234 { 0 } /* terminator */
237 /* TerraTec Aureon 5.1 MkII USB */
238 static struct usbmix_name_map aureon_51_2_map[] = {
239 /* 1: IT USB */
240 /* 2: IT Mic */
241 /* 3: IT Line */
242 /* 4: IT SPDIF */
243 /* 5: OT SPDIF */
244 /* 6: OT Speaker */
245 /* 7: OT USB */
246 { 8, "Capture Source" }, /* SU */
247 { 9, "Master Playback" }, /* FU */
248 { 10, "Mic Capture" }, /* FU */
249 { 11, "Line Capture" }, /* FU */
250 { 12, "IEC958 In Capture" }, /* FU */
251 { 13, "Mic Playback" }, /* FU */
252 { 14, "Line Playback" }, /* FU */
253 /* 15: MU */
254 {} /* terminator */
258 * Control map entries
261 static struct usbmix_ctl_map usbmix_ctl_maps[] = {
263 .id = USB_ID(0x041e, 0x3000),
264 .map = extigy_map,
265 .ignore_ctl_error = 1,
268 .id = USB_ID(0x041e, 0x3010),
269 .map = mp3plus_map,
272 .id = USB_ID(0x041e, 0x3020),
273 .map = audigy2nx_map,
274 .selector_map = audigy2nx_selectors,
277 /* Hercules DJ Console (Windows Edition) */
278 .id = USB_ID(0x06f8, 0xb000),
279 .ignore_ctl_error = 1,
282 /* Hercules DJ Console (Macintosh Edition) */
283 .id = USB_ID(0x06f8, 0xd002),
284 .ignore_ctl_error = 1,
287 .id = USB_ID(0x08bb, 0x2702),
288 .map = linex_map,
289 .ignore_ctl_error = 1,
292 .id = USB_ID(0x0a92, 0x0091),
293 .map = maya44_map,
296 .id = USB_ID(0x0c45, 0x1158),
297 .map = justlink_map,
300 .id = USB_ID(0x0ccd, 0x0028),
301 .map = aureon_51_2_map,
303 { 0 } /* terminator */