aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/Kconfig2
-rw-r--r--sound/usb/caiaq/caiaq-audio.c1
-rw-r--r--sound/usb/caiaq/caiaq-device.c18
-rw-r--r--sound/usb/caiaq/caiaq-device.h1
-rw-r--r--sound/usb/caiaq/caiaq-input.c28
-rw-r--r--sound/usb/usbaudio.c46
-rw-r--r--sound/usb/usbmidi.c46
-rw-r--r--sound/usb/usbmixer.c11
-rw-r--r--sound/usb/usbquirks.h100
9 files changed, 207 insertions, 46 deletions
diff --git a/sound/usb/Kconfig b/sound/usb/Kconfig
index 315360f31278..706143826aff 100644
--- a/sound/usb/Kconfig
+++ b/sound/usb/Kconfig
@@ -40,6 +40,7 @@ config SND_USB_CAIAQ
40 namely: 40 namely:
41 41
42 * Native Instruments RigKontrol2 42 * Native Instruments RigKontrol2
43 * Native Instruments RigKontrol3
43 * Native Instruments Kore Controller 44 * Native Instruments Kore Controller
44 * Native Instruments Audio Kontrol 1 45 * Native Instruments Audio Kontrol 1
45 * Native Instruments Audio 8 DJ 46 * Native Instruments Audio 8 DJ
@@ -55,6 +56,7 @@ config SND_USB_CAIAQ_INPUT
55 alpha dials and analog pedals on the following products: 56 alpha dials and analog pedals on the following products:
56 57
57 * Native Instruments RigKontrol2 58 * Native Instruments RigKontrol2
59 * Native Instruments RigKontrol3
58 * Native Instruments Audio Kontrol 1 60 * Native Instruments Audio Kontrol 1
59 61
60endmenu 62endmenu
diff --git a/sound/usb/caiaq/caiaq-audio.c b/sound/usb/caiaq/caiaq-audio.c
index 0414d766ba07..0666908a2361 100644
--- a/sound/usb/caiaq/caiaq-audio.c
+++ b/sound/usb/caiaq/caiaq-audio.c
@@ -648,6 +648,7 @@ int __devinit snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
648 dev->samplerates = dev->pcm_info.rates; 648 dev->samplerates = dev->pcm_info.rates;
649 switch (dev->chip.usb_id) { 649 switch (dev->chip.usb_id) {
650 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1): 650 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
651 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3):
651 dev->samplerates |= SNDRV_PCM_RATE_88200; 652 dev->samplerates |= SNDRV_PCM_RATE_88200;
652 dev->samplerates |= SNDRV_PCM_RATE_192000; 653 dev->samplerates |= SNDRV_PCM_RATE_192000;
653 break; 654 break;
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c
index 4709347326f9..58af8142c571 100644
--- a/sound/usb/caiaq/caiaq-device.c
+++ b/sound/usb/caiaq/caiaq-device.c
@@ -41,9 +41,10 @@
41#endif 41#endif
42 42
43MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 43MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
44MODULE_DESCRIPTION("caiaq USB audio, version 1.1.0"); 44MODULE_DESCRIPTION("caiaq USB audio, version 1.2.0");
45MODULE_LICENSE("GPL"); 45MODULE_LICENSE("GPL");
46MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," 46MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
47 "{Native Instruments, RigKontrol3},"
47 "{Native Instruments, Kore Controller}," 48 "{Native Instruments, Kore Controller},"
48 "{Native Instruments, Audio Kontrol 1}" 49 "{Native Instruments, Audio Kontrol 1}"
49 "{Native Instruments, Audio 8 DJ}}"); 50 "{Native Instruments, Audio 8 DJ}}");
@@ -85,6 +86,11 @@ static struct usb_device_id snd_usb_id_table[] = {
85 { 86 {
86 .match_flags = USB_DEVICE_ID_MATCH_DEVICE, 87 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
87 .idVendor = USB_VID_NATIVEINSTRUMENTS, 88 .idVendor = USB_VID_NATIVEINSTRUMENTS,
89 .idProduct = USB_PID_RIGKONTROL3
90 },
91 {
92 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
93 .idVendor = USB_VID_NATIVEINSTRUMENTS,
88 .idProduct = USB_PID_KORECONTROLLER 94 .idProduct = USB_PID_KORECONTROLLER
89 }, 95 },
90 { 96 {
@@ -226,7 +232,7 @@ int snd_usb_caiaq_set_auto_msg (struct snd_usb_caiaqdev *dev,
226static void setup_card(struct snd_usb_caiaqdev *dev) 232static void setup_card(struct snd_usb_caiaqdev *dev)
227{ 233{
228 int ret; 234 int ret;
229 char val[3]; 235 char val[4];
230 236
231 /* device-specific startup specials */ 237 /* device-specific startup specials */
232 switch (dev->chip.usb_id) { 238 switch (dev->chip.usb_id) {
@@ -237,6 +243,14 @@ static void setup_card(struct snd_usb_caiaqdev *dev)
237 val[2] = 0x01; 243 val[2] = 0x01;
238 send_command(dev, EP1_CMD_WRITE_IO, val, 3); 244 send_command(dev, EP1_CMD_WRITE_IO, val, 3);
239 break; 245 break;
246 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3):
247 /* RigKontrol2 - display two centered dashes ('--') */
248 val[0] = 0x00;
249 val[1] = 0x40;
250 val[2] = 0x40;
251 val[3] = 0x00;
252 send_command(dev, EP1_CMD_WRITE_IO, val, 4);
253 break;
240 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1): 254 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
241 /* Audio Kontrol 1 - make USB-LED stop blinking */ 255 /* Audio Kontrol 1 - make USB-LED stop blinking */
242 val[0] = 0x00; 256 val[0] = 0x00;
diff --git a/sound/usb/caiaq/caiaq-device.h b/sound/usb/caiaq/caiaq-device.h
index 088d5ec241f3..79bc5be2df7a 100644
--- a/sound/usb/caiaq/caiaq-device.h
+++ b/sound/usb/caiaq/caiaq-device.h
@@ -6,6 +6,7 @@
6#define USB_VID_NATIVEINSTRUMENTS 0x17cc 6#define USB_VID_NATIVEINSTRUMENTS 0x17cc
7 7
8#define USB_PID_RIGKONTROL2 0x1969 8#define USB_PID_RIGKONTROL2 0x1969
9#define USB_PID_RIGKONTROL3 0x1940
9#define USB_PID_KORECONTROLLER 0x4711 10#define USB_PID_KORECONTROLLER 0x4711
10#define USB_PID_AK1 0x0815 11#define USB_PID_AK1 0x0815
11#define USB_PID_AUDIO8DJ 0x1978 12#define USB_PID_AUDIO8DJ 0x1978
diff --git a/sound/usb/caiaq/caiaq-input.c b/sound/usb/caiaq/caiaq-input.c
index 3acd12db6952..a1de0c608957 100644
--- a/sound/usb/caiaq/caiaq-input.c
+++ b/sound/usb/caiaq/caiaq-input.c
@@ -34,6 +34,8 @@
34static unsigned char keycode_ak1[] = { KEY_C, KEY_B, KEY_A }; 34static unsigned char keycode_ak1[] = { KEY_C, KEY_B, KEY_A };
35static unsigned char keycode_rk2[] = { KEY_1, KEY_2, KEY_3, KEY_4, 35static unsigned char keycode_rk2[] = { KEY_1, KEY_2, KEY_3, KEY_4,
36 KEY_5, KEY_6, KEY_7 }; 36 KEY_5, KEY_6, KEY_7 };
37static unsigned char keycode_rk3[] = { KEY_1, KEY_2, KEY_3, KEY_4,
38 KEY_5, KEY_6, KEY_7, KEY_5, KEY_6 };
37 39
38#define DEG90 (range/2) 40#define DEG90 (range/2)
39#define DEG180 (range) 41#define DEG180 (range)
@@ -107,7 +109,8 @@ static unsigned int decode_erp(unsigned char a, unsigned char b)
107 109
108 110
109static void snd_caiaq_input_read_analog(struct snd_usb_caiaqdev *dev, 111static void snd_caiaq_input_read_analog(struct snd_usb_caiaqdev *dev,
110 const char *buf, unsigned int len) 112 const unsigned char *buf,
113 unsigned int len)
111{ 114{
112 switch(dev->input_dev->id.product) { 115 switch(dev->input_dev->id.product) {
113 case USB_PID_RIGKONTROL2: 116 case USB_PID_RIGKONTROL2:
@@ -116,6 +119,12 @@ static void snd_caiaq_input_read_analog(struct snd_usb_caiaqdev *dev,
116 input_report_abs(dev->input_dev, ABS_Z, (buf[2] << 8) |buf[3]); 119 input_report_abs(dev->input_dev, ABS_Z, (buf[2] << 8) |buf[3]);
117 input_sync(dev->input_dev); 120 input_sync(dev->input_dev);
118 break; 121 break;
122 case USB_PID_RIGKONTROL3:
123 input_report_abs(dev->input_dev, ABS_X, (buf[0] << 8) |buf[1]);
124 input_report_abs(dev->input_dev, ABS_Y, (buf[2] << 8) |buf[3]);
125 input_report_abs(dev->input_dev, ABS_Z, (buf[4] << 8) |buf[5]);
126 input_sync(dev->input_dev);
127 break;
119 } 128 }
120} 129}
121 130
@@ -128,7 +137,7 @@ static void snd_caiaq_input_read_erp(struct snd_usb_caiaqdev *dev,
128 case USB_PID_AK1: 137 case USB_PID_AK1:
129 i = decode_erp(buf[0], buf[1]); 138 i = decode_erp(buf[0], buf[1]);
130 input_report_abs(dev->input_dev, ABS_X, i); 139 input_report_abs(dev->input_dev, ABS_X, i);
131 input_sync(dev->input_dev); 140 input_sync(dev->input_dev);
132 break; 141 break;
133 } 142 }
134} 143}
@@ -204,6 +213,20 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *dev)
204 input_set_abs_params(input, ABS_Z, 0, 4096, 0, 10); 213 input_set_abs_params(input, ABS_Z, 0, 4096, 0, 10);
205 snd_usb_caiaq_set_auto_msg(dev, 1, 10, 0); 214 snd_usb_caiaq_set_auto_msg(dev, 1, 10, 0);
206 break; 215 break;
216 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3):
217 input->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
218 input->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_Z);
219 input->keycode = keycode_rk3;
220 input->keycodesize = sizeof(char);
221 input->keycodemax = ARRAY_SIZE(keycode_rk3);
222 for (i=0; i<ARRAY_SIZE(keycode_rk3); i++)
223 set_bit(keycode_rk3[i], input->keybit);
224
225 input_set_abs_params(input, ABS_X, 0, 1024, 0, 10);
226 input_set_abs_params(input, ABS_Y, 0, 1024, 0, 10);
227 input_set_abs_params(input, ABS_Z, 0, 1024, 0, 10);
228 snd_usb_caiaq_set_auto_msg(dev, 1, 10, 0);
229 break;
207 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1): 230 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
208 input->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 231 input->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
209 input->absbit[0] = BIT(ABS_X); 232 input->absbit[0] = BIT(ABS_X);
@@ -238,7 +261,6 @@ void snd_usb_caiaq_input_free(struct snd_usb_caiaqdev *dev)
238 return; 261 return;
239 262
240 input_unregister_device(dev->input_dev); 263 input_unregister_device(dev->input_dev);
241 input_free_device(dev->input_dev);
242 dev->input_dev = NULL; 264 dev->input_dev = NULL;
243} 265}
244 266
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index ac5666f4c6d5..967b823eace0 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -123,7 +123,6 @@ struct audioformat {
123 unsigned int rate_min, rate_max; /* min/max rates */ 123 unsigned int rate_min, rate_max; /* min/max rates */
124 unsigned int nr_rates; /* number of rate table entries */ 124 unsigned int nr_rates; /* number of rate table entries */
125 unsigned int *rate_table; /* rate table */ 125 unsigned int *rate_table; /* rate table */
126 unsigned int needs_knot; /* any unusual rates? */
127}; 126};
128 127
129struct snd_usb_substream; 128struct snd_usb_substream;
@@ -1309,7 +1308,11 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
1309 1308
1310 /* close the old interface */ 1309 /* close the old interface */
1311 if (subs->interface >= 0 && subs->interface != fmt->iface) { 1310 if (subs->interface >= 0 && subs->interface != fmt->iface) {
1312 usb_set_interface(subs->dev, subs->interface, 0); 1311 if (usb_set_interface(subs->dev, subs->interface, 0) < 0) {
1312 snd_printk(KERN_ERR "%d:%d:%d: return to setting 0 failed\n",
1313 dev->devnum, fmt->iface, fmt->altsetting);
1314 return -EIO;
1315 }
1313 subs->interface = -1; 1316 subs->interface = -1;
1314 subs->format = 0; 1317 subs->format = 0;
1315 } 1318 }
@@ -1761,7 +1764,7 @@ static int check_hw_params_convention(struct snd_usb_substream *subs)
1761 channels[f->format] |= (1 << f->channels); 1764 channels[f->format] |= (1 << f->channels);
1762 rates[f->format] |= f->rates; 1765 rates[f->format] |= f->rates;
1763 /* needs knot? */ 1766 /* needs knot? */
1764 if (f->needs_knot) 1767 if (f->rates & SNDRV_PCM_RATE_KNOT)
1765 goto __out; 1768 goto __out;
1766 } 1769 }
1767 /* check whether channels and rates match for all formats */ 1770 /* check whether channels and rates match for all formats */
@@ -1817,7 +1820,7 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
1817 if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) 1820 if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
1818 return 0; 1821 return 0;
1819 count += fp->nr_rates; 1822 count += fp->nr_rates;
1820 if (fp->needs_knot) 1823 if (fp->rates & SNDRV_PCM_RATE_KNOT)
1821 needs_knot = 1; 1824 needs_knot = 1;
1822 } 1825 }
1823 if (!needs_knot) 1826 if (!needs_knot)
@@ -2453,7 +2456,7 @@ static int parse_audio_format_rates(struct snd_usb_audio *chip, struct audioform
2453 unsigned char *fmt, int offset) 2456 unsigned char *fmt, int offset)
2454{ 2457{
2455 int nr_rates = fmt[offset]; 2458 int nr_rates = fmt[offset];
2456 int found; 2459
2457 if (fmt[0] < offset + 1 + 3 * (nr_rates ? nr_rates : 2)) { 2460 if (fmt[0] < offset + 1 + 3 * (nr_rates ? nr_rates : 2)) {
2458 snd_printk(KERN_ERR "%d:%u:%d : invalid FORMAT_TYPE desc\n", 2461 snd_printk(KERN_ERR "%d:%u:%d : invalid FORMAT_TYPE desc\n",
2459 chip->dev->devnum, fp->iface, fp->altsetting); 2462 chip->dev->devnum, fp->iface, fp->altsetting);
@@ -2464,20 +2467,15 @@ static int parse_audio_format_rates(struct snd_usb_audio *chip, struct audioform
2464 /* 2467 /*
2465 * build the rate table and bitmap flags 2468 * build the rate table and bitmap flags
2466 */ 2469 */
2467 int r, idx, c; 2470 int r, idx;
2468 unsigned int nonzero_rates = 0; 2471 unsigned int nonzero_rates = 0;
2469 /* this table corresponds to the SNDRV_PCM_RATE_XXX bit */ 2472
2470 static unsigned int conv_rates[] = {
2471 5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000,
2472 64000, 88200, 96000, 176400, 192000
2473 };
2474 fp->rate_table = kmalloc(sizeof(int) * nr_rates, GFP_KERNEL); 2473 fp->rate_table = kmalloc(sizeof(int) * nr_rates, GFP_KERNEL);
2475 if (fp->rate_table == NULL) { 2474 if (fp->rate_table == NULL) {
2476 snd_printk(KERN_ERR "cannot malloc\n"); 2475 snd_printk(KERN_ERR "cannot malloc\n");
2477 return -1; 2476 return -1;
2478 } 2477 }
2479 2478
2480 fp->needs_knot = 0;
2481 fp->nr_rates = nr_rates; 2479 fp->nr_rates = nr_rates;
2482 fp->rate_min = fp->rate_max = combine_triple(&fmt[8]); 2480 fp->rate_min = fp->rate_max = combine_triple(&fmt[8]);
2483 for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) { 2481 for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
@@ -2493,23 +2491,12 @@ static int parse_audio_format_rates(struct snd_usb_audio *chip, struct audioform
2493 fp->rate_min = rate; 2491 fp->rate_min = rate;
2494 else if (rate > fp->rate_max) 2492 else if (rate > fp->rate_max)
2495 fp->rate_max = rate; 2493 fp->rate_max = rate;
2496 found = 0; 2494 fp->rates |= snd_pcm_rate_to_rate_bit(rate);
2497 for (c = 0; c < (int)ARRAY_SIZE(conv_rates); c++) {
2498 if (rate == conv_rates[c]) {
2499 found = 1;
2500 fp->rates |= (1 << c);
2501 break;
2502 }
2503 }
2504 if (!found)
2505 fp->needs_knot = 1;
2506 } 2495 }
2507 if (!nonzero_rates) { 2496 if (!nonzero_rates) {
2508 hwc_debug("All rates were zero. Skipping format!\n"); 2497 hwc_debug("All rates were zero. Skipping format!\n");
2509 return -1; 2498 return -1;
2510 } 2499 }
2511 if (fp->needs_knot)
2512 fp->rates |= SNDRV_PCM_RATE_KNOT;
2513 } else { 2500 } else {
2514 /* continuous rates */ 2501 /* continuous rates */
2515 fp->rates = SNDRV_PCM_RATE_CONTINUOUS; 2502 fp->rates = SNDRV_PCM_RATE_CONTINUOUS;
@@ -2857,6 +2844,10 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
2857 /* skip non-supported classes */ 2844 /* skip non-supported classes */
2858 continue; 2845 continue;
2859 } 2846 }
2847 if (snd_usb_get_speed(dev) == USB_SPEED_LOW) {
2848 snd_printk(KERN_ERR "low speed audio streaming not supported\n");
2849 continue;
2850 }
2860 if (! parse_audio_endpoints(chip, j)) { 2851 if (! parse_audio_endpoints(chip, j)) {
2861 usb_set_interface(dev, j, 0); /* reset the current interface */ 2852 usb_set_interface(dev, j, 0); /* reset the current interface */
2862 usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L); 2853 usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L);
@@ -3399,7 +3390,8 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
3399 3390
3400 *rchip = NULL; 3391 *rchip = NULL;
3401 3392
3402 if (snd_usb_get_speed(dev) != USB_SPEED_FULL && 3393 if (snd_usb_get_speed(dev) != USB_SPEED_LOW &&
3394 snd_usb_get_speed(dev) != USB_SPEED_FULL &&
3403 snd_usb_get_speed(dev) != USB_SPEED_HIGH) { 3395 snd_usb_get_speed(dev) != USB_SPEED_HIGH) {
3404 snd_printk(KERN_ERR "unknown device speed %d\n", snd_usb_get_speed(dev)); 3396 snd_printk(KERN_ERR "unknown device speed %d\n", snd_usb_get_speed(dev));
3405 return -ENXIO; 3397 return -ENXIO;
@@ -3473,7 +3465,9 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
3473 usb_make_path(dev, card->longname + len, sizeof(card->longname) - len); 3465 usb_make_path(dev, card->longname + len, sizeof(card->longname) - len);
3474 3466
3475 strlcat(card->longname, 3467 strlcat(card->longname,
3476 snd_usb_get_speed(dev) == USB_SPEED_FULL ? ", full speed" : ", high speed", 3468 snd_usb_get_speed(dev) == USB_SPEED_LOW ? ", low speed" :
3469 snd_usb_get_speed(dev) == USB_SPEED_FULL ? ", full speed" :
3470 ", high speed",
3477 sizeof(card->longname)); 3471 sizeof(card->longname));
3478 3472
3479 snd_usb_audio_create_proc(chip); 3473 snd_usb_audio_create_proc(chip);
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index 99295f9b7691..6330788c1c2b 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -407,6 +407,20 @@ static void snd_usbmidi_maudio_broken_running_status_input(
407} 407}
408 408
409/* 409/*
410 * CME protocol: like the standard protocol, but SysEx commands are sent as a
411 * single USB packet preceded by a 0x0F byte.
412 */
413static void snd_usbmidi_cme_input(struct snd_usb_midi_in_endpoint *ep,
414 uint8_t *buffer, int buffer_length)
415{
416 if (buffer_length < 2 || (buffer[0] & 0x0f) != 0x0f)
417 snd_usbmidi_standard_input(ep, buffer, buffer_length);
418 else
419 snd_usbmidi_input_data(ep, buffer[0] >> 4,
420 &buffer[1], buffer_length - 1);
421}
422
423/*
410 * Adds one USB MIDI packet to the output buffer. 424 * Adds one USB MIDI packet to the output buffer.
411 */ 425 */
412static void snd_usbmidi_output_standard_packet(struct urb* urb, uint8_t p0, 426static void snd_usbmidi_output_standard_packet(struct urb* urb, uint8_t p0,
@@ -572,6 +586,12 @@ static struct usb_protocol_ops snd_usbmidi_maudio_broken_running_status_ops = {
572 .output_packet = snd_usbmidi_output_standard_packet, 586 .output_packet = snd_usbmidi_output_standard_packet,
573}; 587};
574 588
589static struct usb_protocol_ops snd_usbmidi_cme_ops = {
590 .input = snd_usbmidi_cme_input,
591 .output = snd_usbmidi_standard_output,
592 .output_packet = snd_usbmidi_output_standard_packet,
593};
594
575/* 595/*
576 * Novation USB MIDI protocol: number of data bytes is in the first byte 596 * Novation USB MIDI protocol: number of data bytes is in the first byte
577 * (when receiving) (+1!) or in the second byte (when sending); data begins 597 * (when receiving) (+1!) or in the second byte (when sending); data begins
@@ -963,8 +983,10 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
963 snd_usbmidi_out_endpoint_delete(ep); 983 snd_usbmidi_out_endpoint_delete(ep);
964 return -ENOMEM; 984 return -ENOMEM;
965 } 985 }
966 /* we never use interrupt output pipes */ 986 if (ep_info->out_interval)
967 pipe = usb_sndbulkpipe(umidi->chip->dev, ep_info->out_ep); 987 pipe = usb_sndintpipe(umidi->chip->dev, ep_info->out_ep);
988 else
989 pipe = usb_sndbulkpipe(umidi->chip->dev, ep_info->out_ep);
968 if (umidi->chip->usb_id == USB_ID(0x0a92, 0x1020)) /* ESI M4U */ 990 if (umidi->chip->usb_id == USB_ID(0x0a92, 0x1020)) /* ESI M4U */
969 /* FIXME: we need more URBs to get reasonable bandwidth here: */ 991 /* FIXME: we need more URBs to get reasonable bandwidth here: */
970 ep->max_transfer = 4; 992 ep->max_transfer = 4;
@@ -976,8 +998,14 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
976 snd_usbmidi_out_endpoint_delete(ep); 998 snd_usbmidi_out_endpoint_delete(ep);
977 return -ENOMEM; 999 return -ENOMEM;
978 } 1000 }
979 usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, 1001 if (ep_info->out_interval)
980 ep->max_transfer, snd_usbmidi_out_urb_complete, ep); 1002 usb_fill_int_urb(ep->urb, umidi->chip->dev, pipe, buffer,
1003 ep->max_transfer, snd_usbmidi_out_urb_complete,
1004 ep, ep_info->out_interval);
1005 else
1006 usb_fill_bulk_urb(ep->urb, umidi->chip->dev,
1007 pipe, buffer, ep->max_transfer,
1008 snd_usbmidi_out_urb_complete, ep);
981 ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; 1009 ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
982 1010
983 spin_lock_init(&ep->buffer_lock); 1011 spin_lock_init(&ep->buffer_lock);
@@ -1323,6 +1351,13 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi,
1323 endpoints[epidx].out_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1351 endpoints[epidx].out_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
1324 if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1352 if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)
1325 endpoints[epidx].out_interval = ep->bInterval; 1353 endpoints[epidx].out_interval = ep->bInterval;
1354 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
1355 /*
1356 * Low speed bulk transfers don't exist, so
1357 * force interrupt transfers for devices like
1358 * ESI MIDI Mate that try to use them anyway.
1359 */
1360 endpoints[epidx].out_interval = 1;
1326 endpoints[epidx].out_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1; 1361 endpoints[epidx].out_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1;
1327 snd_printdd(KERN_INFO "EP %02X: %d jack(s)\n", 1362 snd_printdd(KERN_INFO "EP %02X: %d jack(s)\n",
1328 ep->bEndpointAddress, ms_ep->bNumEmbMIDIJack); 1363 ep->bEndpointAddress, ms_ep->bNumEmbMIDIJack);
@@ -1336,6 +1371,8 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi,
1336 endpoints[epidx].in_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1371 endpoints[epidx].in_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
1337 if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1372 if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)
1338 endpoints[epidx].in_interval = ep->bInterval; 1373 endpoints[epidx].in_interval = ep->bInterval;
1374 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
1375 endpoints[epidx].in_interval = 1;
1339 endpoints[epidx].in_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1; 1376 endpoints[epidx].in_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1;
1340 snd_printdd(KERN_INFO "EP %02X: %d jack(s)\n", 1377 snd_printdd(KERN_INFO "EP %02X: %d jack(s)\n",
1341 ep->bEndpointAddress, ms_ep->bNumEmbMIDIJack); 1378 ep->bEndpointAddress, ms_ep->bNumEmbMIDIJack);
@@ -1690,6 +1727,7 @@ int snd_usb_create_midi_interface(struct snd_usb_audio* chip,
1690 err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); 1727 err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1);
1691 break; 1728 break;
1692 case QUIRK_MIDI_CME: 1729 case QUIRK_MIDI_CME:
1730 umidi->usb_protocol_ops = &snd_usbmidi_cme_ops;
1693 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 1731 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
1694 break; 1732 break;
1695 default: 1733 default:
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 325d4b6b54aa..5e329690cfb1 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1483,7 +1483,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, unsi
1483 struct snd_kcontrol *kctl; 1483 struct snd_kcontrol *kctl;
1484 char **namelist; 1484 char **namelist;
1485 1485
1486 if (! num_ins || desc[0] < 6 + num_ins) { 1486 if (! num_ins || desc[0] < 5 + num_ins) {
1487 snd_printk(KERN_ERR "invalid SELECTOR UNIT descriptor %d\n", unitid); 1487 snd_printk(KERN_ERR "invalid SELECTOR UNIT descriptor %d\n", unitid);
1488 return -EINVAL; 1488 return -EINVAL;
1489 } 1489 }
@@ -1888,14 +1888,7 @@ static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer)
1888 return 0; 1888 return 0;
1889} 1889}
1890 1890
1891static int snd_audigy2nx_led_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 1891#define snd_audigy2nx_led_info snd_ctl_boolean_mono_info
1892{
1893 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1894 uinfo->count = 1;
1895 uinfo->value.integer.min = 0;
1896 uinfo->value.integer.max = 1;
1897 return 0;
1898}
1899 1892
1900static int snd_audigy2nx_led_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1893static int snd_audigy2nx_led_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1901{ 1894{
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 5a2f518c6629..743568f89907 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -88,7 +88,19 @@
88 .bInterfaceClass = USB_CLASS_AUDIO, 88 .bInterfaceClass = USB_CLASS_AUDIO,
89 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL 89 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
90}, 90},
91 91/* E-Mu devices */
92{
93 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
94 .idVendor = 0x041e,
95 .idProduct = 0x3f02,
96 .bInterfaceClass = USB_CLASS_AUDIO,
97},
98{
99 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
100 .idVendor = 0x041e,
101 .idProduct = 0x3f04,
102 .bInterfaceClass = USB_CLASS_AUDIO,
103},
92/* 104/*
93 * Yamaha devices 105 * Yamaha devices
94 */ 106 */
@@ -1254,7 +1266,28 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1254 } 1266 }
1255}, 1267},
1256 /* TODO: add Edirol PC-80 support */ 1268 /* TODO: add Edirol PC-80 support */
1257 /* TODO: add Edirol UA-1EX support */ 1269{
1270 USB_DEVICE(0x0582, 0x0096),
1271 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1272 .vendor_name = "EDIROL",
1273 .product_name = "UA-1EX",
1274 .ifnum = QUIRK_ANY_INTERFACE,
1275 .type = QUIRK_COMPOSITE,
1276 .data = (const struct snd_usb_audio_quirk[]) {
1277 {
1278 .ifnum = 0,
1279 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1280 },
1281 {
1282 .ifnum = 1,
1283 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1284 },
1285 {
1286 .ifnum = -1
1287 }
1288 }
1289 }
1290},
1258{ 1291{
1259 USB_DEVICE(0x0582, 0x009a), 1292 USB_DEVICE(0x0582, 0x009a),
1260 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 1293 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
@@ -1567,6 +1600,40 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1567 } 1600 }
1568 } 1601 }
1569}, 1602},
1603{
1604 USB_DEVICE(0x0763, 0x2019),
1605 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1606 /* .vendor_name = "M-Audio", */
1607 /* .product_name = "Ozone Academic", */
1608 .ifnum = QUIRK_ANY_INTERFACE,
1609 .type = QUIRK_COMPOSITE,
1610 .data = & (const struct snd_usb_audio_quirk[]) {
1611 {
1612 .ifnum = 0,
1613 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1614 },
1615 {
1616 .ifnum = 1,
1617 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1618 },
1619 {
1620 .ifnum = 2,
1621 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1622 },
1623 {
1624 .ifnum = 3,
1625 .type = QUIRK_MIDI_MIDIMAN,
1626 .data = & (const struct snd_usb_midi_endpoint_info) {
1627 .out_cables = 0x0001,
1628 .in_cables = 0x0001
1629 }
1630 },
1631 {
1632 .ifnum = -1
1633 }
1634 }
1635 }
1636},
1570 1637
1571/* Casio devices */ 1638/* Casio devices */
1572{ 1639{
@@ -1709,6 +1776,24 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1709 } 1776 }
1710}, 1777},
1711 1778
1779/* Stanton/N2IT Final Scratch v1 device ('Scratchamp') */
1780{
1781 USB_DEVICE(0x103d, 0x0100),
1782 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1783 .vendor_name = "Stanton",
1784 .product_name = "ScratchAmp",
1785 .ifnum = QUIRK_NO_INTERFACE
1786 }
1787},
1788{
1789 USB_DEVICE(0x103d, 0x0101),
1790 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1791 .vendor_name = "Stanton",
1792 .product_name = "ScratchAmp",
1793 .ifnum = QUIRK_NO_INTERFACE
1794 }
1795},
1796
1712/* Novation EMS devices */ 1797/* Novation EMS devices */
1713{ 1798{
1714 USB_DEVICE_VENDOR_SPEC(0x1235, 0x0001), 1799 USB_DEVICE_VENDOR_SPEC(0x1235, 0x0001),
@@ -1738,6 +1823,17 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1738 } 1823 }
1739}, 1824},
1740 1825
1826/* */
1827{
1828 /* aka. Serato Scratch Live DJ Box */
1829 USB_DEVICE(0x13e5, 0x0001),
1830 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1831 .vendor_name = "Rane",
1832 .product_name = "SL-1",
1833 .ifnum = QUIRK_NO_INTERFACE
1834 }
1835},
1836
1741/* Miditech devices */ 1837/* Miditech devices */
1742{ 1838{
1743 USB_DEVICE(0x4752, 0x0011), 1839 USB_DEVICE(0x4752, 0x0011),