diff options
Diffstat (limited to 'sound/usb/caiaq/caiaq-device.c')
-rw-r--r-- | sound/usb/caiaq/caiaq-device.c | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c index 41c36b055f6b..cf573a982fdc 100644 --- a/sound/usb/caiaq/caiaq-device.c +++ b/sound/usb/caiaq/caiaq-device.c | |||
@@ -42,15 +42,17 @@ | |||
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); | 44 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); |
45 | MODULE_DESCRIPTION("caiaq USB audio, version 1.3.10"); | 45 | MODULE_DESCRIPTION("caiaq USB audio, version 1.3.13"); |
46 | MODULE_LICENSE("GPL"); | 46 | MODULE_LICENSE("GPL"); |
47 | MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," | 47 | MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," |
48 | "{Native Instruments, RigKontrol3}," | 48 | "{Native Instruments, RigKontrol3}," |
49 | "{Native Instruments, Kore Controller}," | 49 | "{Native Instruments, Kore Controller}," |
50 | "{Native Instruments, Kore Controller 2}," | 50 | "{Native Instruments, Kore Controller 2}," |
51 | "{Native Instruments, Audio Kontrol 1}," | 51 | "{Native Instruments, Audio Kontrol 1}," |
52 | "{Native Instruments, Audio 4 DJ}," | ||
52 | "{Native Instruments, Audio 8 DJ}," | 53 | "{Native Instruments, Audio 8 DJ}," |
53 | "{Native Instruments, Session I/O}}"); | 54 | "{Native Instruments, Session I/O}," |
55 | "{Native Instruments, GuitarRig mobile}"); | ||
54 | 56 | ||
55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ | 57 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
56 | static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ | 58 | static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ |
@@ -116,6 +118,16 @@ static struct usb_device_id snd_usb_id_table[] = { | |||
116 | .idVendor = USB_VID_NATIVEINSTRUMENTS, | 118 | .idVendor = USB_VID_NATIVEINSTRUMENTS, |
117 | .idProduct = USB_PID_SESSIONIO | 119 | .idProduct = USB_PID_SESSIONIO |
118 | }, | 120 | }, |
121 | { | ||
122 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, | ||
123 | .idVendor = USB_VID_NATIVEINSTRUMENTS, | ||
124 | .idProduct = USB_PID_GUITARRIGMOBILE | ||
125 | }, | ||
126 | { | ||
127 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, | ||
128 | .idVendor = USB_VID_NATIVEINSTRUMENTS, | ||
129 | .idProduct = USB_PID_AUDIO4DJ | ||
130 | }, | ||
119 | { /* terminator */ } | 131 | { /* terminator */ } |
120 | }; | 132 | }; |
121 | 133 | ||
@@ -239,6 +251,8 @@ int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *dev, | |||
239 | 251 | ||
240 | if (dev->audio_parm_answer != 1) | 252 | if (dev->audio_parm_answer != 1) |
241 | debug("unable to set the device's audio params\n"); | 253 | debug("unable to set the device's audio params\n"); |
254 | else | ||
255 | dev->bpp = bpp; | ||
242 | 256 | ||
243 | return dev->audio_parm_answer == 1 ? 0 : -EINVAL; | 257 | return dev->audio_parm_answer == 1 ? 0 : -EINVAL; |
244 | } | 258 | } |
@@ -300,6 +314,12 @@ static void __devinit setup_card(struct snd_usb_caiaqdev *dev) | |||
300 | } | 314 | } |
301 | 315 | ||
302 | break; | 316 | break; |
317 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): | ||
318 | /* Audio 4 DJ - default input mode to phono */ | ||
319 | dev->control_state[0] = 2; | ||
320 | snd_usb_caiaq_send_command(dev, EP1_CMD_WRITE_IO, | ||
321 | dev->control_state, 1); | ||
322 | break; | ||
303 | } | 323 | } |
304 | 324 | ||
305 | if (dev->spec.num_analog_audio_out + | 325 | if (dev->spec.num_analog_audio_out + |
@@ -336,9 +356,10 @@ static void __devinit setup_card(struct snd_usb_caiaqdev *dev) | |||
336 | log("Unable to set up control system (ret=%d)\n", ret); | 356 | log("Unable to set up control system (ret=%d)\n", ret); |
337 | } | 357 | } |
338 | 358 | ||
339 | static struct snd_card* create_card(struct usb_device* usb_dev) | 359 | static int create_card(struct usb_device* usb_dev, struct snd_card **cardp) |
340 | { | 360 | { |
341 | int devnum; | 361 | int devnum; |
362 | int err; | ||
342 | struct snd_card *card; | 363 | struct snd_card *card; |
343 | struct snd_usb_caiaqdev *dev; | 364 | struct snd_usb_caiaqdev *dev; |
344 | 365 | ||
@@ -347,12 +368,12 @@ static struct snd_card* create_card(struct usb_device* usb_dev) | |||
347 | break; | 368 | break; |
348 | 369 | ||
349 | if (devnum >= SNDRV_CARDS) | 370 | if (devnum >= SNDRV_CARDS) |
350 | return NULL; | 371 | return -ENODEV; |
351 | 372 | ||
352 | card = snd_card_new(index[devnum], id[devnum], THIS_MODULE, | 373 | err = snd_card_create(index[devnum], id[devnum], THIS_MODULE, |
353 | sizeof(struct snd_usb_caiaqdev)); | 374 | sizeof(struct snd_usb_caiaqdev), &card); |
354 | if (!card) | 375 | if (err < 0) |
355 | return NULL; | 376 | return err; |
356 | 377 | ||
357 | dev = caiaqdev(card); | 378 | dev = caiaqdev(card); |
358 | dev->chip.dev = usb_dev; | 379 | dev->chip.dev = usb_dev; |
@@ -362,7 +383,8 @@ static struct snd_card* create_card(struct usb_device* usb_dev) | |||
362 | spin_lock_init(&dev->spinlock); | 383 | spin_lock_init(&dev->spinlock); |
363 | snd_card_set_dev(card, &usb_dev->dev); | 384 | snd_card_set_dev(card, &usb_dev->dev); |
364 | 385 | ||
365 | return card; | 386 | *cardp = card; |
387 | return 0; | ||
366 | } | 388 | } |
367 | 389 | ||
368 | static int __devinit init_card(struct snd_usb_caiaqdev *dev) | 390 | static int __devinit init_card(struct snd_usb_caiaqdev *dev) |
@@ -441,10 +463,10 @@ static int __devinit snd_probe(struct usb_interface *intf, | |||
441 | struct snd_card *card; | 463 | struct snd_card *card; |
442 | struct usb_device *device = interface_to_usbdev(intf); | 464 | struct usb_device *device = interface_to_usbdev(intf); |
443 | 465 | ||
444 | card = create_card(device); | 466 | ret = create_card(device, &card); |
445 | 467 | ||
446 | if (!card) | 468 | if (ret < 0) |
447 | return -ENOMEM; | 469 | return ret; |
448 | 470 | ||
449 | usb_set_intfdata(intf, card); | 471 | usb_set_intfdata(intf, card); |
450 | ret = init_card(caiaqdev(card)); | 472 | ret = init_card(caiaqdev(card)); |