aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/quirks.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r--sound/usb/quirks.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index f104c68fe1e0..2c971858d6b7 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -306,7 +306,6 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
306 [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk, 306 [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,
307 [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk, 307 [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk,
308 [QUIRK_MIDI_NOVATION] = create_any_midi_quirk, 308 [QUIRK_MIDI_NOVATION] = create_any_midi_quirk,
309 [QUIRK_MIDI_MBOX2] = create_any_midi_quirk,
310 [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk, 309 [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk,
311 [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk, 310 [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
312 [QUIRK_MIDI_CME] = create_any_midi_quirk, 311 [QUIRK_MIDI_CME] = create_any_midi_quirk,
@@ -388,11 +387,13 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev)
388 * rules 387 * rules
389 */ 388 */
390 err = usb_driver_set_configuration(dev, 2); 389 err = usb_driver_set_configuration(dev, 2);
391 if (err < 0) { 390 if (err < 0)
392 snd_printdd("error usb_driver_set_configuration: %d\n", 391 snd_printdd("error usb_driver_set_configuration: %d\n",
393 err); 392 err);
394 return -ENODEV; 393 /* Always return an error, so that we stop creating a device
395 } 394 that will just be destroyed and recreated with a new
395 configuration */
396 return -ENODEV;
396 } else 397 } else
397 snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n"); 398 snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n");
398 399
@@ -528,11 +529,11 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev)
528#define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */ 529#define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */
529#define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */ 530#define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */
530 531
531int snd_usb_mbox2_boot_quirk(struct usb_device *dev) 532static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
532{ 533{
533 struct usb_host_config *config = dev->actconfig; 534 struct usb_host_config *config = dev->actconfig;
534 int err; 535 int err;
535 u8 bootresponse; 536 u8 bootresponse[12];
536 int fwsize; 537 int fwsize;
537 int count; 538 int count;
538 539
@@ -546,20 +547,20 @@ int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
546 snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n"); 547 snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n");
547 548
548 count = 0; 549 count = 0;
549 bootresponse = MBOX2_BOOT_LOADING; 550 bootresponse[0] = MBOX2_BOOT_LOADING;
550 while ((bootresponse == MBOX2_BOOT_LOADING) && (count < 10)) { 551 while ((bootresponse[0] == MBOX2_BOOT_LOADING) && (count < 10)) {
551 msleep(500); /* 0.5 second delay */ 552 msleep(500); /* 0.5 second delay */
552 snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 553 snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
553 /* Control magic - load onboard firmware */ 554 /* Control magic - load onboard firmware */
554 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012); 555 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012);
555 if (bootresponse == MBOX2_BOOT_READY) 556 if (bootresponse[0] == MBOX2_BOOT_READY)
556 break; 557 break;
557 snd_printd("usb-audio: device not ready, resending boot sequence...\n"); 558 snd_printd("usb-audio: device not ready, resending boot sequence...\n");
558 count++; 559 count++;
559 } 560 }
560 561
561 if (bootresponse != MBOX2_BOOT_READY) { 562 if (bootresponse[0] != MBOX2_BOOT_READY) {
562 snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse); 563 snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]);
563 return -ENODEV; 564 return -ENODEV;
564 } 565 }
565 566
@@ -660,7 +661,6 @@ static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip,
660 return 0; /* keep this altsetting */ 661 return 0; /* keep this altsetting */
661} 662}
662 663
663
664static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip, 664static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
665 int iface, int altno) 665 int iface, int altno)
666{ 666{
@@ -861,6 +861,17 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep)
861 if ((le16_to_cpu(ep->chip->dev->descriptor.idVendor) == 0x23ba) && 861 if ((le16_to_cpu(ep->chip->dev->descriptor.idVendor) == 0x23ba) &&
862 ep->type == SND_USB_ENDPOINT_TYPE_SYNC) 862 ep->type == SND_USB_ENDPOINT_TYPE_SYNC)
863 ep->skip_packets = 4; 863 ep->skip_packets = 4;
864
865 /*
866 * M-Audio Fast Track C400 - when packets are not skipped, real world
867 * latency varies by approx. +/- 50 frames (at 96KHz) each time the
868 * stream is (re)started. When skipping packets 16 at endpoint start
869 * up, the real world latency is stable within +/- 1 frame (also
870 * across power cycles).
871 */
872 if (ep->chip->usb_id == USB_ID(0x0763, 0x2030) &&
873 ep->type == SND_USB_ENDPOINT_TYPE_DATA)
874 ep->skip_packets = 16;
864} 875}
865 876
866void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, 877void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,