hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/sound/usb/quirks.c
....@@ -1,17 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
2
- * This program is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License as published by
4
- * the Free Software Foundation; either version 2 of the License, or
5
- * (at your option) any later version.
6
- *
7
- * This program is distributed in the hope that it will be useful,
8
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- * GNU General Public License for more details.
11
- *
12
- * You should have received a copy of the GNU General Public License
13
- * along with this program; if not, write to the Free Software
14
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
153 */
164
175 #include <linux/init.h>
....@@ -19,6 +7,7 @@
197 #include <linux/usb.h>
208 #include <linux/usb/audio.h>
219 #include <linux/usb/midi.h>
10
+#include <linux/bits.h>
2211
2312 #include <sound/control.h>
2413 #include <sound/core.h>
....@@ -537,6 +526,15 @@
537526 return 1; /* Continue with creating streams and mixer */
538527 }
539528
529
+static int setup_disable_autosuspend(struct snd_usb_audio *chip,
530
+ struct usb_interface *iface,
531
+ struct usb_driver *driver,
532
+ const struct snd_usb_audio_quirk *quirk)
533
+{
534
+ usb_disable_autosuspend(interface_to_usbdev(iface));
535
+ return 1; /* Continue with creating streams and mixer */
536
+}
537
+
540538 /*
541539 * audio-interface quirks
542540 *
....@@ -576,6 +574,7 @@
576574 [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk,
577575 [QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk,
578576 [QUIRK_SETUP_FMT_AFTER_RESUME] = setup_fmt_after_resume_quirk,
577
+ [QUIRK_SETUP_DISABLE_AUTOSUSPEND] = setup_disable_autosuspend,
579578 };
580579
581580 if (quirk->type < QUIRK_TYPE_COUNT) {
....@@ -690,15 +689,133 @@
690689 }
691690
692691 /*
693
- * C-Media CM6206 is based on CM106 with two additional
694
- * registers that are not documented in the data sheet.
695
- * Values here are chosen based on sniffing USB traffic
696
- * under Windows.
692
+ * CM6206 registers from the CM6206 datasheet rev 2.1
697693 */
694
+#define CM6206_REG0_DMA_MASTER BIT(15)
695
+#define CM6206_REG0_SPDIFO_RATE_48K (2 << 12)
696
+#define CM6206_REG0_SPDIFO_RATE_96K (7 << 12)
697
+/* Bit 4 thru 11 is the S/PDIF category code */
698
+#define CM6206_REG0_SPDIFO_CAT_CODE_GENERAL (0 << 4)
699
+#define CM6206_REG0_SPDIFO_EMPHASIS_CD BIT(3)
700
+#define CM6206_REG0_SPDIFO_COPYRIGHT_NA BIT(2)
701
+#define CM6206_REG0_SPDIFO_NON_AUDIO BIT(1)
702
+#define CM6206_REG0_SPDIFO_PRO_FORMAT BIT(0)
703
+
704
+#define CM6206_REG1_TEST_SEL_CLK BIT(14)
705
+#define CM6206_REG1_PLLBIN_EN BIT(13)
706
+#define CM6206_REG1_SOFT_MUTE_EN BIT(12)
707
+#define CM6206_REG1_GPIO4_OUT BIT(11)
708
+#define CM6206_REG1_GPIO4_OE BIT(10)
709
+#define CM6206_REG1_GPIO3_OUT BIT(9)
710
+#define CM6206_REG1_GPIO3_OE BIT(8)
711
+#define CM6206_REG1_GPIO2_OUT BIT(7)
712
+#define CM6206_REG1_GPIO2_OE BIT(6)
713
+#define CM6206_REG1_GPIO1_OUT BIT(5)
714
+#define CM6206_REG1_GPIO1_OE BIT(4)
715
+#define CM6206_REG1_SPDIFO_INVALID BIT(3)
716
+#define CM6206_REG1_SPDIF_LOOP_EN BIT(2)
717
+#define CM6206_REG1_SPDIFO_DIS BIT(1)
718
+#define CM6206_REG1_SPDIFI_MIX BIT(0)
719
+
720
+#define CM6206_REG2_DRIVER_ON BIT(15)
721
+#define CM6206_REG2_HEADP_SEL_SIDE_CHANNELS (0 << 13)
722
+#define CM6206_REG2_HEADP_SEL_SURROUND_CHANNELS (1 << 13)
723
+#define CM6206_REG2_HEADP_SEL_CENTER_SUBW (2 << 13)
724
+#define CM6206_REG2_HEADP_SEL_FRONT_CHANNELS (3 << 13)
725
+#define CM6206_REG2_MUTE_HEADPHONE_RIGHT BIT(12)
726
+#define CM6206_REG2_MUTE_HEADPHONE_LEFT BIT(11)
727
+#define CM6206_REG2_MUTE_REAR_SURROUND_RIGHT BIT(10)
728
+#define CM6206_REG2_MUTE_REAR_SURROUND_LEFT BIT(9)
729
+#define CM6206_REG2_MUTE_SIDE_SURROUND_RIGHT BIT(8)
730
+#define CM6206_REG2_MUTE_SIDE_SURROUND_LEFT BIT(7)
731
+#define CM6206_REG2_MUTE_SUBWOOFER BIT(6)
732
+#define CM6206_REG2_MUTE_CENTER BIT(5)
733
+#define CM6206_REG2_MUTE_RIGHT_FRONT BIT(3)
734
+#define CM6206_REG2_MUTE_LEFT_FRONT BIT(3)
735
+#define CM6206_REG2_EN_BTL BIT(2)
736
+#define CM6206_REG2_MCUCLKSEL_1_5_MHZ (0)
737
+#define CM6206_REG2_MCUCLKSEL_3_MHZ (1)
738
+#define CM6206_REG2_MCUCLKSEL_6_MHZ (2)
739
+#define CM6206_REG2_MCUCLKSEL_12_MHZ (3)
740
+
741
+/* Bit 11..13 sets the sensitivity to FLY tuner volume control VP/VD signal */
742
+#define CM6206_REG3_FLYSPEED_DEFAULT (2 << 11)
743
+#define CM6206_REG3_VRAP25EN BIT(10)
744
+#define CM6206_REG3_MSEL1 BIT(9)
745
+#define CM6206_REG3_SPDIFI_RATE_44_1K BIT(0 << 7)
746
+#define CM6206_REG3_SPDIFI_RATE_48K BIT(2 << 7)
747
+#define CM6206_REG3_SPDIFI_RATE_32K BIT(3 << 7)
748
+#define CM6206_REG3_PINSEL BIT(6)
749
+#define CM6206_REG3_FOE BIT(5)
750
+#define CM6206_REG3_ROE BIT(4)
751
+#define CM6206_REG3_CBOE BIT(3)
752
+#define CM6206_REG3_LOSE BIT(2)
753
+#define CM6206_REG3_HPOE BIT(1)
754
+#define CM6206_REG3_SPDIFI_CANREC BIT(0)
755
+
756
+#define CM6206_REG5_DA_RSTN BIT(13)
757
+#define CM6206_REG5_AD_RSTN BIT(12)
758
+#define CM6206_REG5_SPDIFO_AD2SPDO BIT(12)
759
+#define CM6206_REG5_SPDIFO_SEL_FRONT (0 << 9)
760
+#define CM6206_REG5_SPDIFO_SEL_SIDE_SUR (1 << 9)
761
+#define CM6206_REG5_SPDIFO_SEL_CEN_LFE (2 << 9)
762
+#define CM6206_REG5_SPDIFO_SEL_REAR_SUR (3 << 9)
763
+#define CM6206_REG5_CODECM BIT(8)
764
+#define CM6206_REG5_EN_HPF BIT(7)
765
+#define CM6206_REG5_T_SEL_DSDA4 BIT(6)
766
+#define CM6206_REG5_T_SEL_DSDA3 BIT(5)
767
+#define CM6206_REG5_T_SEL_DSDA2 BIT(4)
768
+#define CM6206_REG5_T_SEL_DSDA1 BIT(3)
769
+#define CM6206_REG5_T_SEL_DSDAD_NORMAL 0
770
+#define CM6206_REG5_T_SEL_DSDAD_FRONT 4
771
+#define CM6206_REG5_T_SEL_DSDAD_S_SURROUND 5
772
+#define CM6206_REG5_T_SEL_DSDAD_CEN_LFE 6
773
+#define CM6206_REG5_T_SEL_DSDAD_R_SURROUND 7
774
+
698775 static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
699776 {
700777 int err = 0, reg;
701
- int val[] = {0x2004, 0x3000, 0xf800, 0x143f, 0x0000, 0x3000};
778
+ int val[] = {
779
+ /*
780
+ * Values here are chosen based on sniffing USB traffic
781
+ * under Windows.
782
+ *
783
+ * REG0: DAC is master, sample rate 48kHz, no copyright
784
+ */
785
+ CM6206_REG0_SPDIFO_RATE_48K |
786
+ CM6206_REG0_SPDIFO_COPYRIGHT_NA,
787
+ /*
788
+ * REG1: PLL binary search enable, soft mute enable.
789
+ */
790
+ CM6206_REG1_PLLBIN_EN |
791
+ CM6206_REG1_SOFT_MUTE_EN,
792
+ /*
793
+ * REG2: enable output drivers,
794
+ * select front channels to the headphone output,
795
+ * then mute the headphone channels, run the MCU
796
+ * at 1.5 MHz.
797
+ */
798
+ CM6206_REG2_DRIVER_ON |
799
+ CM6206_REG2_HEADP_SEL_FRONT_CHANNELS |
800
+ CM6206_REG2_MUTE_HEADPHONE_RIGHT |
801
+ CM6206_REG2_MUTE_HEADPHONE_LEFT,
802
+ /*
803
+ * REG3: default flyspeed, set 2.5V mic bias
804
+ * enable all line out ports and enable SPDIF
805
+ */
806
+ CM6206_REG3_FLYSPEED_DEFAULT |
807
+ CM6206_REG3_VRAP25EN |
808
+ CM6206_REG3_FOE |
809
+ CM6206_REG3_ROE |
810
+ CM6206_REG3_CBOE |
811
+ CM6206_REG3_LOSE |
812
+ CM6206_REG3_HPOE |
813
+ CM6206_REG3_SPDIFI_CANREC,
814
+ /* REG4 is just a bunch of GPIO lines */
815
+ 0x0000,
816
+ /* REG5: de-assert AD/DA reset signals */
817
+ CM6206_REG5_DA_RSTN |
818
+ CM6206_REG5_AD_RSTN };
702819
703820 for (reg = 0; reg < ARRAY_SIZE(val); reg++) {
704821 err = snd_usb_cm106_write_int_reg(dev, reg, val[reg]);
....@@ -743,11 +860,13 @@
743860 static int snd_usb_accessmusic_boot_quirk(struct usb_device *dev)
744861 {
745862 int err, actual_length;
746
-
747863 /* "midi send" enable */
748864 static const u8 seq[] = { 0x4e, 0x73, 0x52, 0x01 };
865
+ void *buf;
749866
750
- void *buf = kmemdup(seq, ARRAY_SIZE(seq), GFP_KERNEL);
867
+ if (usb_pipe_type_check(dev, usb_sndintpipe(dev, 0x05)))
868
+ return -EINVAL;
869
+ buf = kmemdup(seq, ARRAY_SIZE(seq), GFP_KERNEL);
751870 if (!buf)
752871 return -ENOMEM;
753872 err = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x05), buf,
....@@ -772,7 +891,9 @@
772891
773892 static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev)
774893 {
775
- int ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
894
+ int ret;
895
+
896
+ ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
776897 0xaf, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
777898 1, 0, NULL, 0, 1000);
778899
....@@ -903,20 +1024,146 @@
9031024 return 0;
9041025 }
9051026
1027
+
1028
+#define MICROBOOK_BUF_SIZE 128
1029
+
1030
+static int snd_usb_motu_microbookii_communicate(struct usb_device *dev, u8 *buf,
1031
+ int buf_size, int *length)
1032
+{
1033
+ int err, actual_length;
1034
+
1035
+ if (usb_pipe_type_check(dev, usb_sndintpipe(dev, 0x01)))
1036
+ return -EINVAL;
1037
+ err = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x01), buf, *length,
1038
+ &actual_length, 1000);
1039
+ if (err < 0)
1040
+ return err;
1041
+
1042
+ print_hex_dump(KERN_DEBUG, "MicroBookII snd: ", DUMP_PREFIX_NONE, 16, 1,
1043
+ buf, actual_length, false);
1044
+
1045
+ memset(buf, 0, buf_size);
1046
+
1047
+ if (usb_pipe_type_check(dev, usb_rcvintpipe(dev, 0x82)))
1048
+ return -EINVAL;
1049
+ err = usb_interrupt_msg(dev, usb_rcvintpipe(dev, 0x82), buf, buf_size,
1050
+ &actual_length, 1000);
1051
+ if (err < 0)
1052
+ return err;
1053
+
1054
+ print_hex_dump(KERN_DEBUG, "MicroBookII rcv: ", DUMP_PREFIX_NONE, 16, 1,
1055
+ buf, actual_length, false);
1056
+
1057
+ *length = actual_length;
1058
+ return 0;
1059
+}
1060
+
1061
+static int snd_usb_motu_microbookii_boot_quirk(struct usb_device *dev)
1062
+{
1063
+ int err, actual_length, poll_attempts = 0;
1064
+ static const u8 set_samplerate_seq[] = { 0x00, 0x00, 0x00, 0x00,
1065
+ 0x00, 0x00, 0x0b, 0x14,
1066
+ 0x00, 0x00, 0x00, 0x01 };
1067
+ static const u8 poll_ready_seq[] = { 0x00, 0x04, 0x00, 0x00,
1068
+ 0x00, 0x00, 0x0b, 0x18 };
1069
+ u8 *buf = kzalloc(MICROBOOK_BUF_SIZE, GFP_KERNEL);
1070
+
1071
+ if (!buf)
1072
+ return -ENOMEM;
1073
+
1074
+ dev_info(&dev->dev, "Waiting for MOTU Microbook II to boot up...\n");
1075
+
1076
+ /* First we tell the device which sample rate to use. */
1077
+ memcpy(buf, set_samplerate_seq, sizeof(set_samplerate_seq));
1078
+ actual_length = sizeof(set_samplerate_seq);
1079
+ err = snd_usb_motu_microbookii_communicate(dev, buf, MICROBOOK_BUF_SIZE,
1080
+ &actual_length);
1081
+
1082
+ if (err < 0) {
1083
+ dev_err(&dev->dev,
1084
+ "failed setting the sample rate for Motu MicroBook II: %d\n",
1085
+ err);
1086
+ goto free_buf;
1087
+ }
1088
+
1089
+ /* Then we poll every 100 ms until the device informs of its readiness. */
1090
+ while (true) {
1091
+ if (++poll_attempts > 100) {
1092
+ dev_err(&dev->dev,
1093
+ "failed booting Motu MicroBook II: timeout\n");
1094
+ err = -ENODEV;
1095
+ goto free_buf;
1096
+ }
1097
+
1098
+ memset(buf, 0, MICROBOOK_BUF_SIZE);
1099
+ memcpy(buf, poll_ready_seq, sizeof(poll_ready_seq));
1100
+
1101
+ actual_length = sizeof(poll_ready_seq);
1102
+ err = snd_usb_motu_microbookii_communicate(
1103
+ dev, buf, MICROBOOK_BUF_SIZE, &actual_length);
1104
+ if (err < 0) {
1105
+ dev_err(&dev->dev,
1106
+ "failed booting Motu MicroBook II: communication error %d\n",
1107
+ err);
1108
+ goto free_buf;
1109
+ }
1110
+
1111
+ /* the device signals its readiness through a message of the
1112
+ * form
1113
+ * XX 06 00 00 00 00 0b 18 00 00 00 01
1114
+ * If the device is not yet ready to accept audio data, the
1115
+ * last byte of that sequence is 00.
1116
+ */
1117
+ if (actual_length == 12 && buf[actual_length - 1] == 1)
1118
+ break;
1119
+
1120
+ msleep(100);
1121
+ }
1122
+
1123
+ dev_info(&dev->dev, "MOTU MicroBook II ready\n");
1124
+
1125
+free_buf:
1126
+ kfree(buf);
1127
+ return err;
1128
+}
1129
+
1130
+static int snd_usb_motu_m_series_boot_quirk(struct usb_device *dev)
1131
+{
1132
+ int ret;
1133
+
1134
+ ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
1135
+ 1, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1136
+ 0x0, 0, NULL, 0, 1000);
1137
+
1138
+ if (ret < 0)
1139
+ return ret;
1140
+
1141
+ msleep(2000);
1142
+
1143
+ ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
1144
+ 1, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1145
+ 0x20, 0, NULL, 0, 1000);
1146
+
1147
+ if (ret < 0)
1148
+ return ret;
1149
+
1150
+ return 0;
1151
+}
1152
+
9061153 /*
9071154 * Setup quirks
9081155 */
9091156 #define MAUDIO_SET 0x01 /* parse device_setup */
9101157 #define MAUDIO_SET_COMPATIBLE 0x80 /* use only "win-compatible" interfaces */
9111158 #define MAUDIO_SET_DTS 0x02 /* enable DTS Digital Output */
912
-#define MAUDIO_SET_96K 0x04 /* 48-96KHz rate if set, 8-48KHz otherwise */
1159
+#define MAUDIO_SET_96K 0x04 /* 48-96kHz rate if set, 8-48kHz otherwise */
9131160 #define MAUDIO_SET_24B 0x08 /* 24bits sample if set, 16bits otherwise */
9141161 #define MAUDIO_SET_DI 0x10 /* enable Digital Input */
9151162 #define MAUDIO_SET_MASK 0x1f /* bit mask for setup value */
916
-#define MAUDIO_SET_24B_48K_DI 0x19 /* 24bits+48KHz+Digital Input */
917
-#define MAUDIO_SET_24B_48K_NOTDI 0x09 /* 24bits+48KHz+No Digital Input */
918
-#define MAUDIO_SET_16B_48K_DI 0x11 /* 16bits+48KHz+Digital Input */
919
-#define MAUDIO_SET_16B_48K_NOTDI 0x01 /* 16bits+48KHz+No Digital Input */
1163
+#define MAUDIO_SET_24B_48K_DI 0x19 /* 24bits+48kHz+Digital Input */
1164
+#define MAUDIO_SET_24B_48K_NOTDI 0x09 /* 24bits+48kHz+No Digital Input */
1165
+#define MAUDIO_SET_16B_48K_DI 0x11 /* 16bits+48kHz+Digital Input */
1166
+#define MAUDIO_SET_16B_48K_NOTDI 0x01 /* 16bits+48kHz+No Digital Input */
9201167
9211168 static int quattro_skip_setting_quirk(struct snd_usb_audio *chip,
9221169 int iface, int altno)
....@@ -1017,6 +1264,38 @@
10171264 return 0; /* keep this altsetting */
10181265 }
10191266
1267
+static int s1810c_skip_setting_quirk(struct snd_usb_audio *chip,
1268
+ int iface, int altno)
1269
+{
1270
+ /*
1271
+ * Altno settings:
1272
+ *
1273
+ * Playback (Interface 1):
1274
+ * 1: 6 Analog + 2 S/PDIF
1275
+ * 2: 6 Analog + 2 S/PDIF
1276
+ * 3: 6 Analog
1277
+ *
1278
+ * Capture (Interface 2):
1279
+ * 1: 8 Analog + 2 S/PDIF + 8 ADAT
1280
+ * 2: 8 Analog + 2 S/PDIF + 4 ADAT
1281
+ * 3: 8 Analog
1282
+ */
1283
+
1284
+ /*
1285
+ * I'll leave 2 as the default one and
1286
+ * use device_setup to switch to the
1287
+ * other two.
1288
+ */
1289
+ if ((chip->setup == 0 || chip->setup > 2) && altno != 2)
1290
+ return 1;
1291
+ else if (chip->setup == 1 && altno != 1)
1292
+ return 1;
1293
+ else if (chip->setup == 2 && altno != 3)
1294
+ return 1;
1295
+
1296
+ return 0;
1297
+}
1298
+
10201299 int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip,
10211300 int iface,
10221301 int altno)
....@@ -1030,6 +1309,10 @@
10301309 /* fasttrackpro usb: skip altsets incompatible with device_setup */
10311310 if (chip->usb_id == USB_ID(0x0763, 0x2012))
10321311 return fasttrackpro_skip_setting_quirk(chip, iface, altno);
1312
+ /* presonus studio 1810c: skip altsets incompatible with device_setup */
1313
+ if (chip->usb_id == USB_ID(0x194f, 0x010c))
1314
+ return s1810c_skip_setting_quirk(chip, iface, altno);
1315
+
10331316
10341317 return 0;
10351318 }
....@@ -1080,6 +1363,29 @@
10801363 return snd_usb_gamecon780_boot_quirk(dev);
10811364 case USB_ID(0x2466, 0x8010): /* Fractal Audio Axe-Fx 3 */
10821365 return snd_usb_axefx3_boot_quirk(dev);
1366
+ case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook II */
1367
+ /*
1368
+ * For some reason interface 3 with vendor-spec class is
1369
+ * detected on MicroBook IIc.
1370
+ */
1371
+ if (get_iface_desc(intf->altsetting)->bInterfaceClass ==
1372
+ USB_CLASS_VENDOR_SPEC &&
1373
+ get_iface_desc(intf->altsetting)->bInterfaceNumber < 3)
1374
+ return snd_usb_motu_microbookii_boot_quirk(dev);
1375
+ break;
1376
+ }
1377
+
1378
+ return 0;
1379
+}
1380
+
1381
+int snd_usb_apply_boot_quirk_once(struct usb_device *dev,
1382
+ struct usb_interface *intf,
1383
+ const struct snd_usb_audio_quirk *quirk,
1384
+ unsigned int id)
1385
+{
1386
+ switch (id) {
1387
+ case USB_ID(0x07fd, 0x0008): /* MOTU M Series */
1388
+ return snd_usb_motu_m_series_boot_quirk(dev);
10831389 }
10841390
10851391 return 0;
....@@ -1164,6 +1470,30 @@
11641470 subs->pkt_offset_adj = (emu_samplerate_id >= EMU_QUIRK_SR_176400HZ) ? 4 : 0;
11651471 }
11661472
1473
+
1474
+/*
1475
+ * Pioneer DJ DJM-900NXS2
1476
+ * Device needs to know the sample rate each time substream is started
1477
+ */
1478
+static int pioneer_djm_set_format_quirk(struct snd_usb_substream *subs)
1479
+{
1480
+
1481
+ /* Convert sample rate value to little endian */
1482
+ u8 sr[3];
1483
+
1484
+ sr[0] = subs->cur_rate & 0xff;
1485
+ sr[1] = (subs->cur_rate >> 8) & 0xff;
1486
+ sr[2] = (subs->cur_rate >> 16) & 0xff;
1487
+
1488
+ /* Configure device */
1489
+ usb_set_interface(subs->dev, 0, 1);
1490
+ snd_usb_ctl_msg(subs->stream->chip->dev,
1491
+ usb_rcvctrlpipe(subs->stream->chip->dev, 0),
1492
+ 0x01, 0x22, 0x0100, 0x0082, &sr, 0x0003);
1493
+
1494
+ return 0;
1495
+}
1496
+
11671497 void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
11681498 struct audioformat *fmt)
11691499 {
....@@ -1174,6 +1504,14 @@
11741504 case USB_ID(0x041e, 0x3f19): /* E-Mu 0204 USB */
11751505 set_format_emu_quirk(subs, fmt);
11761506 break;
1507
+ case USB_ID(0x2b73, 0x000a): /* Pioneer DJ DJM-900NXS2 */
1508
+ case USB_ID(0x2b73, 0x0017): /* Pioneer DJ DJM-250MK2 */
1509
+ pioneer_djm_set_format_quirk(subs);
1510
+ break;
1511
+ case USB_ID(0x534d, 0x0021): /* MacroSilicon MS2100/MS2106 */
1512
+ case USB_ID(0x534d, 0x2109): /* MacroSilicon MS2109 */
1513
+ subs->stream_offset_adj = 2;
1514
+ break;
11771515 }
11781516 }
11791517
....@@ -1181,18 +1519,15 @@
11811519 {
11821520 /* devices which do not support reading the sample rate. */
11831521 switch (chip->usb_id) {
1184
- case USB_ID(0x041E, 0x4080): /* Creative Live Cam VF0610 */
1185
- case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */
1522
+ case USB_ID(0x041e, 0x4080): /* Creative Live Cam VF0610 */
1523
+ case USB_ID(0x04d8, 0xfeea): /* Benchmark DAC1 Pre */
11861524 case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */
1187
- case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */
1525
+ case USB_ID(0x05a3, 0x9420): /* ELP HD USB Camera */
11881526 case USB_ID(0x05a7, 0x1020): /* Bose Companion 5 */
1189
-#ifdef CONFIG_HID_RKVR
1190
- case USB_ID(0x071B, 0x3205): /* RockChip NanoC VR */
1191
-#endif
1192
- case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */
1527
+ case USB_ID(0x074d, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */
11931528 case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */
11941529 case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */
1195
- case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */
1530
+ case USB_ID(0x21b4, 0x0081): /* AudioQuest DragonFly */
11961531 case USB_ID(0x2912, 0x30c8): /* Audioengine D1 */
11971532 case USB_ID(0x413c, 0xa506): /* Dell AE515 sound bar */
11981533 case USB_ID(0x046d, 0x084c): /* Logitech ConferenceCam Connect */
....@@ -1201,8 +1536,8 @@
12011536
12021537 /* devices of these vendors don't support reading rate, either */
12031538 switch (USB_ID_VENDOR(chip->usb_id)) {
1204
- case 0x045E: /* MS Lifecam */
1205
- case 0x047F: /* Plantronics */
1539
+ case 0x045e: /* MS Lifecam */
1540
+ case 0x047f: /* Plantronics */
12061541 case 0x1de7: /* Phoenix Audio */
12071542 return true;
12081543 }
....@@ -1281,7 +1616,7 @@
12811616
12821617 /*
12831618 * M-Audio Fast Track C400/C600 - when packets are not skipped, real
1284
- * world latency varies by approx. +/- 50 frames (at 96KHz) each time
1619
+ * world latency varies by approx. +/- 50 frames (at 96kHz) each time
12851620 * the stream is (re)started. When skipping packets 16 at endpoint
12861621 * start up, the real world latency is stable within +/- 1 frame (also
12871622 * across power cycles).
....@@ -1409,6 +1744,7 @@
14091744 /* XMOS based USB DACs */
14101745 switch (chip->usb_id) {
14111746 case USB_ID(0x1511, 0x0037): /* AURALiC VEGA */
1747
+ case USB_ID(0x21ed, 0xd75a): /* Accuphase DAC-60 option card */
14121748 case USB_ID(0x2522, 0x0012): /* LH Labs VI DAC Infinity */
14131749 case USB_ID(0x2772, 0x0230): /* Pro-Ject Pre Box S2 Digital */
14141750 if (fp->altsetting == 2)
....@@ -1504,9 +1840,6 @@
15041840 int stream)
15051841 {
15061842 switch (chip->usb_id) {
1507
-#ifdef CONFIG_HID_RKVR
1508
- case USB_ID(0x071B, 0x3205): /* RockChip NanoC VR */
1509
-#endif
15101843 case USB_ID(0x0a92, 0x0053): /* AudioTrak Optoplay */
15111844 /* Optoplay sets the sample rate attribute although
15121845 * it seems not supporting it in fact.
....@@ -1532,6 +1865,14 @@
15321865 fp->ep_attr |= USB_ENDPOINT_SYNC_ADAPTIVE;
15331866 else
15341867 fp->ep_attr |= USB_ENDPOINT_SYNC_SYNC;
1868
+ break;
1869
+ case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook IIc */
1870
+ /*
1871
+ * MaxPacketsOnly attribute is erroneously set in endpoint
1872
+ * descriptors. As a result this card produces noise with
1873
+ * all sample rates other than 96 kHz.
1874
+ */
1875
+ fp->attributes &= ~UAC_EP_CS_ATTR_FILL_MAX;
15351876 break;
15361877 }
15371878 }
....@@ -1572,7 +1913,7 @@
15721913
15731914 for (q = registration_quirks; q->usb_id; q++)
15741915 if (chip->usb_id == q->usb_id)
1575
- return iface != q->interface;
1916
+ return iface < q->interface;
15761917
15771918 /* Register as normal */
15781919 return false;