0001
0002
0003
0004
0005
0006
0007
0008 struct usbmix_dB_map {
0009 int min;
0010 int max;
0011 bool min_mute;
0012 };
0013
0014 struct usbmix_name_map {
0015 int id;
0016 const char *name;
0017 int control;
0018 const struct usbmix_dB_map *dB;
0019 };
0020
0021 struct usbmix_selector_map {
0022 int id;
0023 int count;
0024 const char **names;
0025 };
0026
0027 struct usbmix_ctl_map {
0028 u32 id;
0029 const struct usbmix_name_map *map;
0030 const struct usbmix_selector_map *selector_map;
0031 const struct usbmix_connector_map *connector_map;
0032 };
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 static const struct usbmix_name_map extigy_map[] = {
0057
0058 { 2, "PCM Playback" },
0059
0060
0061 { 5, NULL },
0062 { 6, "Digital In" },
0063
0064 { 8, "Line Playback" },
0065
0066 { 10, "Mic Playback" },
0067 { 11, "Capture Source" },
0068 { 12, "Capture" },
0069
0070
0071
0072
0073 { 17, NULL, 1 },
0074 { 17, "Channel Routing", 2 },
0075 { 18, "Tone Control - Bass", UAC_FU_BASS },
0076 { 18, "Tone Control - Treble", UAC_FU_TREBLE },
0077 { 18, "Master Playback" },
0078
0079
0080 { 21, NULL },
0081 { 22, "Digital Out Playback" },
0082 { 23, "Digital Out1 Playback" },
0083
0084 { 25, "IEC958 Optical Playback" },
0085 { 26, "IEC958 Optical Playback" },
0086 { 27, NULL },
0087
0088 { 29, NULL },
0089 { 0 }
0090 };
0091
0092
0093
0094
0095
0096
0097 static const struct usbmix_dB_map mp3plus_dB_1 = {.min = -4781, .max = 0};
0098
0099 static const struct usbmix_dB_map mp3plus_dB_2 = {.min = -1781, .max = 618};
0100
0101
0102 static const struct usbmix_name_map mp3plus_map[] = {
0103
0104
0105
0106
0107
0108
0109
0110 { 8, "Capture Source" },
0111
0112 { 9, "Master Playback" },
0113
0114 { 10, NULL, 2, .dB = &mp3plus_dB_2 },
0115
0116 { 10, "Mic Boost", 7 },
0117 { 11, "Line Capture", .dB = &mp3plus_dB_2 },
0118
0119 { 12, "Digital In Playback" },
0120 { 13, .dB = &mp3plus_dB_1 },
0121
0122 { 14, "Line Playback", .dB = &mp3plus_dB_1 },
0123
0124 { 0 }
0125 };
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143 static const struct usbmix_name_map audigy2nx_map[] = {
0144
0145
0146 { 6, "Digital In Playback" },
0147
0148 { 8, "Line Playback" },
0149 { 11, "What-U-Hear Capture" },
0150 { 12, "Line Capture" },
0151 { 13, "Digital In Capture" },
0152 { 14, "Capture Source" },
0153
0154
0155 { 17, NULL },
0156 { 18, "Master Playback" },
0157
0158
0159 { 21, NULL },
0160 { 22, "Digital Out Playback" },
0161 { 23, NULL },
0162
0163 { 27, NULL },
0164 { 28, "Speaker Playback" },
0165 { 29, "Digital Out Source" },
0166 { 30, "Headphone Playback" },
0167 { 31, "Headphone Source" },
0168 { 0 }
0169 };
0170
0171 static const struct usbmix_name_map mbox1_map[] = {
0172 { 1, "Clock" },
0173 { 0 }
0174 };
0175
0176 static const struct usbmix_selector_map c400_selectors[] = {
0177 {
0178 .id = 0x80,
0179 .count = 2,
0180 .names = (const char*[]) {"Internal", "SPDIF"}
0181 },
0182 { 0 }
0183 };
0184
0185 static const struct usbmix_selector_map audigy2nx_selectors[] = {
0186 {
0187 .id = 14,
0188 .count = 3,
0189 .names = (const char*[]) {"Line", "Digital In", "What-U-Hear"}
0190 },
0191 {
0192 .id = 29,
0193 .count = 3,
0194 .names = (const char*[]) {"Front", "PCM", "Digital In"}
0195 },
0196 {
0197 .id = 31,
0198 .count = 2,
0199 .names = (const char*[]) {"Front", "Side"}
0200 },
0201 { 0 }
0202 };
0203
0204
0205 static const struct usbmix_name_map live24ext_map[] = {
0206
0207 { 5, "Mic Capture" },
0208 { 0 }
0209 };
0210
0211
0212 static const struct usbmix_name_map linex_map[] = {
0213
0214
0215 { 3, "Master" },
0216 { 0 }
0217 };
0218
0219 static const struct usbmix_name_map maya44_map[] = {
0220
0221 { 2, "Line Playback" },
0222
0223 { 4, "Line Playback" },
0224
0225
0226 { 7, "Master Playback" },
0227
0228
0229 { 10, "Line Capture" },
0230
0231
0232 { }
0233 };
0234
0235
0236
0237
0238
0239
0240
0241
0242 static const struct usbmix_name_map justlink_map[] = {
0243
0244
0245 { 3, NULL},
0246
0247
0248
0249 { 7, "Master Playback" },
0250 { 8, NULL },
0251 { 9, NULL },
0252
0253
0254 { 0xc, NULL },
0255 { 0 }
0256 };
0257
0258
0259 static const struct usbmix_name_map aureon_51_2_map[] = {
0260
0261
0262
0263
0264
0265
0266
0267 { 8, "Capture Source" },
0268 { 9, "Master Playback" },
0269 { 10, "Mic Capture" },
0270 { 11, "Line Capture" },
0271 { 12, "IEC958 In Capture" },
0272 { 13, "Mic Playback" },
0273 { 14, "Line Playback" },
0274
0275 {}
0276 };
0277
0278 static const struct usbmix_name_map scratch_live_map[] = {
0279
0280
0281
0282 { 4, "Line 1 In" },
0283
0284
0285
0286
0287 { 9, "Line 2 In" },
0288
0289
0290
0291 { 0 }
0292 };
0293
0294 static const struct usbmix_name_map ebox44_map[] = {
0295 { 4, NULL },
0296 { 6, NULL },
0297 { 7, NULL },
0298 { 10, NULL },
0299 { 11, NULL },
0300 { 0 }
0301 };
0302
0303
0304
0305
0306
0307
0308
0309 static const struct usbmix_name_map hercules_usb51_map[] = {
0310 { 8, "Capture Source" },
0311 { 9, "Master Playback" },
0312 { 10, "Mic Boost", 7 },
0313 { 11, "Line Capture" },
0314 { 13, "Mic Bypass Playback" },
0315 { 14, "Line Bypass Playback" },
0316 { 0 }
0317 };
0318
0319
0320 static const struct usbmix_name_map gamecom780_map[] = {
0321 { 9, NULL },
0322 {}
0323 };
0324
0325
0326
0327
0328 static const struct usbmix_name_map scms_usb3318_map[] = {
0329 { 10, NULL },
0330 { 0 }
0331 };
0332
0333
0334 static const struct usbmix_dB_map bose_companion5_dB = {-5006, -6};
0335 static const struct usbmix_name_map bose_companion5_map[] = {
0336 { 3, NULL, .dB = &bose_companion5_dB },
0337 { 0 }
0338 };
0339
0340
0341 static const struct usbmix_dB_map bose_soundlink_dB = {-8283, -0, true};
0342 static const struct usbmix_name_map bose_soundlink_map[] = {
0343 { 2, NULL, .dB = &bose_soundlink_dB },
0344 { 0 }
0345 };
0346
0347
0348 static const struct usbmix_dB_map sennheiser_pc8_dB = {-9500, 0};
0349 static const struct usbmix_name_map sennheiser_pc8_map[] = {
0350 { 9, NULL, .dB = &sennheiser_pc8_dB },
0351 { 0 }
0352 };
0353
0354
0355
0356
0357
0358
0359
0360 static const struct usbmix_name_map dell_alc4020_map[] = {
0361 { 4, NULL },
0362 { 16, NULL },
0363 { 19, NULL },
0364 { 0 }
0365 };
0366
0367
0368
0369
0370
0371 static const struct usbmix_name_map corsair_virtuoso_map[] = {
0372 { 3, "Mic Capture" },
0373 { 6, "Sidetone Playback" },
0374 { 0 }
0375 };
0376
0377
0378 static const struct usbmix_name_map asus_zenith_ii_map[] = {
0379 { 19, NULL, 12 },
0380 { 16, "Speaker" },
0381 { 22, "Speaker Playback" },
0382 { 7, "Line" },
0383 { 19, "Line Capture" },
0384 { 8, "Mic" },
0385 { 20, "Mic Capture" },
0386 { 9, "Front Mic" },
0387 { 21, "Front Mic Capture" },
0388 { 17, "IEC958" },
0389 { 23, "IEC958 Playback" },
0390 {}
0391 };
0392
0393 static const struct usbmix_connector_map asus_zenith_ii_connector_map[] = {
0394 { 10, 16 },
0395 { 11, 17 },
0396 { 13, 7 },
0397 { 14, 8 },
0398 { 15, 9 },
0399 {}
0400 };
0401
0402 static const struct usbmix_name_map lenovo_p620_rear_map[] = {
0403 { 19, NULL, 12 },
0404 {}
0405 };
0406
0407
0408 static const struct usbmix_name_map trx40_mobo_map[] = {
0409 { 18, NULL },
0410 { 19, NULL, 12 },
0411 { 16, "Speaker" },
0412 { 22, "Speaker Playback" },
0413 { 7, "Line" },
0414 { 19, "Line Capture" },
0415 { 17, "Front Headphone" },
0416 { 23, "Front Headphone Playback" },
0417 { 8, "Mic" },
0418 { 20, "Mic Capture" },
0419 { 9, "Front Mic" },
0420 { 21, "Front Mic Capture" },
0421 { 24, "IEC958 Playback" },
0422 {}
0423 };
0424
0425 static const struct usbmix_connector_map trx40_mobo_connector_map[] = {
0426 { 10, 16 },
0427 { 11, 17 },
0428 { 13, 7 },
0429 { 14, 8 },
0430 { 15, 9 },
0431 {}
0432 };
0433
0434
0435 static const struct usbmix_name_map aorus_master_alc1220vb_map[] = {
0436 { 17, NULL },
0437 { 19, NULL, 12 },
0438 { 16, "Line Out" },
0439 { 22, "Line Out Playback" },
0440 { 7, "Line" },
0441 { 19, "Line Capture" },
0442 { 8, "Mic" },
0443 { 20, "Mic Capture" },
0444 { 9, "Front Mic" },
0445 { 21, "Front Mic Capture" },
0446 {}
0447 };
0448
0449
0450 static const struct usbmix_name_map msi_mpg_x570s_carbon_max_wifi_alc4080_map[] = {
0451 { 29, "Speaker Playback" },
0452 { 30, "Front Headphone Playback" },
0453 { 32, "IEC958 Playback" },
0454 {}
0455 };
0456
0457
0458 static const struct usbmix_name_map gigabyte_b450_map[] = {
0459 { 24, NULL },
0460 { 21, "Speaker" },
0461 { 29, "Speaker Playback" },
0462 { 22, "Headphone" },
0463 { 30, "Headphone Playback" },
0464 { 11, "Line" },
0465 { 27, "Line Capture" },
0466 { 12, "Mic" },
0467 { 28, "Mic Capture" },
0468 { 9, "Front Mic" },
0469 { 25, "Front Mic Capture" },
0470 {}
0471 };
0472
0473 static const struct usbmix_connector_map gigabyte_b450_connector_map[] = {
0474 { 13, 21 },
0475 { 14, 22 },
0476 { 19, 11 },
0477 { 20, 12 },
0478 { 17, 9 },
0479 {}
0480 };
0481
0482
0483
0484
0485
0486 static const struct usbmix_ctl_map usbmix_ctl_maps[] = {
0487 {
0488 .id = USB_ID(0x041e, 0x3000),
0489 .map = extigy_map,
0490 },
0491 {
0492 .id = USB_ID(0x041e, 0x3010),
0493 .map = mp3plus_map,
0494 },
0495 {
0496 .id = USB_ID(0x041e, 0x3020),
0497 .map = audigy2nx_map,
0498 .selector_map = audigy2nx_selectors,
0499 },
0500 {
0501 .id = USB_ID(0x041e, 0x3040),
0502 .map = live24ext_map,
0503 },
0504 {
0505 .id = USB_ID(0x041e, 0x3048),
0506 .map = audigy2nx_map,
0507 .selector_map = audigy2nx_selectors,
0508 },
0509 {
0510 .id = USB_ID(0x047f, 0xc010),
0511 .map = gamecom780_map,
0512 },
0513 {
0514
0515
0516
0517 .id = USB_ID(0x06f8, 0xc000),
0518 .map = hercules_usb51_map,
0519 },
0520 {
0521 .id = USB_ID(0x0763, 0x2030),
0522 .selector_map = c400_selectors,
0523 },
0524 {
0525 .id = USB_ID(0x0763, 0x2031),
0526 .selector_map = c400_selectors,
0527 },
0528 {
0529 .id = USB_ID(0x08bb, 0x2702),
0530 .map = linex_map,
0531 },
0532 {
0533 .id = USB_ID(0x0a92, 0x0091),
0534 .map = maya44_map,
0535 },
0536 {
0537 .id = USB_ID(0x0c45, 0x1158),
0538 .map = justlink_map,
0539 },
0540 {
0541 .id = USB_ID(0x0ccd, 0x0028),
0542 .map = aureon_51_2_map,
0543 },
0544 {
0545 .id = USB_ID(0x0bda, 0x4014),
0546 .map = dell_alc4020_map,
0547 },
0548 {
0549 .id = USB_ID(0x0dba, 0x1000),
0550 .map = mbox1_map,
0551 },
0552 {
0553 .id = USB_ID(0x13e5, 0x0001),
0554 .map = scratch_live_map,
0555 },
0556 {
0557 .id = USB_ID(0x200c, 0x1018),
0558 .map = ebox44_map,
0559 },
0560 {
0561
0562 .id = USB_ID(0x2573, 0x0008),
0563 .map = maya44_map,
0564 },
0565 {
0566
0567 .id = USB_ID(0x27ac, 0x1000),
0568 .map = scms_usb3318_map,
0569 },
0570 {
0571
0572 .id = USB_ID(0x25c4, 0x0003),
0573 .map = scms_usb3318_map,
0574 },
0575 {
0576
0577 .id = USB_ID(0x05a7, 0x1020),
0578 .map = bose_companion5_map,
0579 },
0580 {
0581
0582 .id = USB_ID(0x05a7, 0x40fa),
0583 .map = bose_soundlink_map,
0584 },
0585 {
0586
0587 .id = USB_ID(0x1b1c, 0x0a3f),
0588 .map = corsair_virtuoso_map,
0589 },
0590 {
0591
0592 .id = USB_ID(0x1b1c, 0x0a40),
0593 .map = corsair_virtuoso_map,
0594 },
0595 {
0596
0597 .id = USB_ID(0x1b1c, 0x0a3d),
0598 .map = corsair_virtuoso_map,
0599 },
0600 {
0601
0602 .id = USB_ID(0x1b1c, 0x0a3e),
0603 .map = corsair_virtuoso_map,
0604 },
0605 {
0606
0607 .id = USB_ID(0x1b1c, 0x0a41),
0608 .map = corsair_virtuoso_map,
0609 },
0610 {
0611
0612 .id = USB_ID(0x1b1c, 0x0a42),
0613 .map = corsair_virtuoso_map,
0614 },
0615 {
0616 .id = USB_ID(0x0414, 0xa001),
0617 .map = aorus_master_alc1220vb_map,
0618 },
0619 {
0620 .id = USB_ID(0x0414, 0xa002),
0621 .map = trx40_mobo_map,
0622 .connector_map = trx40_mobo_connector_map,
0623 },
0624 {
0625 .id = USB_ID(0x0414, 0xa00d),
0626 .map = gigabyte_b450_map,
0627 .connector_map = gigabyte_b450_connector_map,
0628 },
0629 {
0630 .id = USB_ID(0x0b05, 0x1916),
0631 .map = asus_zenith_ii_map,
0632 .connector_map = asus_zenith_ii_connector_map,
0633 },
0634 {
0635 .id = USB_ID(0x0b05, 0x1917),
0636 .map = trx40_mobo_map,
0637 .connector_map = trx40_mobo_connector_map,
0638 },
0639 {
0640 .id = USB_ID(0x0db0, 0x0d64),
0641 .map = trx40_mobo_map,
0642 .connector_map = trx40_mobo_connector_map,
0643 },
0644 {
0645 .id = USB_ID(0x0db0, 0x419c),
0646 .map = msi_mpg_x570s_carbon_max_wifi_alc4080_map,
0647 },
0648 {
0649 .id = USB_ID(0x0db0, 0xa073),
0650 .map = msi_mpg_x570s_carbon_max_wifi_alc4080_map,
0651 },
0652 {
0653 .id = USB_ID(0x0db0, 0x543d),
0654 .map = trx40_mobo_map,
0655 .connector_map = trx40_mobo_connector_map,
0656 },
0657 {
0658 .id = USB_ID(0x26ce, 0x0a01),
0659 .map = trx40_mobo_map,
0660 .connector_map = trx40_mobo_connector_map,
0661 },
0662 {
0663 .id = USB_ID(0x17aa, 0x1046),
0664 .map = lenovo_p620_rear_map,
0665 },
0666 {
0667
0668 .id = USB_ID(0x1395, 0x0025),
0669 .map = sennheiser_pc8_map,
0670 },
0671 { 0 }
0672 };
0673
0674
0675
0676
0677
0678 static const struct usbmix_name_map uac3_badd_generic_io_map[] = {
0679 { UAC3_BADD_FU_ID2, "Generic Out Playback" },
0680 { UAC3_BADD_FU_ID5, "Generic In Capture" },
0681 { 0 }
0682 };
0683 static const struct usbmix_name_map uac3_badd_headphone_map[] = {
0684 { UAC3_BADD_FU_ID2, "Headphone Playback" },
0685 { 0 }
0686 };
0687 static const struct usbmix_name_map uac3_badd_speaker_map[] = {
0688 { UAC3_BADD_FU_ID2, "Speaker Playback" },
0689 { 0 }
0690 };
0691 static const struct usbmix_name_map uac3_badd_microphone_map[] = {
0692 { UAC3_BADD_FU_ID5, "Mic Capture" },
0693 { 0 }
0694 };
0695
0696 static const struct usbmix_name_map uac3_badd_headset_map[] = {
0697 { UAC3_BADD_FU_ID2, "Headset Playback" },
0698 { UAC3_BADD_FU_ID5, "Headset Capture" },
0699 { UAC3_BADD_FU_ID7, "Sidetone Mixing" },
0700 { 0 }
0701 };
0702 static const struct usbmix_name_map uac3_badd_speakerphone_map[] = {
0703 { UAC3_BADD_FU_ID2, "Speaker Playback" },
0704 { UAC3_BADD_FU_ID5, "Mic Capture" },
0705 { 0 }
0706 };
0707
0708 static const struct usbmix_ctl_map uac3_badd_usbmix_ctl_maps[] = {
0709 {
0710 .id = UAC3_FUNCTION_SUBCLASS_GENERIC_IO,
0711 .map = uac3_badd_generic_io_map,
0712 },
0713 {
0714 .id = UAC3_FUNCTION_SUBCLASS_HEADPHONE,
0715 .map = uac3_badd_headphone_map,
0716 },
0717 {
0718 .id = UAC3_FUNCTION_SUBCLASS_SPEAKER,
0719 .map = uac3_badd_speaker_map,
0720 },
0721 {
0722 .id = UAC3_FUNCTION_SUBCLASS_MICROPHONE,
0723 .map = uac3_badd_microphone_map,
0724 },
0725 {
0726 .id = UAC3_FUNCTION_SUBCLASS_HEADSET,
0727 .map = uac3_badd_headset_map,
0728 },
0729 {
0730 .id = UAC3_FUNCTION_SUBCLASS_HEADSET_ADAPTER,
0731 .map = uac3_badd_headset_map,
0732 },
0733 {
0734 .id = UAC3_FUNCTION_SUBCLASS_SPEAKERPHONE,
0735 .map = uac3_badd_speakerphone_map,
0736 },
0737 { 0 }
0738 };