]> git.karo-electronics.de Git - mv-sheeva.git/blob - sound/usb/usbmixer_maps.c
[ALSA] usb-audio: add Audigy 2 NX control names
[mv-sheeva.git] / sound / usb / usbmixer_maps.c
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  */
21
22
23 struct usbmix_name_map {
24         int id;
25         const char *name;
26         int control;
27 };
28
29 struct usbmix_ctl_map {
30         int vendor;
31         int product;
32         const struct usbmix_name_map *map;
33         int ignore_ctl_error;
34 };
35
36 /*
37  * USB control mappers for SB Exitigy
38  */
39
40 /*
41  * Topology of SB Extigy (see on the wide screen :)
42
43 USB_IN[1] --->FU[2]------------------------------+->MU[16]-->PU[17]-+->FU[18]--+->EU[27]--+->EU[21]-->FU[22]--+->FU[23] > Dig_OUT[24]
44                                                  ^                  |          |          |                   |
45 USB_IN[3] -+->SU[5]-->FU[6]--+->MU[14] ->PU[15]->+                  |          |          |                   +->FU[25] > Dig_OUT[26]
46            ^                 ^                   |                  |          |          |
47 Dig_IN[4] -+                 |                   |                  |          |          +->FU[28]---------------------> Spk_OUT[19]
48                              |                   |                  |          |
49 Lin-IN[7] -+-->FU[8]---------+                   |                  |          +----------------------------------------> Hph_OUT[20]
50            |                                     |                  |
51 Mic-IN[9] --+->FU[10]----------------------------+                  |
52            ||                                                       |
53            ||  +----------------------------------------------------+
54            VV  V
55            ++--+->SU[11]-->FU[12] --------------------------------------------------------------------------------------> USB_OUT[13]
56 */
57
58 static struct usbmix_name_map extigy_map[] = {
59         /* 1: IT pcm */
60         { 2, "PCM Playback" }, /* FU */
61         /* 3: IT pcm */
62         /* 4: IT digital in */
63         { 5, NULL }, /* DISABLED: this seems to be bogus on some firmware */
64         { 6, "Digital In" }, /* FU */
65         /* 7: IT line */
66         { 8, "Line Playback" }, /* FU */
67         /* 9: IT mic */
68         { 10, "Mic Playback" }, /* FU */
69         { 11, "Capture Input Source" }, /* SU */
70         { 12, "Capture" }, /* FU */
71         /* 13: OT pcm capture */
72         /* 14: MU (w/o controls) */
73         /* 15: PU (3D enh) */
74         /* 16: MU (w/o controls) */
75         { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */
76         { 17, "Channel Routing", 2 },   /* PU: mode select */
77         { 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */
78         { 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */
79         { 18, "Master Playback" }, /* FU; others */
80         /* 19: OT speaker */
81         /* 20: OT headphone */
82         { 21, NULL }, /* DISABLED: EU (for what?) */
83         { 22, "Digital Out Playback" }, /* FU */
84         { 23, "Digital Out1 Playback" }, /* FU */  /* FIXME: corresponds to 24 */
85         /* 24: OT digital out */
86         { 25, "IEC958 Optical Playback" }, /* FU */
87         { 26, "IEC958 Optical Playback" }, /* OT */
88         { 27, NULL }, /* DISABLED: EU (for what?) */
89         /* 28: FU speaker (mute) */
90         { 29, NULL }, /* Digital Input Playback Source? */
91         { 0 } /* terminator */
92 };
93
94 /* Sound Blaster MP3+ controls mapping
95  * The default mixer channels have totally misleading names,
96  * e.g. no Master and fake PCM volume
97  *                      Pavel Mihaylov <bin@bash.info>
98  */
99 static struct usbmix_name_map mp3plus_map[] = {
100         /* 1: IT pcm */
101         /* 2: IT mic */
102         /* 3: IT line */
103         /* 4: IT digital in */
104         /* 5: OT digital out */
105         /* 6: OT speaker */
106         /* 7: OT pcm capture */
107         { 8, "Capture Input Source" }, /* FU, default PCM Capture Source */
108                 /* (Mic, Input 1 = Line input, Input 2 = Optical input) */
109         { 9, "Master Playback" }, /* FU, default Speaker 1 */
110         /* { 10, "Mic Capture", 1 }, */ /* FU, Mic Capture */
111         /* { 10, "Mic Capture", 2 }, */ /* FU, Mic Capture */
112         { 10, "Mic Boost", 7 }, /* FU, default Auto Gain Input */
113         { 11, "Line Capture" }, /* FU, default PCM Capture */
114         { 12, "Digital In Playback" }, /* FU, default PCM 1 */
115         /* { 13, "Mic Playback" }, */ /* FU, default Mic Playback */
116         { 14, "Line Playback" }, /* FU, default Speaker */
117         /* 15: MU */
118         { 0 } /* terminator */
119 };
120
121 /* Topology of SB Audigy 2 NX
122
123           +----------------------------->EU[27]--+
124           |                                      v
125           | +----------------------------------->SU[29]---->FU[22]-->Dig_OUT[24]
126           | |                                    ^
127 USB_IN[1]-+------------+              +->EU[17]->+->FU[11]-+
128             |          v              |          v         |
129 Dig_IN[4]---+->FU[6]-->MU[16]->FU[18]-+->EU[21]->SU[31]----->FU[30]->Hph_OUT[20]
130             |          ^              |                    |
131 Lin_IN[7]-+--->FU[8]---+              +->EU[23]->FU[28]------------->Spk_OUT[19]
132           | |                                              v
133           +--->FU[12]------------------------------------->SU[14]--->USB_OUT[15]
134             |                                              ^
135             +->FU[13]--------------------------------------+
136 */
137 static struct usbmix_name_map audigy2nx_map[] = {
138         /* 1: IT pcm playback */
139         /* 4: IT digital in */
140         { 6, "Digital In Playback" }, /* FU */
141         /* 7: IT line in */
142         { 8, "Line Playback" }, /* FU */
143         { 11, "What-U-Hear Capture" }, /* FU */
144         { 12, "Line Capture" }, /* FU */
145         { 13, "Digital In Capture" }, /* FU */
146         { 14, "Capture Source" }, /* SU */
147         /* 15: OT pcm capture */
148         /* 16: MU w/o controls */
149         { 17, NULL }, /* DISABLED: EU (for what?) */
150         { 18, "Master Playback" }, /* FU */
151         /* 19: OT speaker */
152         /* 20: OT headphone */
153         { 21, NULL }, /* DISABLED: EU (for what?) */
154         { 22, "Digital Out Playback" }, /* FU */
155         { 23, NULL }, /* DISABLED: EU (for what?) */
156         /* 24: OT digital out */
157         { 27, NULL }, /* DISABLED: EU (for what?) */
158         { 28, "Speaker Playback" }, /* FU */
159         { 29, "Digital Out Source" }, /* SU */
160         { 30, "Headphone Playback" }, /* FU */
161         { 31, "Headphone Source" }, /* SU */
162         { 0 } /* terminator */
163 };
164
165 /* LineX FM Transmitter entry - needed to bypass controls bug */
166 static struct usbmix_name_map linex_map[] = {
167         /* 1: IT pcm */
168         /* 2: OT Speaker */ 
169         { 3, "Master" }, /* FU: master volume - left / right / mute */
170         { 0 } /* terminator */
171 };
172
173 /* Section "justlink_map" below added by James Courtier-Dutton <James@superbug.demon.co.uk>
174  * sourced from Maplin Electronics (http://www.maplin.co.uk), part number A56AK
175  * Part has 2 connectors that act as a single output. (TOSLINK Optical for digital out, and 3.5mm Jack for Analogue out.)
176  * The USB Mixer publishes a Microphone and extra Volume controls for it, but none exist on the device,
177  * so this map removes all unwanted sliders from alsamixer
178  */
179
180 static struct usbmix_name_map justlink_map[] = {
181         /* 1: IT pcm playback */
182         /* 2: Not present */
183         { 3, NULL}, /* IT mic (No mic input on device) */
184         /* 4: Not present */
185         /* 5: OT speacker */
186         /* 6: OT pcm capture */
187         { 7, "Master Playback" }, /* Mute/volume for speaker */
188         { 8, NULL }, /* Capture Switch (No capture inputs on device) */
189         { 9, NULL }, /* Capture Mute/volume (No capture inputs on device */
190         /* 0xa: Not present */
191         /* 0xb: MU (w/o controls) */
192         { 0xc, NULL }, /* Mic feedback Mute/volume (No capture inputs on device) */
193         { 0 } /* terminator */
194 };
195
196 /*
197  * Control map entries
198  */
199
200 static struct usbmix_ctl_map usbmix_ctl_maps[] = {
201         { 0x41e, 0x3000, extigy_map, 1 },
202         { 0x41e, 0x3010, mp3plus_map, 0 },
203         { 0x41e, 0x3020, audigy2nx_map, 0 },
204         { 0x8bb, 0x2702, linex_map, 1 },
205         { 0xc45, 0x1158, justlink_map, 0 },
206         { 0 } /* terminator */
207 };
208