aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/6fire/chip.c17
-rw-r--r--sound/usb/caiaq/device.c15
-rw-r--r--sound/usb/card.c6
-rw-r--r--sound/usb/endpoint.c5
-rw-r--r--sound/usb/format.c8
-rw-r--r--sound/usb/misc/ua101.c16
-rw-r--r--sound/usb/quirks-table.h36
-rw-r--r--sound/usb/usx2y/us122l.c16
-rw-r--r--sound/usb/usx2y/usb_stream.c6
-rw-r--r--sound/usb/usx2y/usbusx2y.c15
10 files changed, 62 insertions, 78 deletions
diff --git a/sound/usb/6fire/chip.c b/sound/usb/6fire/chip.c
index c7dca7b0b9fe..8af92e3e9c18 100644
--- a/sound/usb/6fire/chip.c
+++ b/sound/usb/6fire/chip.c
@@ -35,7 +35,7 @@ MODULE_SUPPORTED_DEVICE("{{TerraTec, DMX 6Fire USB}}");
35 35
36static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ 36static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
37static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */ 37static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */
38static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable card */ 38static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable card */
39static struct sfire_chip *chips[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 39static struct sfire_chip *chips[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
40static struct usb_device *devices[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 40static struct usb_device *devices[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
41 41
@@ -211,22 +211,11 @@ static struct usb_device_id device_table[] = {
211 211
212MODULE_DEVICE_TABLE(usb, device_table); 212MODULE_DEVICE_TABLE(usb, device_table);
213 213
214static struct usb_driver driver = { 214static struct usb_driver usb_driver = {
215 .name = "snd-usb-6fire", 215 .name = "snd-usb-6fire",
216 .probe = usb6fire_chip_probe, 216 .probe = usb6fire_chip_probe,
217 .disconnect = usb6fire_chip_disconnect, 217 .disconnect = usb6fire_chip_disconnect,
218 .id_table = device_table, 218 .id_table = device_table,
219}; 219};
220 220
221static int __init usb6fire_chip_init(void) 221module_usb_driver(usb_driver);
222{
223 return usb_register(&driver);
224}
225
226static void __exit usb6fire_chip_cleanup(void)
227{
228 usb_deregister(&driver);
229}
230
231module_init(usb6fire_chip_init);
232module_exit(usb6fire_chip_cleanup);
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index 3eb605bd9503..64aed432ae22 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -55,7 +55,7 @@ MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
55 55
56static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ 56static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
57static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ 57static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
58static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 58static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
59static int snd_card_used[SNDRV_CARDS]; 59static int snd_card_used[SNDRV_CARDS];
60 60
61module_param_array(index, int, NULL, 0444); 61module_param_array(index, int, NULL, 0444);
@@ -538,16 +538,5 @@ static struct usb_driver snd_usb_driver = {
538 .id_table = snd_usb_id_table, 538 .id_table = snd_usb_id_table,
539}; 539};
540 540
541static int __init snd_module_init(void) 541module_usb_driver(snd_usb_driver);
542{
543 return usb_register(&snd_usb_driver);
544}
545
546static void __exit snd_module_exit(void)
547{
548 usb_deregister(&snd_usb_driver);
549}
550
551module_init(snd_module_init)
552module_exit(snd_module_exit)
553 542
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 0f6dc0d457bf..4a7be7b98331 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -78,14 +78,14 @@ MODULE_SUPPORTED_DEVICE("{{Generic,USB Audio}}");
78 78
79static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 79static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
80static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 80static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
81static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ 81static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */
82/* Vendor/product IDs for this card */ 82/* Vendor/product IDs for this card */
83static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; 83static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };
84static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; 84static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };
85static int nrpacks = 8; /* max. number of packets per urb */ 85static int nrpacks = 8; /* max. number of packets per urb */
86static int async_unlink = 1; 86static bool async_unlink = 1;
87static int device_setup[SNDRV_CARDS]; /* device parameter for this card */ 87static int device_setup[SNDRV_CARDS]; /* device parameter for this card */
88static int ignore_ctl_error; 88static bool ignore_ctl_error;
89 89
90module_param_array(index, int, NULL, 0444); 90module_param_array(index, int, NULL, 0444);
91MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); 91MODULE_PARM_DESC(index, "Index value for the USB audio adapter.");
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 81c6edecd862..08dcce53720b 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -17,6 +17,7 @@
17 17
18#include <linux/gfp.h> 18#include <linux/gfp.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/ratelimit.h>
20#include <linux/usb.h> 21#include <linux/usb.h>
21#include <linux/usb/audio.h> 22#include <linux/usb/audio.h>
22 23
@@ -458,8 +459,8 @@ static int retire_capture_urb(struct snd_usb_substream *subs,
458 459
459 for (i = 0; i < urb->number_of_packets; i++) { 460 for (i = 0; i < urb->number_of_packets; i++) {
460 cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; 461 cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset;
461 if (urb->iso_frame_desc[i].status) { 462 if (urb->iso_frame_desc[i].status && printk_ratelimit()) {
462 snd_printd(KERN_ERR "frame %d active: %d\n", i, urb->iso_frame_desc[i].status); 463 snd_printdd("frame %d active: %d\n", i, urb->iso_frame_desc[i].status);
463 // continue; 464 // continue;
464 } 465 }
465 bytes = urb->iso_frame_desc[i].actual_length; 466 bytes = urb->iso_frame_desc[i].actual_length;
diff --git a/sound/usb/format.c b/sound/usb/format.c
index 89421d176570..e09aba19375c 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -209,6 +209,8 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
209 return 0; 209 return 0;
210} 210}
211 211
212#define MAX_UAC2_NR_RATES 1024
213
212/* 214/*
213 * Helper function to walk the array of sample rate triplets reported by 215 * Helper function to walk the array of sample rate triplets reported by
214 * the device. The problem is that we need to parse whole array first to 216 * the device. The problem is that we need to parse whole array first to
@@ -226,7 +228,7 @@ static int parse_uac2_sample_rate_range(struct audioformat *fp, int nr_triplets,
226 int min = combine_quad(&data[2 + 12 * i]); 228 int min = combine_quad(&data[2 + 12 * i]);
227 int max = combine_quad(&data[6 + 12 * i]); 229 int max = combine_quad(&data[6 + 12 * i]);
228 int res = combine_quad(&data[10 + 12 * i]); 230 int res = combine_quad(&data[10 + 12 * i]);
229 int rate; 231 unsigned int rate;
230 232
231 if ((max < 0) || (min < 0) || (res < 0) || (max < min)) 233 if ((max < 0) || (min < 0) || (res < 0) || (max < min))
232 continue; 234 continue;
@@ -253,6 +255,10 @@ static int parse_uac2_sample_rate_range(struct audioformat *fp, int nr_triplets,
253 fp->rates |= snd_pcm_rate_to_rate_bit(rate); 255 fp->rates |= snd_pcm_rate_to_rate_bit(rate);
254 256
255 nr_rates++; 257 nr_rates++;
258 if (nr_rates >= MAX_UAC2_NR_RATES) {
259 snd_printk(KERN_ERR "invalid uac2 rates\n");
260 break;
261 }
256 262
257 /* avoid endless loop */ 263 /* avoid endless loop */
258 if (res == 0) 264 if (res == 0)
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
index c0609c210303..8b81cb54026f 100644
--- a/sound/usb/misc/ua101.c
+++ b/sound/usb/misc/ua101.c
@@ -52,7 +52,7 @@ MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
52 52
53static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 53static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
54static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 54static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
55static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 55static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
56static unsigned int queue_length = 21; 56static unsigned int queue_length = 21;
57 57
58module_param_array(index, int, NULL, 0444); 58module_param_array(index, int, NULL, 0444);
@@ -1387,16 +1387,4 @@ static struct usb_driver ua101_driver = {
1387#endif 1387#endif
1388}; 1388};
1389 1389
1390static int __init alsa_card_ua101_init(void) 1390module_usb_driver(ua101_driver);
1391{
1392 return usb_register(&ua101_driver);
1393}
1394
1395static void __exit alsa_card_ua101_exit(void)
1396{
1397 usb_deregister(&ua101_driver);
1398 mutex_destroy(&devices_mutex);
1399}
1400
1401module_init(alsa_card_ua101_init);
1402module_exit(alsa_card_ua101_exit);
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 32d2a21f2e3b..8edc5035fc8f 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -269,6 +269,32 @@ YAMAHA_DEVICE(0x105a, NULL),
269YAMAHA_DEVICE(0x105b, NULL), 269YAMAHA_DEVICE(0x105b, NULL),
270YAMAHA_DEVICE(0x105c, NULL), 270YAMAHA_DEVICE(0x105c, NULL),
271YAMAHA_DEVICE(0x105d, NULL), 271YAMAHA_DEVICE(0x105d, NULL),
272{
273 USB_DEVICE(0x0499, 0x1503),
274 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
275 /* .vendor_name = "Yamaha", */
276 /* .product_name = "MOX6/MOX8", */
277 .ifnum = QUIRK_ANY_INTERFACE,
278 .type = QUIRK_COMPOSITE,
279 .data = (const struct snd_usb_audio_quirk[]) {
280 {
281 .ifnum = 1,
282 .type = QUIRK_AUDIO_STANDARD_INTERFACE
283 },
284 {
285 .ifnum = 2,
286 .type = QUIRK_AUDIO_STANDARD_INTERFACE
287 },
288 {
289 .ifnum = 3,
290 .type = QUIRK_MIDI_YAMAHA
291 },
292 {
293 .ifnum = -1
294 }
295 }
296 }
297},
272YAMAHA_DEVICE(0x2000, "DGP-7"), 298YAMAHA_DEVICE(0x2000, "DGP-7"),
273YAMAHA_DEVICE(0x2001, "DGP-5"), 299YAMAHA_DEVICE(0x2001, "DGP-5"),
274YAMAHA_DEVICE(0x2002, NULL), 300YAMAHA_DEVICE(0x2002, NULL),
@@ -2336,6 +2362,16 @@ YAMAHA_DEVICE(0x7010, "UB99"),
2336 } 2362 }
2337}, 2363},
2338 2364
2365{
2366 USB_DEVICE_VENDOR_SPEC(0x0944, 0x0201),
2367 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2368 .vendor_name = "KORG, Inc.",
2369 /* .product_name = "ToneLab ST", */
2370 .ifnum = 3,
2371 .type = QUIRK_MIDI_STANDARD_INTERFACE,
2372 }
2373},
2374
2339/* AKAI devices */ 2375/* AKAI devices */
2340{ 2376{
2341 USB_DEVICE(0x09e8, 0x0062), 2377 USB_DEVICE(0x09e8, 0x0062),
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index 726c1a7b89b8..c4fd3b1d9592 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -37,7 +37,7 @@ MODULE_LICENSE("GPL");
37static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ 37static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
38static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ 38static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
39 /* Enable this card */ 39 /* Enable this card */
40static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 40static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
41 41
42module_param_array(index, int, NULL, 0444); 42module_param_array(index, int, NULL, 0444);
43MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS"."); 43MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS".");
@@ -772,16 +772,4 @@ static struct usb_driver snd_us122l_usb_driver = {
772 .supports_autosuspend = 1 772 .supports_autosuspend = 1
773}; 773};
774 774
775 775module_usb_driver(snd_us122l_usb_driver);
776static int __init snd_us122l_module_init(void)
777{
778 return usb_register(&snd_us122l_usb_driver);
779}
780
781static void __exit snd_us122l_module_exit(void)
782{
783 usb_deregister(&snd_us122l_usb_driver);
784}
785
786module_init(snd_us122l_module_init)
787module_exit(snd_us122l_module_exit)
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
index c400ade3ff08..1e7a47a86605 100644
--- a/sound/usb/usx2y/usb_stream.c
+++ b/sound/usb/usx2y/usb_stream.c
@@ -674,7 +674,7 @@ dotry:
674 inurb->transfer_buffer_length = 674 inurb->transfer_buffer_length =
675 inurb->number_of_packets * 675 inurb->number_of_packets *
676 inurb->iso_frame_desc[0].length; 676 inurb->iso_frame_desc[0].length;
677 preempt_disable(); 677
678 if (u == 0) { 678 if (u == 0) {
679 int now; 679 int now;
680 struct usb_device *dev = inurb->dev; 680 struct usb_device *dev = inurb->dev;
@@ -686,19 +686,17 @@ dotry:
686 } 686 }
687 err = usb_submit_urb(inurb, GFP_ATOMIC); 687 err = usb_submit_urb(inurb, GFP_ATOMIC);
688 if (err < 0) { 688 if (err < 0) {
689 preempt_enable();
690 snd_printk(KERN_ERR"usb_submit_urb(sk->inurb[%i])" 689 snd_printk(KERN_ERR"usb_submit_urb(sk->inurb[%i])"
691 " returned %i\n", u, err); 690 " returned %i\n", u, err);
692 return err; 691 return err;
693 } 692 }
694 err = usb_submit_urb(outurb, GFP_ATOMIC); 693 err = usb_submit_urb(outurb, GFP_ATOMIC);
695 if (err < 0) { 694 if (err < 0) {
696 preempt_enable();
697 snd_printk(KERN_ERR"usb_submit_urb(sk->outurb[%i])" 695 snd_printk(KERN_ERR"usb_submit_urb(sk->outurb[%i])"
698 " returned %i\n", u, err); 696 " returned %i\n", u, err);
699 return err; 697 return err;
700 } 698 }
701 preempt_enable(); 699
702 if (inurb->start_frame != outurb->start_frame) { 700 if (inurb->start_frame != outurb->start_frame) {
703 snd_printd(KERN_DEBUG 701 snd_printd(KERN_DEBUG
704 "u[%i] start_frames differ in:%u out:%u\n", 702 "u[%i] start_frames differ in:%u out:%u\n",
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index cbd37f2c76d0..9af7c1f17413 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -154,7 +154,7 @@ MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604), "NAME_ALLCAPS"(0x8001)(0x8005)(0x8007
154 154
155static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ 155static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
156static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ 156static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
157static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 157static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
158 158
159module_param_array(index, int, NULL, 0444); 159module_param_array(index, int, NULL, 0444);
160MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS"."); 160MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS".");
@@ -459,15 +459,4 @@ static void usX2Y_usb_disconnect(struct usb_device *device, void* ptr)
459 } 459 }
460} 460}
461 461
462static int __init snd_usX2Y_module_init(void) 462module_usb_driver(snd_usX2Y_usb_driver);
463{
464 return usb_register(&snd_usX2Y_usb_driver);
465}
466
467static void __exit snd_usX2Y_module_exit(void)
468{
469 usb_deregister(&snd_usX2Y_usb_driver);
470}
471
472module_init(snd_usX2Y_module_init)
473module_exit(snd_usX2Y_module_exit)