18 #include <linux/slab.h>
20 #include <linux/usb/audio.h>
47 int probed_ifnum =
get_iface_desc(iface->altsetting)->bInterfaceNumber;
50 for (quirk = quirk->
data; quirk->
ifnum >= 0; ++quirk) {
54 if (quirk->
ifnum != probed_ifnum &&
55 usb_interface_claimed(iface))
60 if (quirk->
ifnum != probed_ifnum)
68 struct usb_driver *driver,
79 static int create_align_transfer_quirk(
struct snd_usb_audio *chip,
81 struct usb_driver *driver,
90 struct usb_driver *driver,
99 static int create_standard_audio_quirk(
struct snd_usb_audio *chip,
101 struct usb_driver *driver,
104 struct usb_host_interface *alts;
108 alts = &iface->altsetting[0];
124 static int create_fixed_stream_quirk(
struct snd_usb_audio *chip,
126 struct usb_driver *driver,
130 struct usb_host_interface *alts;
182 struct usb_driver *driver,
193 struct usb_host_interface *alts;
199 if (iface->num_altsetting < 2)
201 alts = &iface->altsetting[1];
223 ? &ua700_quirk : &uaxx_quirk;
273 static int create_standard_mixer_quirk(
struct snd_usb_audio *chip,
275 struct usb_driver *driver,
278 if (quirk->
ifnum < 0)
294 struct usb_driver *driver,
301 static const quirk_func_t quirk_funcs[] = {
333 #define EXTIGY_FIRMWARE_SIZE_OLD 794
334 #define EXTIGY_FIRMWARE_SIZE_NEW 483
338 struct usb_host_config *
config = dev->actconfig;
346 0x10, 0x43, 0x0001, 0x000a,
NULL, 0);
347 if (err < 0)
snd_printdd(
"error sending boot message: %d\n", err);
349 &dev->descriptor,
sizeof(dev->descriptor));
350 config = dev->actconfig;
351 if (err < 0)
snd_printdd(
"error usb_get_descriptor: %d\n", err);
353 if (err < 0)
snd_printdd(
"error usb_reset_configuration: %d\n", err);
361 static int snd_usb_audigy2nx_boot_quirk(
struct usb_device *
dev)
377 static int snd_usb_fasttrackpro_boot_quirk(
struct usb_device *dev)
381 if (dev->actconfig->desc.bConfigurationValue == 1) {
383 "Fast Track Pro switching to config #2\n");
391 snd_printdd(
"error usb_driver_set_configuration: %d\n",
405 static int snd_usb_cm106_write_int_reg(
struct usb_device *dev,
int reg,
u16 value)
409 buf[1] = value & 0xff;
410 buf[2] = (value >> 8) & 0xff;
417 static int snd_usb_cm106_boot_quirk(
struct usb_device *dev)
423 return snd_usb_cm106_write_int_reg(dev, 2, 0x8004);
432 static int snd_usb_cm6206_boot_quirk(
struct usb_device *dev)
435 int val[] = {0x2004, 0x3000, 0xf800, 0x143f, 0x0000, 0x3000};
438 err = snd_usb_cm106_write_int_reg(dev, reg, val[reg]);
453 static int snd_usb_accessmusic_boot_quirk(
struct usb_device *dev)
455 int err, actual_length;
458 static const u8 seq[] = { 0x4e, 0x73, 0x52, 0x01 };
483 static int snd_usb_nativeinstruments_boot_quirk(
struct usb_device *dev)
503 #define MAUDIO_SET 0x01
504 #define MAUDIO_SET_COMPATIBLE 0x80
505 #define MAUDIO_SET_DTS 0x02
506 #define MAUDIO_SET_96K 0x04
507 #define MAUDIO_SET_24B 0x08
508 #define MAUDIO_SET_DI 0x10
509 #define MAUDIO_SET_MASK 0x1f
510 #define MAUDIO_SET_24B_48K_DI 0x19
511 #define MAUDIO_SET_24B_48K_NOTDI 0x09
512 #define MAUDIO_SET_16B_48K_DI 0x11
513 #define MAUDIO_SET_16B_48K_NOTDI 0x01
515 static int quattro_skip_setting_quirk(
struct snd_usb_audio *chip,
516 int iface,
int altno)
524 if (iface != 1 && iface != 2)
528 if (iface == 1 || iface == 2)
542 "using altsetting %d for interface %d config %d\n",
543 altno, iface, chip->
setup);
547 static int audiophile_skip_setting_quirk(
struct snd_usb_audio *chip,
577 static int fasttrackpro_skip_setting_quirk(
struct snd_usb_audio *chip,
578 int iface,
int altno)
590 if (altno != 3 && altno != 6)
595 if (altno != 2 && altno != 5)
600 if (altno != 2 && altno != 5)
610 "using altsetting %d for interface %d config %d\n",
611 altno, iface, chip->
setup);
621 return audiophile_skip_setting_quirk(chip, iface, altno);
624 return quattro_skip_setting_quirk(chip, iface, altno);
627 return fasttrackpro_skip_setting_quirk(chip, iface, altno);
640 case USB_ID(0x041e, 0x3000):
643 return snd_usb_extigy_boot_quirk(dev, intf);
645 case USB_ID(0x041e, 0x3020):
647 return snd_usb_audigy2nx_boot_quirk(dev);
649 case USB_ID(0x10f5, 0x0200):
651 return snd_usb_cm106_boot_quirk(dev);
653 case USB_ID(0x0d8c, 0x0102):
655 case USB_ID(0x0ccd, 0x00b1):
656 return snd_usb_cm6206_boot_quirk(dev);
658 case USB_ID(0x133e, 0x0815):
660 return snd_usb_accessmusic_boot_quirk(dev);
662 case USB_ID(0x17cc, 0x1000):
663 case USB_ID(0x17cc, 0x1010):
664 case USB_ID(0x17cc, 0x1020):
665 return snd_usb_nativeinstruments_boot_quirk(dev);
666 case USB_ID(0x0763, 0x2012):
667 return snd_usb_fasttrackpro_boot_quirk(dev);
680 case USB_ID(0x0763, 0x2001):
685 case USB_ID(0x0763, 0x2003):
686 if (chip->
setup == 0x00 ||
691 case USB_ID(0x0763, 0x2012):
717 unsigned char emu_samplerate_id = 0;
754 switch (subs->
stream->chip->usb_id) {
755 case USB_ID(0x041e, 0x3f02):
756 case USB_ID(0x041e, 0x3f04):
757 case USB_ID(0x041e, 0x3f0a):
758 case USB_ID(0x041e, 0x3f19):
759 set_format_emu_quirk(subs, fmt);
783 if ((
le16_to_cpu(dev->descriptor.idVendor) == 0x23ba) &&