aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/quirks.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /sound/usb/quirks.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r--sound/usb/quirks.c85
1 files changed, 69 insertions, 16 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 9a9da09586a5..090e1930dfdc 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -19,6 +19,7 @@
19#include <linux/usb.h> 19#include <linux/usb.h>
20#include <linux/usb/audio.h> 20#include <linux/usb/audio.h>
21 21
22#include <sound/control.h>
22#include <sound/core.h> 23#include <sound/core.h>
23#include <sound/info.h> 24#include <sound/info.h>
24#include <sound/pcm.h> 25#include <sound/pcm.h>
@@ -263,10 +264,24 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip,
263} 264}
264 265
265/* 266/*
267 * Create a standard mixer for the specified interface.
268 */
269static int create_standard_mixer_quirk(struct snd_usb_audio *chip,
270 struct usb_interface *iface,
271 struct usb_driver *driver,
272 const struct snd_usb_audio_quirk *quirk)
273{
274 if (quirk->ifnum < 0)
275 return 0;
276
277 return snd_usb_create_mixer(chip, quirk->ifnum, 0);
278}
279
280/*
266 * audio-interface quirks 281 * audio-interface quirks
267 * 282 *
268 * returns zero if no standard audio/MIDI parsing is needed. 283 * returns zero if no standard audio/MIDI parsing is needed.
269 * returns a postive value if standard audio/midi interfaces are parsed 284 * returns a positive value if standard audio/midi interfaces are parsed
270 * after this. 285 * after this.
271 * returns a negative value at error. 286 * returns a negative value at error.
272 */ 287 */
@@ -287,14 +302,15 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
287 [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk, 302 [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,
288 [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk, 303 [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk,
289 [QUIRK_MIDI_NOVATION] = create_any_midi_quirk, 304 [QUIRK_MIDI_NOVATION] = create_any_midi_quirk,
290 [QUIRK_MIDI_FASTLANE] = create_any_midi_quirk, 305 [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk,
291 [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk, 306 [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
292 [QUIRK_MIDI_CME] = create_any_midi_quirk, 307 [QUIRK_MIDI_CME] = create_any_midi_quirk,
293 [QUIRK_MIDI_AKAI] = create_any_midi_quirk, 308 [QUIRK_MIDI_AKAI] = create_any_midi_quirk,
294 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, 309 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
295 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, 310 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
296 [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk, 311 [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk,
297 [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk 312 [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk,
313 [QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk,
298 }; 314 };
299 315
300 if (quirk->type < QUIRK_TYPE_COUNT) { 316 if (quirk->type < QUIRK_TYPE_COUNT) {
@@ -387,7 +403,7 @@ static int snd_usb_cm106_boot_quirk(struct usb_device *dev)
387static int snd_usb_cm6206_boot_quirk(struct usb_device *dev) 403static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
388{ 404{
389 int err, reg; 405 int err, reg;
390 int val[] = {0x200c, 0x3000, 0xf800, 0x143f, 0x0000, 0x3000}; 406 int val[] = {0x2004, 0x3000, 0xf800, 0x143f, 0x0000, 0x3000};
391 407
392 for (reg = 0; reg < ARRAY_SIZE(val); reg++) { 408 for (reg = 0; reg < ARRAY_SIZE(val); reg++) {
393 err = snd_usb_cm106_write_int_reg(dev, reg, val[reg]); 409 err = snd_usb_cm106_write_int_reg(dev, reg, val[reg]);
@@ -425,6 +441,34 @@ static int snd_usb_accessmusic_boot_quirk(struct usb_device *dev)
425} 441}
426 442
427/* 443/*
444 * Some sound cards from Native Instruments are in fact compliant to the USB
445 * audio standard of version 2 and other approved USB standards, even though
446 * they come up as vendor-specific device when first connected.
447 *
448 * However, they can be told to come up with a new set of descriptors
449 * upon their next enumeration, and the interfaces announced by the new
450 * descriptors will then be handled by the kernel's class drivers. As the
451 * product ID will also change, no further checks are required.
452 */
453
454static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev)
455{
456 int ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
457 0xaf, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
458 cpu_to_le16(1), 0, NULL, 0, 1000);
459
460 if (ret < 0)
461 return ret;
462
463 usb_reset_device(dev);
464
465 /* return -EAGAIN, so the creation of an audio interface for this
466 * temporary device is aborted. The device will reconnect with a
467 * new product ID */
468 return -EAGAIN;
469}
470
471/*
428 * Setup quirks 472 * Setup quirks
429 */ 473 */
430#define AUDIOPHILE_SET 0x01 /* if set, parse device_setup */ 474#define AUDIOPHILE_SET 0x01 /* if set, parse device_setup */
@@ -489,27 +533,35 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
489 u32 id = USB_ID(le16_to_cpu(dev->descriptor.idVendor), 533 u32 id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
490 le16_to_cpu(dev->descriptor.idProduct)); 534 le16_to_cpu(dev->descriptor.idProduct));
491 535
492 /* SB Extigy needs special boot-up sequence */ 536 switch (id) {
493 /* if more models come, this will go to the quirk list. */ 537 case USB_ID(0x041e, 0x3000):
494 if (id == USB_ID(0x041e, 0x3000)) 538 /* SB Extigy needs special boot-up sequence */
539 /* if more models come, this will go to the quirk list. */
495 return snd_usb_extigy_boot_quirk(dev, intf); 540 return snd_usb_extigy_boot_quirk(dev, intf);
496 541
497 /* SB Audigy 2 NX needs its own boot-up magic, too */ 542 case USB_ID(0x041e, 0x3020):
498 if (id == USB_ID(0x041e, 0x3020)) 543 /* SB Audigy 2 NX needs its own boot-up magic, too */
499 return snd_usb_audigy2nx_boot_quirk(dev); 544 return snd_usb_audigy2nx_boot_quirk(dev);
500 545
501 /* C-Media CM106 / Turtle Beach Audio Advantage Roadie */ 546 case USB_ID(0x10f5, 0x0200):
502 if (id == USB_ID(0x10f5, 0x0200)) 547 /* C-Media CM106 / Turtle Beach Audio Advantage Roadie */
503 return snd_usb_cm106_boot_quirk(dev); 548 return snd_usb_cm106_boot_quirk(dev);
504 549
505 /* C-Media CM6206 / CM106-Like Sound Device */ 550 case USB_ID(0x0d8c, 0x0102):
506 if (id == USB_ID(0x0d8c, 0x0102)) 551 /* C-Media CM6206 / CM106-Like Sound Device */
552 case USB_ID(0x0ccd, 0x00b1): /* Terratec Aureon 7.1 USB */
507 return snd_usb_cm6206_boot_quirk(dev); 553 return snd_usb_cm6206_boot_quirk(dev);
508 554
509 /* Access Music VirusTI Desktop */ 555 case USB_ID(0x133e, 0x0815):
510 if (id == USB_ID(0x133e, 0x0815)) 556 /* Access Music VirusTI Desktop */
511 return snd_usb_accessmusic_boot_quirk(dev); 557 return snd_usb_accessmusic_boot_quirk(dev);
512 558
559 case USB_ID(0x17cc, 0x1000): /* Komplete Audio 6 */
560 case USB_ID(0x17cc, 0x1010): /* Traktor Audio 6 */
561 case USB_ID(0x17cc, 0x1020): /* Traktor Audio 10 */
562 return snd_usb_nativeinstruments_boot_quirk(dev);
563 }
564
513 return 0; 565 return 0;
514} 566}
515 567
@@ -532,7 +584,7 @@ int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, struct audioformat
532} 584}
533 585
534/* 586/*
535 * For E-Mu 0404USB/0202USB/TrackerPre sample rate should be set for device, 587 * For E-Mu 0404USB/0202USB/TrackerPre/0204 sample rate should be set for device,
536 * not for interface. 588 * not for interface.
537 */ 589 */
538 590
@@ -589,6 +641,7 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
589 case USB_ID(0x041e, 0x3f02): /* E-Mu 0202 USB */ 641 case USB_ID(0x041e, 0x3f02): /* E-Mu 0202 USB */
590 case USB_ID(0x041e, 0x3f04): /* E-Mu 0404 USB */ 642 case USB_ID(0x041e, 0x3f04): /* E-Mu 0404 USB */
591 case USB_ID(0x041e, 0x3f0a): /* E-Mu Tracker Pre */ 643 case USB_ID(0x041e, 0x3f0a): /* E-Mu Tracker Pre */
644 case USB_ID(0x041e, 0x3f19): /* E-Mu 0204 USB */
592 set_format_emu_quirk(subs, fmt); 645 set_format_emu_quirk(subs, fmt);
593 break; 646 break;
594 } 647 }