ia64/linux-2.6.18-xen.hg

view sound/usb/usbmixer_maps.c @ 890:2e94884f0e8d

Dom0 PCI: fix a regression introduced by the SR-IOV change

The device class may be changed during the early fixup. So need to
re-read the device class from pci_dev after the fixup.

The patch "PCI: centralize device setup code" (c/s 825) wrongly
cleaned up the device class re-read. This patch reverts that change.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jun 03 11:21:52 2009 +0100 (2009-06-03)
parents 831230e53067
children
line source
1 /*
2 * Additional mixer mapping
3 *
4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
5 *
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.
10 *
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.
15 *
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
19 *
20 */
23 struct usbmix_name_map {
24 int id;
25 const char *name;
26 int control;
27 };
29 struct usbmix_selector_map {
30 int id;
31 int count;
32 const char **names;
33 };
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;
40 };
42 /*
43 * USB control mappers for SB Exitigy
44 */
46 /*
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]
62 */
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 */
98 };
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>
104 */
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 */
125 };
127 /* Topology of SB Audigy 2 NX
129 +----------------------------->EU[27]--+
130 | v
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]
140 | ^
141 +->FU[13]--------------------------------------+
142 */
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 */
169 };
171 static struct usbmix_selector_map audigy2nx_selectors[] = {
172 {
173 .id = 14, /* Capture Source */
174 .count = 3,
175 .names = (const char*[]) {"Line", "Digital In", "What-U-Hear"}
176 },
177 {
178 .id = 29, /* Digital Out Source */
179 .count = 3,
180 .names = (const char*[]) {"Front", "PCM", "Digital In"}
181 },
182 {
183 .id = 31, /* Headphone Source */
184 .count = 2,
185 .names = (const char*[]) {"Front", "Side"}
186 },
187 { 0 } /* terminator */
188 };
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 */
196 };
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 */
211 { }
212 };
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
219 */
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 */
235 };
237 /*
238 * Control map entries
239 */
241 static struct usbmix_ctl_map usbmix_ctl_maps[] = {
242 {
243 .id = USB_ID(0x041e, 0x3000),
244 .map = extigy_map,
245 .ignore_ctl_error = 1,
246 },
247 {
248 .id = USB_ID(0x041e, 0x3010),
249 .map = mp3plus_map,
250 },
251 {
252 .id = USB_ID(0x041e, 0x3020),
253 .map = audigy2nx_map,
254 .selector_map = audigy2nx_selectors,
255 },
256 {
257 /* Hercules DJ Console (Windows Edition) */
258 .id = USB_ID(0x06f8, 0xb000),
259 .ignore_ctl_error = 1,
260 },
261 {
262 /* Hercules DJ Console (Macintosh Edition) */
263 .id = USB_ID(0x06f8, 0xd002),
264 .ignore_ctl_error = 1,
265 },
266 {
267 .id = USB_ID(0x08bb, 0x2702),
268 .map = linex_map,
269 .ignore_ctl_error = 1,
270 },
271 {
272 .id = USB_ID(0x0a92, 0x0091),
273 .map = maya44_map,
274 },
275 {
276 .id = USB_ID(0x0c45, 0x1158),
277 .map = justlink_map,
278 },
279 { 0 } /* terminator */
280 };