24 #include <linux/module.h>
42 "{Native Instruments, RigKontrol3},"
43 "{Native Instruments, Kore Controller},"
44 "{Native Instruments, Kore Controller 2},"
45 "{Native Instruments, Audio Kontrol 1},"
46 "{Native Instruments, Audio 2 DJ},"
47 "{Native Instruments, Audio 4 DJ},"
48 "{Native Instruments, Audio 8 DJ},"
49 "{Native Instruments, Traktor Audio 2},"
50 "{Native Instruments, Session I/O},"
51 "{Native Instruments, GuitarRig mobile}"
52 "{Native Instruments, Traktor Kontrol X1}"
53 "{Native Instruments, Traktor Kontrol S4}"
54 "{Native Instruments, Maschine Controller}");
86 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
91 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
96 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
101 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
106 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
111 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
116 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
121 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
126 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
131 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
136 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
141 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
146 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
151 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
158 static void usb_ep1_command_reply_dispatch (
struct urb*
urb)
162 unsigned char *
buf = urb->transfer_buffer;
164 if (urb->status || !dev) {
165 log(
"received EP1 urb->status = %i\n", urb->status);
173 debug(
"device spec (firmware %d): audio: %d in, %d out, "
174 "MIDI: %d in, %d out, data alignment %d\n",
175 dev->
spec.fw_version,
176 dev->
spec.num_analog_audio_in,
177 dev->
spec.num_analog_audio_out,
178 dev->
spec.num_midi_in,
179 dev->
spec.num_midi_out,
180 dev->
spec.data_alignment);
193 if (dev->
chip.usb_id ==
201 #ifdef CONFIG_SND_USB_CAIAQ_INPUT
212 log(
"unable to submit urb. OOM!?\n");
217 const unsigned char *
buffer,
221 struct usb_device *usb_dev = dev->
chip.dev;
229 if (buffer && len > 0)
233 return usb_bulk_msg(usb_dev, usb_sndbulkpipe(usb_dev, 1),
262 debug(
"setting audio params: %d Hz, %d bits, %d bpp\n",
277 debug(
"unable to set the device's audio params\n");
298 switch (dev->
chip.usb_id) {
321 dev->control_state[0] = 0xff;
343 if (dev->
spec.num_analog_audio_out +
344 dev->
spec.num_analog_audio_in +
345 dev->
spec.num_digital_audio_out +
346 dev->
spec.num_digital_audio_in > 0) {
349 log(
"Unable to set up audio system (ret=%d)\n", ret);
352 if (dev->
spec.num_midi_in +
353 dev->
spec.num_midi_out > 0) {
356 log(
"Unable to set up MIDI system (ret=%d)\n", ret);
359 #ifdef CONFIG_SND_USB_CAIAQ_INPUT
362 log(
"Unable to set up input system (ret=%d)\n", ret);
368 log(
"snd_card_register() returned %d\n", ret);
374 log(
"Unable to set up control system (ret=%d)\n", ret);
377 static int create_card(
struct usb_device *usb_dev,
387 if (
enable[devnum] && !snd_card_used[devnum])
390 if (devnum >= SNDRV_CARDS)
399 dev->
chip.dev = usb_dev;
412 char *
c, usbpath[32];
413 struct usb_device *usb_dev = dev->
chip.dev;
418 log(
"can't set alt interface.\n");
426 usb_rcvbulkpipe(usb_dev, 0x1),
428 usb_ep1_command_reply_dispatch, dev);
431 usb_sndbulkpipe(usb_dev, 0x1),
448 usb_string(usb_dev, usb_dev->descriptor.iManufacturer,
451 usb_string(usb_dev, usb_dev->descriptor.iProduct,
462 if (*card->
id ==
'\0') {
463 char id[
sizeof(card->
id)];
465 memset(
id, 0,
sizeof(
id));
468 *c && len <
sizeof(card->
id); c++)
475 usb_make_path(usb_dev, usbpath,
sizeof(usbpath));
489 struct usb_device *
device = interface_to_usbdev(intf);
491 ret = create_card(device, intf, &card);
496 usb_set_intfdata(intf, card);
499 log(
"unable to init card! (ret=%d)\n", ret);
510 struct snd_card *card = usb_get_intfdata(intf);
512 debug(
"%s(%p)\n", __func__, intf);
520 #ifdef CONFIG_SND_USB_CAIAQ_INPUT
534 static struct usb_driver snd_usb_driver = {
537 .disconnect = snd_disconnect,
538 .id_table = snd_usb_id_table,