1
2
3
4
5
6
7
8struct usbmix_dB_map {
9 int min;
10 int max;
11 bool min_mute;
12};
13
14struct usbmix_name_map {
15 int id;
16 const char *name;
17 int control;
18 const struct usbmix_dB_map *dB;
19};
20
21struct usbmix_selector_map {
22 int id;
23 int count;
24 const char **names;
25};
26
27struct usbmix_ctl_map {
28 u32 id;
29 const struct usbmix_name_map *map;
30 const struct usbmix_selector_map *selector_map;
31 const struct usbmix_connector_map *connector_map;
32};
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56static const struct usbmix_name_map extigy_map[] = {
57
58 { 2, "PCM Playback" },
59
60
61 { 5, NULL },
62 { 6, "Digital In" },
63
64 { 8, "Line Playback" },
65
66 { 10, "Mic Playback" },
67 { 11, "Capture Source" },
68 { 12, "Capture" },
69
70
71
72
73 { 17, NULL, 1 },
74 { 17, "Channel Routing", 2 },
75 { 18, "Tone Control - Bass", UAC_FU_BASS },
76 { 18, "Tone Control - Treble", UAC_FU_TREBLE },
77 { 18, "Master Playback" },
78
79
80 { 21, NULL },
81 { 22, "Digital Out Playback" },
82 { 23, "Digital Out1 Playback" },
83
84 { 25, "IEC958 Optical Playback" },
85 { 26, "IEC958 Optical Playback" },
86 { 27, NULL },
87
88 { 29, NULL },
89 { 0 }
90};
91
92
93
94
95
96
97static const struct usbmix_dB_map mp3plus_dB_1 = {.min = -4781, .max = 0};
98
99static const struct usbmix_dB_map mp3plus_dB_2 = {.min = -1781, .max = 618};
100
101
102static const struct usbmix_name_map mp3plus_map[] = {
103
104
105
106
107
108
109
110 { 8, "Capture Source" },
111
112 { 9, "Master Playback" },
113
114 { 10, NULL, 2, .dB = &mp3plus_dB_2 },
115
116 { 10, "Mic Boost", 7 },
117 { 11, "Line Capture", .dB = &mp3plus_dB_2 },
118
119 { 12, "Digital In Playback" },
120 { 13, .dB = &mp3plus_dB_1 },
121
122 { 14, "Line Playback", .dB = &mp3plus_dB_1 },
123
124 { 0 }
125};
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143static const struct usbmix_name_map audigy2nx_map[] = {
144
145
146 { 6, "Digital In Playback" },
147
148 { 8, "Line Playback" },
149 { 11, "What-U-Hear Capture" },
150 { 12, "Line Capture" },
151 { 13, "Digital In Capture" },
152 { 14, "Capture Source" },
153
154
155 { 17, NULL },
156 { 18, "Master Playback" },
157
158
159 { 21, NULL },
160 { 22, "Digital Out Playback" },
161 { 23, NULL },
162
163 { 27, NULL },
164 { 28, "Speaker Playback" },
165 { 29, "Digital Out Source" },
166 { 30, "Headphone Playback" },
167 { 31, "Headphone Source" },
168 { 0 }
169};
170
171static const struct usbmix_name_map mbox1_map[] = {
172 { 1, "Clock" },
173 { 0 }
174};
175
176static const struct usbmix_selector_map c400_selectors[] = {
177 {
178 .id = 0x80,
179 .count = 2,
180 .names = (const char*[]) {"Internal", "SPDIF"}
181 },
182 { 0 }
183};
184
185static const struct usbmix_selector_map audigy2nx_selectors[] = {
186 {
187 .id = 14,
188 .count = 3,
189 .names = (const char*[]) {"Line", "Digital In", "What-U-Hear"}
190 },
191 {
192 .id = 29,
193 .count = 3,
194 .names = (const char*[]) {"Front", "PCM", "Digital In"}
195 },
196 {
197 .id = 31,
198 .count = 2,
199 .names = (const char*[]) {"Front", "Side"}
200 },
201 { 0 }
202};
203
204
205static const struct usbmix_name_map live24ext_map[] = {
206
207 { 5, "Mic Capture" },
208 { 0 }
209};
210
211
212static const struct usbmix_name_map linex_map[] = {
213
214
215 { 3, "Master" },
216 { 0 }
217};
218
219static const struct usbmix_name_map maya44_map[] = {
220
221 { 2, "Line Playback" },
222
223 { 4, "Line Playback" },
224
225
226 { 7, "Master Playback" },
227
228
229 { 10, "Line Capture" },
230
231
232 { }
233};
234
235
236
237
238
239
240
241
242static const struct usbmix_name_map justlink_map[] = {
243
244
245 { 3, NULL},
246
247
248
249 { 7, "Master Playback" },
250 { 8, NULL },
251 { 9, NULL },
252
253
254 { 0xc, NULL },
255 { 0 }
256};
257
258
259static const struct usbmix_name_map aureon_51_2_map[] = {
260
261
262
263
264
265
266
267 { 8, "Capture Source" },
268 { 9, "Master Playback" },
269 { 10, "Mic Capture" },
270 { 11, "Line Capture" },
271 { 12, "IEC958 In Capture" },
272 { 13, "Mic Playback" },
273 { 14, "Line Playback" },
274
275 {}
276};
277
278static const struct usbmix_name_map scratch_live_map[] = {
279
280
281
282 { 4, "Line 1 In" },
283
284
285
286
287 { 9, "Line 2 In" },
288
289
290
291 { 0 }
292};
293
294static const struct usbmix_name_map ebox44_map[] = {
295 { 4, NULL },
296 { 6, NULL },
297 { 7, NULL },
298 { 10, NULL },
299 { 11, NULL },
300 { 0 }
301};
302
303
304
305
306
307
308
309static const struct usbmix_name_map hercules_usb51_map[] = {
310 { 8, "Capture Source" },
311 { 9, "Master Playback" },
312 { 10, "Mic Boost", 7 },
313 { 11, "Line Capture" },
314 { 13, "Mic Bypass Playback" },
315 { 14, "Line Bypass Playback" },
316 { 0 }
317};
318
319
320static const struct usbmix_name_map gamecom780_map[] = {
321 { 9, NULL },
322 {}
323};
324
325
326
327
328static const struct usbmix_name_map scms_usb3318_map[] = {
329 { 10, NULL },
330 { 0 }
331};
332
333
334static const struct usbmix_dB_map bose_companion5_dB = {-5006, -6};
335static const struct usbmix_name_map bose_companion5_map[] = {
336 { 3, NULL, .dB = &bose_companion5_dB },
337 { 0 }
338};
339
340
341static const struct usbmix_dB_map bose_soundlink_dB = {-8283, -0, true};
342static const struct usbmix_name_map bose_soundlink_map[] = {
343 { 2, NULL, .dB = &bose_soundlink_dB },
344 { 0 }
345};
346
347
348static const struct usbmix_dB_map sennheiser_pc8_dB = {-9500, 0};
349static const struct usbmix_name_map sennheiser_pc8_map[] = {
350 { 9, NULL, .dB = &sennheiser_pc8_dB },
351 { 0 }
352};
353
354
355
356
357
358
359
360static const struct usbmix_name_map dell_alc4020_map[] = {
361 { 4, NULL },
362 { 16, NULL },
363 { 19, NULL },
364 { 0 }
365};
366
367
368
369
370
371static const struct usbmix_name_map corsair_virtuoso_map[] = {
372 { 3, "Mic Capture" },
373 { 6, "Sidetone Playback" },
374 { 0 }
375};
376
377
378
379
380
381static const struct usbmix_name_map asus_rog_map[] = {
382 { 18, NULL },
383 { 19, NULL, 12 },
384 {}
385};
386
387static const struct usbmix_name_map lenovo_p620_rear_map[] = {
388 { 19, NULL, 12 },
389 {}
390};
391
392
393static const struct usbmix_name_map trx40_mobo_map[] = {
394 { 18, NULL },
395 { 19, NULL, 12 },
396 { 16, "Speaker" },
397 { 22, "Speaker Playback" },
398 { 7, "Line" },
399 { 19, "Line Capture" },
400 { 17, "Front Headphone" },
401 { 23, "Front Headphone Playback" },
402 { 8, "Mic" },
403 { 20, "Mic Capture" },
404 { 9, "Front Mic" },
405 { 21, "Front Mic Capture" },
406 { 24, "IEC958 Playback" },
407 {}
408};
409
410static const struct usbmix_connector_map trx40_mobo_connector_map[] = {
411 { 10, 16 },
412 { 11, 17 },
413 { 13, 7 },
414 { 14, 8 },
415 { 15, 9 },
416 {}
417};
418
419
420static const struct usbmix_name_map aorus_master_alc1220vb_map[] = {
421 { 17, NULL },
422 { 19, NULL, 12 },
423 { 16, "Line Out" },
424 { 22, "Line Out Playback" },
425 { 7, "Line" },
426 { 19, "Line Capture" },
427 { 8, "Mic" },
428 { 20, "Mic Capture" },
429 { 9, "Front Mic" },
430 { 21, "Front Mic Capture" },
431 {}
432};
433
434
435static const struct usbmix_name_map msi_mpg_x570s_carbon_max_wifi_alc4080_map[] = {
436 { 29, "Speaker Playback" },
437 { 30, "Front Headphone Playback" },
438 { 32, "IEC958 Playback" },
439 {}
440};
441
442
443static const struct usbmix_name_map gigabyte_b450_map[] = {
444 { 24, NULL },
445 { 21, "Speaker" },
446 { 29, "Speaker Playback" },
447 { 22, "Headphone" },
448 { 30, "Headphone Playback" },
449 { 11, "Line" },
450 { 27, "Line Capture" },
451 { 12, "Mic" },
452 { 28, "Mic Capture" },
453 { 9, "Front Mic" },
454 { 25, "Front Mic Capture" },
455 {}
456};
457
458static const struct usbmix_connector_map gigabyte_b450_connector_map[] = {
459 { 13, 21 },
460 { 14, 22 },
461 { 19, 11 },
462 { 20, 12 },
463 { 17, 9 },
464 {}
465};
466
467
468
469
470
471static const struct usbmix_ctl_map usbmix_ctl_maps[] = {
472 {
473 .id = USB_ID(0x041e, 0x3000),
474 .map = extigy_map,
475 },
476 {
477 .id = USB_ID(0x041e, 0x3010),
478 .map = mp3plus_map,
479 },
480 {
481 .id = USB_ID(0x041e, 0x3020),
482 .map = audigy2nx_map,
483 .selector_map = audigy2nx_selectors,
484 },
485 {
486 .id = USB_ID(0x041e, 0x3040),
487 .map = live24ext_map,
488 },
489 {
490 .id = USB_ID(0x041e, 0x3048),
491 .map = audigy2nx_map,
492 .selector_map = audigy2nx_selectors,
493 },
494 {
495 .id = USB_ID(0x047f, 0xc010),
496 .map = gamecom780_map,
497 },
498 {
499
500
501
502 .id = USB_ID(0x06f8, 0xc000),
503 .map = hercules_usb51_map,
504 },
505 {
506 .id = USB_ID(0x0763, 0x2030),
507 .selector_map = c400_selectors,
508 },
509 {
510 .id = USB_ID(0x0763, 0x2031),
511 .selector_map = c400_selectors,
512 },
513 {
514 .id = USB_ID(0x08bb, 0x2702),
515 .map = linex_map,
516 },
517 {
518 .id = USB_ID(0x0a92, 0x0091),
519 .map = maya44_map,
520 },
521 {
522 .id = USB_ID(0x0c45, 0x1158),
523 .map = justlink_map,
524 },
525 {
526 .id = USB_ID(0x0ccd, 0x0028),
527 .map = aureon_51_2_map,
528 },
529 {
530 .id = USB_ID(0x0bda, 0x4014),
531 .map = dell_alc4020_map,
532 },
533 {
534 .id = USB_ID(0x0dba, 0x1000),
535 .map = mbox1_map,
536 },
537 {
538 .id = USB_ID(0x13e5, 0x0001),
539 .map = scratch_live_map,
540 },
541 {
542 .id = USB_ID(0x200c, 0x1018),
543 .map = ebox44_map,
544 },
545 {
546
547 .id = USB_ID(0x2573, 0x0008),
548 .map = maya44_map,
549 },
550 {
551
552 .id = USB_ID(0x27ac, 0x1000),
553 .map = scms_usb3318_map,
554 },
555 {
556
557 .id = USB_ID(0x25c4, 0x0003),
558 .map = scms_usb3318_map,
559 },
560 {
561
562 .id = USB_ID(0x05a7, 0x1020),
563 .map = bose_companion5_map,
564 },
565 {
566
567 .id = USB_ID(0x05a7, 0x40fa),
568 .map = bose_soundlink_map,
569 },
570 {
571
572 .id = USB_ID(0x1b1c, 0x0a3f),
573 .map = corsair_virtuoso_map,
574 },
575 {
576
577 .id = USB_ID(0x1b1c, 0x0a40),
578 .map = corsair_virtuoso_map,
579 },
580 {
581
582 .id = USB_ID(0x1b1c, 0x0a3d),
583 .map = corsair_virtuoso_map,
584 },
585 {
586
587 .id = USB_ID(0x1b1c, 0x0a3e),
588 .map = corsair_virtuoso_map,
589 },
590 {
591
592 .id = USB_ID(0x1b1c, 0x0a41),
593 .map = corsair_virtuoso_map,
594 },
595 {
596
597 .id = USB_ID(0x1b1c, 0x0a42),
598 .map = corsair_virtuoso_map,
599 },
600 {
601 .id = USB_ID(0x0414, 0xa001),
602 .map = aorus_master_alc1220vb_map,
603 },
604 {
605 .id = USB_ID(0x0414, 0xa002),
606 .map = trx40_mobo_map,
607 .connector_map = trx40_mobo_connector_map,
608 },
609 {
610 .id = USB_ID(0x0414, 0xa00d),
611 .map = gigabyte_b450_map,
612 .connector_map = gigabyte_b450_connector_map,
613 },
614 {
615 .id = USB_ID(0x0b05, 0x1916),
616 .map = asus_rog_map,
617 },
618 {
619 .id = USB_ID(0x0b05, 0x1917),
620 .map = trx40_mobo_map,
621 .connector_map = trx40_mobo_connector_map,
622 },
623 {
624 .id = USB_ID(0x0db0, 0x0d64),
625 .map = trx40_mobo_map,
626 .connector_map = trx40_mobo_connector_map,
627 },
628 {
629 .id = USB_ID(0x0db0, 0x419c),
630 .map = msi_mpg_x570s_carbon_max_wifi_alc4080_map,
631 },
632 {
633 .id = USB_ID(0x0db0, 0xa073),
634 .map = msi_mpg_x570s_carbon_max_wifi_alc4080_map,
635 },
636 {
637 .id = USB_ID(0x0db0, 0x543d),
638 .map = trx40_mobo_map,
639 .connector_map = trx40_mobo_connector_map,
640 },
641 {
642 .id = USB_ID(0x26ce, 0x0a01),
643 .map = trx40_mobo_map,
644 .connector_map = trx40_mobo_connector_map,
645 },
646 {
647 .id = USB_ID(0x17aa, 0x1046),
648 .map = lenovo_p620_rear_map,
649 },
650 {
651
652 .id = USB_ID(0x1395, 0x0025),
653 .map = sennheiser_pc8_map,
654 },
655 { 0 }
656};
657
658
659
660
661
662static const struct usbmix_name_map uac3_badd_generic_io_map[] = {
663 { UAC3_BADD_FU_ID2, "Generic Out Playback" },
664 { UAC3_BADD_FU_ID5, "Generic In Capture" },
665 { 0 }
666};
667static const struct usbmix_name_map uac3_badd_headphone_map[] = {
668 { UAC3_BADD_FU_ID2, "Headphone Playback" },
669 { 0 }
670};
671static const struct usbmix_name_map uac3_badd_speaker_map[] = {
672 { UAC3_BADD_FU_ID2, "Speaker Playback" },
673 { 0 }
674};
675static const struct usbmix_name_map uac3_badd_microphone_map[] = {
676 { UAC3_BADD_FU_ID5, "Mic Capture" },
677 { 0 }
678};
679
680static const struct usbmix_name_map uac3_badd_headset_map[] = {
681 { UAC3_BADD_FU_ID2, "Headset Playback" },
682 { UAC3_BADD_FU_ID5, "Headset Capture" },
683 { UAC3_BADD_FU_ID7, "Sidetone Mixing" },
684 { 0 }
685};
686static const struct usbmix_name_map uac3_badd_speakerphone_map[] = {
687 { UAC3_BADD_FU_ID2, "Speaker Playback" },
688 { UAC3_BADD_FU_ID5, "Mic Capture" },
689 { 0 }
690};
691
692static const struct usbmix_ctl_map uac3_badd_usbmix_ctl_maps[] = {
693 {
694 .id = UAC3_FUNCTION_SUBCLASS_GENERIC_IO,
695 .map = uac3_badd_generic_io_map,
696 },
697 {
698 .id = UAC3_FUNCTION_SUBCLASS_HEADPHONE,
699 .map = uac3_badd_headphone_map,
700 },
701 {
702 .id = UAC3_FUNCTION_SUBCLASS_SPEAKER,
703 .map = uac3_badd_speaker_map,
704 },
705 {
706 .id = UAC3_FUNCTION_SUBCLASS_MICROPHONE,
707 .map = uac3_badd_microphone_map,
708 },
709 {
710 .id = UAC3_FUNCTION_SUBCLASS_HEADSET,
711 .map = uac3_badd_headset_map,
712 },
713 {
714 .id = UAC3_FUNCTION_SUBCLASS_HEADSET_ADAPTER,
715 .map = uac3_badd_headset_map,
716 },
717 {
718 .id = UAC3_FUNCTION_SUBCLASS_SPEAKERPHONE,
719 .map = uac3_badd_speakerphone_map,
720 },
721 { 0 }
722};
723