diff options
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/usbaudio.c | 144 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 8 | ||||
-rw-r--r-- | sound/usb/usbmidi.c | 98 | ||||
-rw-r--r-- | sound/usb/usbmixer.c | 2 | ||||
-rw-r--r-- | sound/usb/usbquirks.h | 40 | ||||
-rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.c | 10 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 5 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2yaudio.c | 23 | ||||
-rw-r--r-- | sound/usb/usx2y/usx2yhwdeppcm.c | 4 |
9 files changed, 181 insertions, 153 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 2ead878bcb8f..99dae024b640 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <sound/driver.h> | 41 | #include <sound/driver.h> |
42 | #include <linux/bitops.h> | 42 | #include <linux/bitops.h> |
43 | #include <linux/init.h> | 43 | #include <linux/init.h> |
44 | #include <linux/interrupt.h> | ||
45 | #include <linux/list.h> | 44 | #include <linux/list.h> |
46 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
47 | #include <linux/string.h> | 46 | #include <linux/string.h> |
@@ -185,7 +184,6 @@ struct snd_usb_substream { | |||
185 | unsigned int num_formats; /* number of supported audio formats (list) */ | 184 | unsigned int num_formats; /* number of supported audio formats (list) */ |
186 | struct list_head fmt_list; /* format list */ | 185 | struct list_head fmt_list; /* format list */ |
187 | spinlock_t lock; | 186 | spinlock_t lock; |
188 | struct tasklet_struct start_period_elapsed; /* for start trigger */ | ||
189 | 187 | ||
190 | struct snd_urb_ops ops; /* callbacks (must be filled at init) */ | 188 | struct snd_urb_ops ops; /* callbacks (must be filled at init) */ |
191 | }; | 189 | }; |
@@ -480,6 +478,28 @@ static int retire_playback_sync_urb_hs(snd_usb_substream_t *subs, | |||
480 | } | 478 | } |
481 | 479 | ||
482 | /* | 480 | /* |
481 | * Prepare urb for streaming before playback starts. | ||
482 | * | ||
483 | * We don't care about (or have) any data, so we just send a transfer delimiter. | ||
484 | */ | ||
485 | static int prepare_startup_playback_urb(snd_usb_substream_t *subs, | ||
486 | snd_pcm_runtime_t *runtime, | ||
487 | struct urb *urb) | ||
488 | { | ||
489 | unsigned int i; | ||
490 | snd_urb_ctx_t *ctx = urb->context; | ||
491 | |||
492 | urb->dev = ctx->subs->dev; | ||
493 | urb->number_of_packets = subs->packs_per_ms; | ||
494 | for (i = 0; i < subs->packs_per_ms; ++i) { | ||
495 | urb->iso_frame_desc[i].offset = 0; | ||
496 | urb->iso_frame_desc[i].length = 0; | ||
497 | } | ||
498 | urb->transfer_buffer_length = 0; | ||
499 | return 0; | ||
500 | } | ||
501 | |||
502 | /* | ||
483 | * prepare urb for playback data pipe | 503 | * prepare urb for playback data pipe |
484 | * | 504 | * |
485 | * Since a URB can handle only a single linear buffer, we must use double | 505 | * Since a URB can handle only a single linear buffer, we must use double |
@@ -568,12 +588,8 @@ static int prepare_playback_urb(snd_usb_substream_t *subs, | |||
568 | subs->hwptr_done -= runtime->buffer_size; | 588 | subs->hwptr_done -= runtime->buffer_size; |
569 | spin_unlock_irqrestore(&subs->lock, flags); | 589 | spin_unlock_irqrestore(&subs->lock, flags); |
570 | urb->transfer_buffer_length = offs * stride; | 590 | urb->transfer_buffer_length = offs * stride; |
571 | if (period_elapsed) { | 591 | if (period_elapsed) |
572 | if (likely(subs->running)) | 592 | snd_pcm_period_elapsed(subs->pcm_substream); |
573 | snd_pcm_period_elapsed(subs->pcm_substream); | ||
574 | else | ||
575 | tasklet_hi_schedule(&subs->start_period_elapsed); | ||
576 | } | ||
577 | return 0; | 593 | return 0; |
578 | } | 594 | } |
579 | 595 | ||
@@ -588,22 +604,12 @@ static int retire_playback_urb(snd_usb_substream_t *subs, | |||
588 | return 0; | 604 | return 0; |
589 | } | 605 | } |
590 | 606 | ||
591 | /* | ||
592 | * Delay the snd_pcm_period_elapsed() call until after the start trigger | ||
593 | * callback so that we're not longer in the substream's lock. | ||
594 | */ | ||
595 | static void start_period_elapsed(unsigned long data) | ||
596 | { | ||
597 | snd_usb_substream_t *subs = (snd_usb_substream_t *)data; | ||
598 | snd_pcm_period_elapsed(subs->pcm_substream); | ||
599 | } | ||
600 | |||
601 | 607 | ||
602 | /* | 608 | /* |
603 | */ | 609 | */ |
604 | static struct snd_urb_ops audio_urb_ops[2] = { | 610 | static struct snd_urb_ops audio_urb_ops[2] = { |
605 | { | 611 | { |
606 | .prepare = prepare_playback_urb, | 612 | .prepare = prepare_startup_playback_urb, |
607 | .retire = retire_playback_urb, | 613 | .retire = retire_playback_urb, |
608 | .prepare_sync = prepare_playback_sync_urb, | 614 | .prepare_sync = prepare_playback_sync_urb, |
609 | .retire_sync = retire_playback_sync_urb, | 615 | .retire_sync = retire_playback_sync_urb, |
@@ -618,7 +624,7 @@ static struct snd_urb_ops audio_urb_ops[2] = { | |||
618 | 624 | ||
619 | static struct snd_urb_ops audio_urb_ops_high_speed[2] = { | 625 | static struct snd_urb_ops audio_urb_ops_high_speed[2] = { |
620 | { | 626 | { |
621 | .prepare = prepare_playback_urb, | 627 | .prepare = prepare_startup_playback_urb, |
622 | .retire = retire_playback_urb, | 628 | .retire = retire_playback_urb, |
623 | .prepare_sync = prepare_playback_sync_urb_hs, | 629 | .prepare_sync = prepare_playback_sync_urb_hs, |
624 | .retire_sync = retire_playback_sync_urb_hs, | 630 | .retire_sync = retire_playback_sync_urb_hs, |
@@ -692,9 +698,9 @@ static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) | |||
692 | if (runtime->dma_area) { | 698 | if (runtime->dma_area) { |
693 | if (runtime->dma_bytes >= size) | 699 | if (runtime->dma_bytes >= size) |
694 | return 0; /* already large enough */ | 700 | return 0; /* already large enough */ |
695 | vfree_nocheck(runtime->dma_area); | 701 | vfree(runtime->dma_area); |
696 | } | 702 | } |
697 | runtime->dma_area = vmalloc_nocheck(size); | 703 | runtime->dma_area = vmalloc(size); |
698 | if (! runtime->dma_area) | 704 | if (! runtime->dma_area) |
699 | return -ENOMEM; | 705 | return -ENOMEM; |
700 | runtime->dma_bytes = size; | 706 | runtime->dma_bytes = size; |
@@ -706,7 +712,7 @@ static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) | |||
706 | { | 712 | { |
707 | snd_pcm_runtime_t *runtime = subs->runtime; | 713 | snd_pcm_runtime_t *runtime = subs->runtime; |
708 | if (runtime->dma_area) { | 714 | if (runtime->dma_area) { |
709 | vfree_nocheck(runtime->dma_area); | 715 | vfree(runtime->dma_area); |
710 | runtime->dma_area = NULL; | 716 | runtime->dma_area = NULL; |
711 | } | 717 | } |
712 | return 0; | 718 | return 0; |
@@ -838,8 +844,7 @@ static int wait_clear_urbs(snd_usb_substream_t *subs) | |||
838 | } | 844 | } |
839 | if (! alive) | 845 | if (! alive) |
840 | break; | 846 | break; |
841 | set_current_state(TASK_UNINTERRUPTIBLE); | 847 | schedule_timeout_uninterruptible(1); |
842 | schedule_timeout(1); | ||
843 | } while (time_before(jiffies, end_time)); | 848 | } while (time_before(jiffies, end_time)); |
844 | if (alive) | 849 | if (alive) |
845 | snd_printk(KERN_ERR "timeout: still %d active urbs..\n", alive); | 850 | snd_printk(KERN_ERR "timeout: still %d active urbs..\n", alive); |
@@ -864,25 +869,40 @@ static snd_pcm_uframes_t snd_usb_pcm_pointer(snd_pcm_substream_t *substream) | |||
864 | 869 | ||
865 | 870 | ||
866 | /* | 871 | /* |
867 | * start/stop substream | 872 | * start/stop playback substream |
868 | */ | 873 | */ |
869 | static int snd_usb_pcm_trigger(snd_pcm_substream_t *substream, int cmd) | 874 | static int snd_usb_pcm_playback_trigger(snd_pcm_substream_t *substream, |
875 | int cmd) | ||
870 | { | 876 | { |
871 | snd_usb_substream_t *subs = (snd_usb_substream_t *)substream->runtime->private_data; | 877 | snd_usb_substream_t *subs = substream->runtime->private_data; |
872 | int err; | ||
873 | 878 | ||
874 | switch (cmd) { | 879 | switch (cmd) { |
875 | case SNDRV_PCM_TRIGGER_START: | 880 | case SNDRV_PCM_TRIGGER_START: |
876 | err = start_urbs(subs, substream->runtime); | 881 | subs->ops.prepare = prepare_playback_urb; |
877 | break; | 882 | return 0; |
878 | case SNDRV_PCM_TRIGGER_STOP: | 883 | case SNDRV_PCM_TRIGGER_STOP: |
879 | err = deactivate_urbs(subs, 0, 0); | 884 | return deactivate_urbs(subs, 0, 0); |
880 | break; | ||
881 | default: | 885 | default: |
882 | err = -EINVAL; | 886 | return -EINVAL; |
883 | break; | 887 | } |
888 | } | ||
889 | |||
890 | /* | ||
891 | * start/stop capture substream | ||
892 | */ | ||
893 | static int snd_usb_pcm_capture_trigger(snd_pcm_substream_t *substream, | ||
894 | int cmd) | ||
895 | { | ||
896 | snd_usb_substream_t *subs = substream->runtime->private_data; | ||
897 | |||
898 | switch (cmd) { | ||
899 | case SNDRV_PCM_TRIGGER_START: | ||
900 | return start_urbs(subs, substream->runtime); | ||
901 | case SNDRV_PCM_TRIGGER_STOP: | ||
902 | return deactivate_urbs(subs, 0, 0); | ||
903 | default: | ||
904 | return -EINVAL; | ||
884 | } | 905 | } |
885 | return err < 0 ? err : 0; | ||
886 | } | 906 | } |
887 | 907 | ||
888 | 908 | ||
@@ -1044,7 +1064,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by | |||
1044 | u->urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; | 1064 | u->urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; |
1045 | u->urb->interval = 1 << subs->datainterval; | 1065 | u->urb->interval = 1 << subs->datainterval; |
1046 | u->urb->context = u; | 1066 | u->urb->context = u; |
1047 | u->urb->complete = snd_usb_complete_callback(snd_complete_urb); | 1067 | u->urb->complete = snd_complete_urb; |
1048 | } | 1068 | } |
1049 | 1069 | ||
1050 | if (subs->syncpipe) { | 1070 | if (subs->syncpipe) { |
@@ -1070,7 +1090,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by | |||
1070 | u->urb->number_of_packets = 1; | 1090 | u->urb->number_of_packets = 1; |
1071 | u->urb->interval = 1 << subs->syncinterval; | 1091 | u->urb->interval = 1 << subs->syncinterval; |
1072 | u->urb->context = u; | 1092 | u->urb->context = u; |
1073 | u->urb->complete = snd_usb_complete_callback(snd_complete_sync_urb); | 1093 | u->urb->complete = snd_complete_sync_urb; |
1074 | } | 1094 | } |
1075 | } | 1095 | } |
1076 | return 0; | 1096 | return 0; |
@@ -1414,7 +1434,7 @@ static int snd_usb_hw_free(snd_pcm_substream_t *substream) | |||
1414 | static int snd_usb_pcm_prepare(snd_pcm_substream_t *substream) | 1434 | static int snd_usb_pcm_prepare(snd_pcm_substream_t *substream) |
1415 | { | 1435 | { |
1416 | snd_pcm_runtime_t *runtime = substream->runtime; | 1436 | snd_pcm_runtime_t *runtime = substream->runtime; |
1417 | snd_usb_substream_t *subs = (snd_usb_substream_t *)runtime->private_data; | 1437 | snd_usb_substream_t *subs = runtime->private_data; |
1418 | 1438 | ||
1419 | if (! subs->cur_audiofmt) { | 1439 | if (! subs->cur_audiofmt) { |
1420 | snd_printk(KERN_ERR "usbaudio: no format is specified!\n"); | 1440 | snd_printk(KERN_ERR "usbaudio: no format is specified!\n"); |
@@ -1434,7 +1454,13 @@ static int snd_usb_pcm_prepare(snd_pcm_substream_t *substream) | |||
1434 | deactivate_urbs(subs, 0, 1); | 1454 | deactivate_urbs(subs, 0, 1); |
1435 | wait_clear_urbs(subs); | 1455 | wait_clear_urbs(subs); |
1436 | 1456 | ||
1437 | return 0; | 1457 | /* for playback, submit the URBs now; otherwise, the first hwptr_done |
1458 | * updates for all URBs would happen at the same time when starting */ | ||
1459 | if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { | ||
1460 | subs->ops.prepare = prepare_startup_playback_urb; | ||
1461 | return start_urbs(subs, runtime); | ||
1462 | } else | ||
1463 | return 0; | ||
1438 | } | 1464 | } |
1439 | 1465 | ||
1440 | static snd_pcm_hardware_t snd_usb_playback = | 1466 | static snd_pcm_hardware_t snd_usb_playback = |
@@ -1848,7 +1874,7 @@ static snd_pcm_ops_t snd_usb_playback_ops = { | |||
1848 | .hw_params = snd_usb_hw_params, | 1874 | .hw_params = snd_usb_hw_params, |
1849 | .hw_free = snd_usb_hw_free, | 1875 | .hw_free = snd_usb_hw_free, |
1850 | .prepare = snd_usb_pcm_prepare, | 1876 | .prepare = snd_usb_pcm_prepare, |
1851 | .trigger = snd_usb_pcm_trigger, | 1877 | .trigger = snd_usb_pcm_playback_trigger, |
1852 | .pointer = snd_usb_pcm_pointer, | 1878 | .pointer = snd_usb_pcm_pointer, |
1853 | .page = snd_pcm_get_vmalloc_page, | 1879 | .page = snd_pcm_get_vmalloc_page, |
1854 | }; | 1880 | }; |
@@ -1860,7 +1886,7 @@ static snd_pcm_ops_t snd_usb_capture_ops = { | |||
1860 | .hw_params = snd_usb_hw_params, | 1886 | .hw_params = snd_usb_hw_params, |
1861 | .hw_free = snd_usb_hw_free, | 1887 | .hw_free = snd_usb_hw_free, |
1862 | .prepare = snd_usb_pcm_prepare, | 1888 | .prepare = snd_usb_pcm_prepare, |
1863 | .trigger = snd_usb_pcm_trigger, | 1889 | .trigger = snd_usb_pcm_capture_trigger, |
1864 | .pointer = snd_usb_pcm_pointer, | 1890 | .pointer = snd_usb_pcm_pointer, |
1865 | .page = snd_pcm_get_vmalloc_page, | 1891 | .page = snd_pcm_get_vmalloc_page, |
1866 | }; | 1892 | }; |
@@ -2079,9 +2105,6 @@ static void init_substream(snd_usb_stream_t *as, int stream, struct audioformat | |||
2079 | 2105 | ||
2080 | INIT_LIST_HEAD(&subs->fmt_list); | 2106 | INIT_LIST_HEAD(&subs->fmt_list); |
2081 | spin_lock_init(&subs->lock); | 2107 | spin_lock_init(&subs->lock); |
2082 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
2083 | tasklet_init(&subs->start_period_elapsed, start_period_elapsed, | ||
2084 | (unsigned long)subs); | ||
2085 | 2108 | ||
2086 | subs->stream = as; | 2109 | subs->stream = as; |
2087 | subs->direction = stream; | 2110 | subs->direction = stream; |
@@ -2755,9 +2778,9 @@ static int create_fixed_stream_quirk(snd_usb_audio_t *chip, | |||
2755 | /* | 2778 | /* |
2756 | * create a stream for an interface with proper descriptors | 2779 | * create a stream for an interface with proper descriptors |
2757 | */ | 2780 | */ |
2758 | static int create_standard_interface_quirk(snd_usb_audio_t *chip, | 2781 | static int create_standard_audio_quirk(snd_usb_audio_t *chip, |
2759 | struct usb_interface *iface, | 2782 | struct usb_interface *iface, |
2760 | const snd_usb_audio_quirk_t *quirk) | 2783 | const snd_usb_audio_quirk_t *quirk) |
2761 | { | 2784 | { |
2762 | struct usb_host_interface *alts; | 2785 | struct usb_host_interface *alts; |
2763 | struct usb_interface_descriptor *altsd; | 2786 | struct usb_interface_descriptor *altsd; |
@@ -2765,24 +2788,14 @@ static int create_standard_interface_quirk(snd_usb_audio_t *chip, | |||
2765 | 2788 | ||
2766 | alts = &iface->altsetting[0]; | 2789 | alts = &iface->altsetting[0]; |
2767 | altsd = get_iface_desc(alts); | 2790 | altsd = get_iface_desc(alts); |
2768 | switch (quirk->type) { | 2791 | err = parse_audio_endpoints(chip, altsd->bInterfaceNumber); |
2769 | case QUIRK_AUDIO_STANDARD_INTERFACE: | ||
2770 | err = parse_audio_endpoints(chip, altsd->bInterfaceNumber); | ||
2771 | if (!err) | ||
2772 | usb_set_interface(chip->dev, altsd->bInterfaceNumber, 0); /* reset the current interface */ | ||
2773 | break; | ||
2774 | case QUIRK_MIDI_STANDARD_INTERFACE: | ||
2775 | err = snd_usb_create_midi_interface(chip, iface, NULL); | ||
2776 | break; | ||
2777 | default: | ||
2778 | snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); | ||
2779 | return -ENXIO; | ||
2780 | } | ||
2781 | if (err < 0) { | 2792 | if (err < 0) { |
2782 | snd_printk(KERN_ERR "cannot setup if %d: error %d\n", | 2793 | snd_printk(KERN_ERR "cannot setup if %d: error %d\n", |
2783 | altsd->bInterfaceNumber, err); | 2794 | altsd->bInterfaceNumber, err); |
2784 | return err; | 2795 | return err; |
2785 | } | 2796 | } |
2797 | /* reset the current interface */ | ||
2798 | usb_set_interface(chip->dev, altsd->bInterfaceNumber, 0); | ||
2786 | return 0; | 2799 | return 0; |
2787 | } | 2800 | } |
2788 | 2801 | ||
@@ -3044,7 +3057,7 @@ static int snd_usb_create_quirk(snd_usb_audio_t *chip, | |||
3044 | [QUIRK_MIDI_RAW] = snd_usb_create_midi_interface, | 3057 | [QUIRK_MIDI_RAW] = snd_usb_create_midi_interface, |
3045 | [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface, | 3058 | [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface, |
3046 | [QUIRK_MIDI_MIDITECH] = snd_usb_create_midi_interface, | 3059 | [QUIRK_MIDI_MIDITECH] = snd_usb_create_midi_interface, |
3047 | [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_interface_quirk, | 3060 | [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, |
3048 | [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, | 3061 | [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, |
3049 | [QUIRK_AUDIO_EDIROL_UA700_UA25] = create_ua700_ua25_quirk, | 3062 | [QUIRK_AUDIO_EDIROL_UA700_UA25] = create_ua700_ua25_quirk, |
3050 | [QUIRK_AUDIO_EDIROL_UA1000] = create_ua1000_quirk, | 3063 | [QUIRK_AUDIO_EDIROL_UA1000] = create_ua1000_quirk, |
@@ -3222,7 +3235,6 @@ static void *snd_usb_audio_probe(struct usb_device *dev, | |||
3222 | struct usb_interface *intf, | 3235 | struct usb_interface *intf, |
3223 | const struct usb_device_id *usb_id) | 3236 | const struct usb_device_id *usb_id) |
3224 | { | 3237 | { |
3225 | struct usb_host_config *config = dev->actconfig; | ||
3226 | const snd_usb_audio_quirk_t *quirk = (const snd_usb_audio_quirk_t *)usb_id->driver_info; | 3238 | const snd_usb_audio_quirk_t *quirk = (const snd_usb_audio_quirk_t *)usb_id->driver_info; |
3227 | int i, err; | 3239 | int i, err; |
3228 | snd_usb_audio_t *chip; | 3240 | snd_usb_audio_t *chip; |
@@ -3243,7 +3255,6 @@ static void *snd_usb_audio_probe(struct usb_device *dev, | |||
3243 | if (id == USB_ID(0x041e, 0x3000)) { | 3255 | if (id == USB_ID(0x041e, 0x3000)) { |
3244 | if (snd_usb_extigy_boot_quirk(dev, intf) < 0) | 3256 | if (snd_usb_extigy_boot_quirk(dev, intf) < 0) |
3245 | goto __err_val; | 3257 | goto __err_val; |
3246 | config = dev->actconfig; | ||
3247 | } | 3258 | } |
3248 | /* SB Audigy 2 NX needs its own boot-up magic, too */ | 3259 | /* SB Audigy 2 NX needs its own boot-up magic, too */ |
3249 | if (id == USB_ID(0x041e, 0x3020)) { | 3260 | if (id == USB_ID(0x041e, 0x3020)) { |
@@ -3272,11 +3283,6 @@ static void *snd_usb_audio_probe(struct usb_device *dev, | |||
3272 | /* it's a fresh one. | 3283 | /* it's a fresh one. |
3273 | * now look for an empty slot and create a new card instance | 3284 | * now look for an empty slot and create a new card instance |
3274 | */ | 3285 | */ |
3275 | /* first, set the current configuration for this device */ | ||
3276 | if (usb_reset_configuration(dev) < 0) { | ||
3277 | snd_printk(KERN_ERR "cannot reset configuration (value 0x%x)\n", get_cfg_desc(config)->bConfigurationValue); | ||
3278 | goto __error; | ||
3279 | } | ||
3280 | for (i = 0; i < SNDRV_CARDS; i++) | 3286 | for (i = 0; i < SNDRV_CARDS; i++) |
3281 | if (enable[i] && ! usb_chip[i] && | 3287 | if (enable[i] && ! usb_chip[i] && |
3282 | (vid[i] == -1 || vid[i] == USB_ID_VENDOR(id)) && | 3288 | (vid[i] == -1 || vid[i] == USB_ID_VENDOR(id)) && |
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index ad9eab211d8f..b5802022bb19 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -249,14 +249,6 @@ void snd_usbmidi_disconnect(struct list_head *p); | |||
249 | #define get_cfg_desc(cfg) (&(cfg)->desc) | 249 | #define get_cfg_desc(cfg) (&(cfg)->desc) |
250 | #endif | 250 | #endif |
251 | 251 | ||
252 | #ifndef usb_pipe_needs_resubmit | ||
253 | #define usb_pipe_needs_resubmit(pipe) 1 | ||
254 | #endif | ||
255 | |||
256 | #ifndef snd_usb_complete_callback | ||
257 | #define snd_usb_complete_callback(x) (x) | ||
258 | #endif | ||
259 | |||
260 | #ifndef snd_usb_get_speed | 252 | #ifndef snd_usb_get_speed |
261 | #define snd_usb_get_speed(dev) ((dev)->speed) | 253 | #define snd_usb_get_speed(dev) ((dev)->speed) |
262 | #endif | 254 | #endif |
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index f1a2e2c2e02f..f8aa662562a0 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c | |||
@@ -47,7 +47,6 @@ | |||
47 | #include <linux/timer.h> | 47 | #include <linux/timer.h> |
48 | #include <linux/usb.h> | 48 | #include <linux/usb.h> |
49 | #include <sound/core.h> | 49 | #include <sound/core.h> |
50 | #include <sound/minors.h> | ||
51 | #include <sound/rawmidi.h> | 50 | #include <sound/rawmidi.h> |
52 | #include "usbaudio.h" | 51 | #include "usbaudio.h" |
53 | 52 | ||
@@ -246,10 +245,8 @@ static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs) | |||
246 | } | 245 | } |
247 | } | 246 | } |
248 | 247 | ||
249 | if (usb_pipe_needs_resubmit(urb->pipe)) { | 248 | urb->dev = ep->umidi->chip->dev; |
250 | urb->dev = ep->umidi->chip->dev; | 249 | snd_usbmidi_submit_urb(urb, GFP_ATOMIC); |
251 | snd_usbmidi_submit_urb(urb, GFP_ATOMIC); | ||
252 | } | ||
253 | } | 250 | } |
254 | 251 | ||
255 | static void snd_usbmidi_out_urb_complete(struct urb* urb, struct pt_regs *regs) | 252 | static void snd_usbmidi_out_urb_complete(struct urb* urb, struct pt_regs *regs) |
@@ -863,13 +860,12 @@ static int snd_usbmidi_in_endpoint_create(snd_usb_midi_t* umidi, | |||
863 | return -ENOMEM; | 860 | return -ENOMEM; |
864 | } | 861 | } |
865 | if (ep_info->in_interval) | 862 | if (ep_info->in_interval) |
866 | usb_fill_int_urb(ep->urb, umidi->chip->dev, pipe, buffer, length, | 863 | usb_fill_int_urb(ep->urb, umidi->chip->dev, pipe, buffer, |
867 | snd_usb_complete_callback(snd_usbmidi_in_urb_complete), | 864 | length, snd_usbmidi_in_urb_complete, ep, |
868 | ep, ep_info->in_interval); | 865 | ep_info->in_interval); |
869 | else | 866 | else |
870 | usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, length, | 867 | usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, |
871 | snd_usb_complete_callback(snd_usbmidi_in_urb_complete), | 868 | length, snd_usbmidi_in_urb_complete, ep); |
872 | ep); | ||
873 | ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; | 869 | ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
874 | 870 | ||
875 | rep->in = ep; | 871 | rep->in = ep; |
@@ -933,8 +929,7 @@ static int snd_usbmidi_out_endpoint_create(snd_usb_midi_t* umidi, | |||
933 | return -ENOMEM; | 929 | return -ENOMEM; |
934 | } | 930 | } |
935 | usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, | 931 | usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, |
936 | ep->max_transfer, | 932 | ep->max_transfer, snd_usbmidi_out_urb_complete, ep); |
937 | snd_usb_complete_callback(snd_usbmidi_out_urb_complete), ep); | ||
938 | ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; | 933 | ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
939 | 934 | ||
940 | spin_lock_init(&ep->buffer_lock); | 935 | spin_lock_init(&ep->buffer_lock); |
@@ -1550,46 +1545,45 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip, | |||
1550 | 1545 | ||
1551 | /* detect the endpoint(s) to use */ | 1546 | /* detect the endpoint(s) to use */ |
1552 | memset(endpoints, 0, sizeof(endpoints)); | 1547 | memset(endpoints, 0, sizeof(endpoints)); |
1553 | if (!quirk) { | 1548 | switch (quirk ? quirk->type : QUIRK_MIDI_STANDARD_INTERFACE) { |
1549 | case QUIRK_MIDI_STANDARD_INTERFACE: | ||
1554 | err = snd_usbmidi_get_ms_info(umidi, endpoints); | 1550 | err = snd_usbmidi_get_ms_info(umidi, endpoints); |
1555 | } else { | 1551 | break; |
1556 | switch (quirk->type) { | 1552 | case QUIRK_MIDI_FIXED_ENDPOINT: |
1557 | case QUIRK_MIDI_FIXED_ENDPOINT: | 1553 | memcpy(&endpoints[0], quirk->data, |
1558 | memcpy(&endpoints[0], quirk->data, | 1554 | sizeof(snd_usb_midi_endpoint_info_t)); |
1559 | sizeof(snd_usb_midi_endpoint_info_t)); | 1555 | err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); |
1560 | err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); | 1556 | break; |
1561 | break; | 1557 | case QUIRK_MIDI_YAMAHA: |
1562 | case QUIRK_MIDI_YAMAHA: | 1558 | err = snd_usbmidi_detect_yamaha(umidi, &endpoints[0]); |
1563 | err = snd_usbmidi_detect_yamaha(umidi, &endpoints[0]); | 1559 | break; |
1564 | break; | 1560 | case QUIRK_MIDI_MIDIMAN: |
1565 | case QUIRK_MIDI_MIDIMAN: | 1561 | umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops; |
1566 | umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops; | 1562 | memcpy(&endpoints[0], quirk->data, |
1567 | memcpy(&endpoints[0], quirk->data, | 1563 | sizeof(snd_usb_midi_endpoint_info_t)); |
1568 | sizeof(snd_usb_midi_endpoint_info_t)); | 1564 | err = 0; |
1569 | err = 0; | 1565 | break; |
1570 | break; | 1566 | case QUIRK_MIDI_NOVATION: |
1571 | case QUIRK_MIDI_NOVATION: | 1567 | umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; |
1572 | umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; | 1568 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); |
1573 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); | 1569 | break; |
1574 | break; | 1570 | case QUIRK_MIDI_RAW: |
1575 | case QUIRK_MIDI_RAW: | 1571 | umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; |
1576 | umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; | 1572 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); |
1577 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); | 1573 | break; |
1578 | break; | 1574 | case QUIRK_MIDI_EMAGIC: |
1579 | case QUIRK_MIDI_EMAGIC: | 1575 | umidi->usb_protocol_ops = &snd_usbmidi_emagic_ops; |
1580 | umidi->usb_protocol_ops = &snd_usbmidi_emagic_ops; | 1576 | memcpy(&endpoints[0], quirk->data, |
1581 | memcpy(&endpoints[0], quirk->data, | 1577 | sizeof(snd_usb_midi_endpoint_info_t)); |
1582 | sizeof(snd_usb_midi_endpoint_info_t)); | 1578 | err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); |
1583 | err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); | 1579 | break; |
1584 | break; | 1580 | case QUIRK_MIDI_MIDITECH: |
1585 | case QUIRK_MIDI_MIDITECH: | 1581 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); |
1586 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); | 1582 | break; |
1587 | break; | 1583 | default: |
1588 | default: | 1584 | snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); |
1589 | snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); | 1585 | err = -ENXIO; |
1590 | err = -ENXIO; | 1586 | break; |
1591 | break; | ||
1592 | } | ||
1593 | } | 1587 | } |
1594 | if (err < 0) { | 1588 | if (err < 0) { |
1595 | kfree(umidi); | 1589 | kfree(umidi); |
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index c3c08c9cb46e..e570d140258d 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c | |||
@@ -911,7 +911,7 @@ static void build_feature_ctl(mixer_build_t *state, unsigned char *desc, | |||
911 | case USB_ID(0x0672, 0x1041): | 911 | case USB_ID(0x0672, 0x1041): |
912 | if (!strcmp(kctl->id.name, "PCM Playback Volume") && | 912 | if (!strcmp(kctl->id.name, "PCM Playback Volume") && |
913 | cval->min == -15616) { | 913 | cval->min == -15616) { |
914 | snd_printk("using volume control quirk for the UDA1321/N101 chip\n"); | 914 | snd_printk(KERN_INFO "using volume control quirk for the UDA1321/N101 chip\n"); |
915 | cval->max = -256; | 915 | cval->max = -256; |
916 | } | 916 | } |
917 | } | 917 | } |
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index 948759da6563..ba506c3871f4 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h | |||
@@ -294,6 +294,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
294 | } | 294 | } |
295 | }, | 295 | }, |
296 | { | 296 | { |
297 | /* a later revision uses ID 0x0099 */ | ||
297 | USB_DEVICE(0x0582, 0x0005), | 298 | USB_DEVICE(0x0582, 0x0005), |
298 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 299 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
299 | .vendor_name = "EDIROL", | 300 | .vendor_name = "EDIROL", |
@@ -384,6 +385,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
384 | } | 385 | } |
385 | }, | 386 | }, |
386 | { | 387 | { |
388 | /* a later revision uses ID 0x009d */ | ||
387 | USB_DEVICE(0x0582, 0x0009), | 389 | USB_DEVICE(0x0582, 0x0009), |
388 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 390 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
389 | .vendor_name = "EDIROL", | 391 | .vendor_name = "EDIROL", |
@@ -532,6 +534,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
532 | } | 534 | } |
533 | }, | 535 | }, |
534 | { | 536 | { |
537 | /* has ID 0x0013 when not in "Advanced Driver" mode */ | ||
535 | USB_DEVICE(0x0582, 0x0012), | 538 | USB_DEVICE(0x0582, 0x0012), |
536 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 539 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
537 | .vendor_name = "Roland", | 540 | .vendor_name = "Roland", |
@@ -545,6 +548,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
545 | } | 548 | } |
546 | }, | 549 | }, |
547 | { | 550 | { |
551 | /* has ID 0x0015 when not in "Advanced Driver" mode */ | ||
548 | USB_DEVICE(0x0582, 0x0014), | 552 | USB_DEVICE(0x0582, 0x0014), |
549 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 553 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
550 | .vendor_name = "EDIROL", | 554 | .vendor_name = "EDIROL", |
@@ -558,6 +562,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
558 | } | 562 | } |
559 | }, | 563 | }, |
560 | { | 564 | { |
565 | /* has ID 0x0017 when not in "Advanced Driver" mode */ | ||
561 | USB_DEVICE(0x0582, 0x0016), | 566 | USB_DEVICE(0x0582, 0x0016), |
562 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 567 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
563 | .vendor_name = "EDIROL", | 568 | .vendor_name = "EDIROL", |
@@ -588,6 +593,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
588 | } | 593 | } |
589 | }, | 594 | }, |
590 | { | 595 | { |
596 | /* has ID 0x001c when not in "Advanced Driver" mode */ | ||
591 | USB_DEVICE(0x0582, 0x001b), | 597 | USB_DEVICE(0x0582, 0x001b), |
592 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 598 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
593 | .vendor_name = "Roland", | 599 | .vendor_name = "Roland", |
@@ -618,6 +624,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
618 | } | 624 | } |
619 | }, | 625 | }, |
620 | { | 626 | { |
627 | /* has ID 0x001e when not in "Advanced Driver" mode */ | ||
621 | USB_DEVICE(0x0582, 0x001d), | 628 | USB_DEVICE(0x0582, 0x001d), |
622 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 629 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
623 | .vendor_name = "Roland", | 630 | .vendor_name = "Roland", |
@@ -631,6 +638,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
631 | } | 638 | } |
632 | }, | 639 | }, |
633 | { | 640 | { |
641 | /* has ID 0x0024 when not in "Advanced Driver" mode */ | ||
634 | USB_DEVICE(0x0582, 0x0023), | 642 | USB_DEVICE(0x0582, 0x0023), |
635 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 643 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
636 | .vendor_name = "EDIROL", | 644 | .vendor_name = "EDIROL", |
@@ -675,6 +683,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
675 | } | 683 | } |
676 | }, | 684 | }, |
677 | { | 685 | { |
686 | /* has ID 0x0028 when not in "Advanced Driver" mode */ | ||
678 | USB_DEVICE(0x0582, 0x0027), | 687 | USB_DEVICE(0x0582, 0x0027), |
679 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 688 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
680 | .vendor_name = "EDIROL", | 689 | .vendor_name = "EDIROL", |
@@ -688,6 +697,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
688 | } | 697 | } |
689 | }, | 698 | }, |
690 | { | 699 | { |
700 | /* has ID 0x002a when not in "Advanced Driver" mode */ | ||
691 | USB_DEVICE(0x0582, 0x0029), | 701 | USB_DEVICE(0x0582, 0x0029), |
692 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 702 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
693 | .vendor_name = "EDIROL", | 703 | .vendor_name = "EDIROL", |
@@ -732,6 +742,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
732 | } | 742 | } |
733 | }, | 743 | }, |
734 | { | 744 | { |
745 | /* has ID 0x002e when not in "Advanced Driver" mode */ | ||
735 | USB_DEVICE(0x0582, 0x002d), | 746 | USB_DEVICE(0x0582, 0x002d), |
736 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 747 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
737 | .vendor_name = "Roland", | 748 | .vendor_name = "Roland", |
@@ -745,6 +756,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
745 | } | 756 | } |
746 | }, | 757 | }, |
747 | { | 758 | { |
759 | /* has ID 0x0030 when not in "Advanced Driver" mode */ | ||
748 | USB_DEVICE(0x0582, 0x002f), | 760 | USB_DEVICE(0x0582, 0x002f), |
749 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 761 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
750 | .vendor_name = "Roland", | 762 | .vendor_name = "Roland", |
@@ -758,6 +770,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
758 | } | 770 | } |
759 | }, | 771 | }, |
760 | { | 772 | { |
773 | /* has ID 0x0034 when not in "Advanced Driver" mode */ | ||
761 | USB_DEVICE(0x0582, 0x0033), | 774 | USB_DEVICE(0x0582, 0x0033), |
762 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 775 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
763 | .vendor_name = "EDIROL", | 776 | .vendor_name = "EDIROL", |
@@ -770,7 +783,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
770 | } | 783 | } |
771 | } | 784 | } |
772 | }, | 785 | }, |
786 | /* TODO: add Roland M-1000 support */ | ||
773 | { | 787 | { |
788 | /* | ||
789 | * Has ID 0x0038 when not in "Advanced Driver" mode; | ||
790 | * later revisions use IDs 0x0054 and 0x00a2. | ||
791 | */ | ||
774 | USB_DEVICE(0x0582, 0x0037), | 792 | USB_DEVICE(0x0582, 0x0037), |
775 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 793 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
776 | .vendor_name = "Roland", | 794 | .vendor_name = "Roland", |
@@ -815,6 +833,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
815 | } | 833 | } |
816 | }, | 834 | }, |
817 | { | 835 | { |
836 | /* has ID 0x0041 when not in "Advanced Driver" mode */ | ||
818 | USB_DEVICE(0x0582, 0x0040), | 837 | USB_DEVICE(0x0582, 0x0040), |
819 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 838 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
820 | .vendor_name = "Roland", | 839 | .vendor_name = "Roland", |
@@ -828,6 +847,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
828 | } | 847 | } |
829 | }, | 848 | }, |
830 | { | 849 | { |
850 | /* has ID 0x0043 when not in "Advanced Driver" mode */ | ||
831 | USB_DEVICE(0x0582, 0x0042), | 851 | USB_DEVICE(0x0582, 0x0042), |
832 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 852 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
833 | .vendor_name = "Roland", | 853 | .vendor_name = "Roland", |
@@ -871,6 +891,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
871 | } | 891 | } |
872 | }, | 892 | }, |
873 | { | 893 | { |
894 | /* has ID 0x004a when not in "Advanced Driver" mode */ | ||
874 | USB_DEVICE(0x0582, 0x0048), | 895 | USB_DEVICE(0x0582, 0x0048), |
875 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 896 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
876 | .vendor_name = "EDIROL", | 897 | .vendor_name = "EDIROL", |
@@ -883,7 +904,9 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
883 | } | 904 | } |
884 | } | 905 | } |
885 | }, | 906 | }, |
907 | /* TODO: add Edirol M-100FX support */ | ||
886 | { | 908 | { |
909 | /* has ID 0x004f when not in "Advanced Driver" mode */ | ||
887 | USB_DEVICE(0x0582, 0x004d), | 910 | USB_DEVICE(0x0582, 0x004d), |
888 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 911 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
889 | .vendor_name = "EDIROL", | 912 | .vendor_name = "EDIROL", |
@@ -931,7 +954,9 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
931 | .type = QUIRK_MIDI_STANDARD_INTERFACE | 954 | .type = QUIRK_MIDI_STANDARD_INTERFACE |
932 | } | 955 | } |
933 | }, | 956 | }, |
957 | /* TODO: add Roland EXR support */ | ||
934 | { | 958 | { |
959 | /* has ID 0x0067 when not in "Advanced Driver" mode */ | ||
935 | USB_DEVICE(0x0582, 0x0065), | 960 | USB_DEVICE(0x0582, 0x0065), |
936 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 961 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
937 | .vendor_name = "EDIROL", | 962 | .vendor_name = "EDIROL", |
@@ -945,6 +970,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
945 | } | 970 | } |
946 | }, | 971 | }, |
947 | { | 972 | { |
973 | /* has ID 0x006b when not in "Advanced Driver" mode */ | ||
948 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x006a), | 974 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x006a), |
949 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 975 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
950 | .vendor_name = "Roland", | 976 | .vendor_name = "Roland", |
@@ -958,6 +984,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
958 | } | 984 | } |
959 | }, | 985 | }, |
960 | { | 986 | { |
987 | /* has ID 0x006e when not in "Advanced Driver" mode */ | ||
961 | USB_DEVICE(0x0582, 0x006d), | 988 | USB_DEVICE(0x0582, 0x006d), |
962 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 989 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
963 | .vendor_name = "Roland", | 990 | .vendor_name = "Roland", |
@@ -1002,6 +1029,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1002 | } | 1029 | } |
1003 | }, | 1030 | }, |
1004 | { | 1031 | { |
1032 | /* has ID 0x0076 when not in "Advanced Driver" mode */ | ||
1005 | USB_DEVICE(0x0582, 0x0075), | 1033 | USB_DEVICE(0x0582, 0x0075), |
1006 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1034 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
1007 | .vendor_name = "BOSS", | 1035 | .vendor_name = "BOSS", |
@@ -1015,10 +1043,11 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1015 | } | 1043 | } |
1016 | }, | 1044 | }, |
1017 | { | 1045 | { |
1046 | /* has ID 0x007b when not in "Advanced Driver" mode */ | ||
1018 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x007a), | 1047 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x007a), |
1019 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1048 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { |
1020 | .vendor_name = "Roland", | 1049 | .vendor_name = "Roland", |
1021 | /* RD-700SX, RD-300SX */ | 1050 | /* "RD" or "RD-700SX"? */ |
1022 | .ifnum = 0, | 1051 | .ifnum = 0, |
1023 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 1052 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
1024 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1053 | .data = & (const snd_usb_midi_endpoint_info_t) { |
@@ -1048,6 +1077,15 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1048 | } | 1077 | } |
1049 | } | 1078 | } |
1050 | }, | 1079 | }, |
1080 | /* TODO: add Edirol UA-101 support */ | ||
1081 | /* TODO: add Roland G-70 support */ | ||
1082 | /* TODO: add Roland V-SYNTH XT support */ | ||
1083 | /* TODO: add BOSS GT-PRO support */ | ||
1084 | /* TODO: add Edirol PC-50 support */ | ||
1085 | /* TODO: add Edirol PC-80 support */ | ||
1086 | /* TODO: add Edirol UA-1EX support */ | ||
1087 | /* TODO: add Edirol UM-3 support */ | ||
1088 | /* TODO: add Edirol MD-P1 support */ | ||
1051 | 1089 | ||
1052 | /* Midiman/M-Audio devices */ | 1090 | /* Midiman/M-Audio devices */ |
1053 | { | 1091 | { |
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index 0281a362857a..8abe08611df6 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c | |||
@@ -193,7 +193,7 @@ static int usX2Y_create_alsa_devices(snd_card_t* card) | |||
193 | 193 | ||
194 | do { | 194 | do { |
195 | if ((err = usX2Y_create_usbmidi(card)) < 0) { | 195 | if ((err = usX2Y_create_usbmidi(card)) < 0) { |
196 | snd_printk("usX2Y_create_alsa_devices: usX2Y_create_usbmidi error %i \n", err); | 196 | snd_printk(KERN_ERR "usX2Y_create_alsa_devices: usX2Y_create_usbmidi error %i \n", err); |
197 | break; | 197 | break; |
198 | } | 198 | } |
199 | if ((err = usX2Y_audio_create(card)) < 0) | 199 | if ((err = usX2Y_audio_create(card)) < 0) |
@@ -224,7 +224,7 @@ static int snd_usX2Y_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) | |||
224 | } | 224 | } |
225 | err = usb_set_interface(dev, 0, 1); | 225 | err = usb_set_interface(dev, 0, 1); |
226 | if (err) | 226 | if (err) |
227 | snd_printk("usb_set_interface error \n"); | 227 | snd_printk(KERN_ERR "usb_set_interface error \n"); |
228 | else | 228 | else |
229 | err = usb_bulk_msg(dev, usb_sndbulkpipe(dev, 2), buf, dsp->length, &lret, 6000); | 229 | err = usb_bulk_msg(dev, usb_sndbulkpipe(dev, 2), buf, dsp->length, &lret, 6000); |
230 | kfree(buf); | 230 | kfree(buf); |
@@ -235,17 +235,17 @@ static int snd_usX2Y_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) | |||
235 | msleep(250); // give the device some time | 235 | msleep(250); // give the device some time |
236 | err = usX2Y_AsyncSeq04_init(priv); | 236 | err = usX2Y_AsyncSeq04_init(priv); |
237 | if (err) { | 237 | if (err) { |
238 | snd_printk("usX2Y_AsyncSeq04_init error \n"); | 238 | snd_printk(KERN_ERR "usX2Y_AsyncSeq04_init error \n"); |
239 | return err; | 239 | return err; |
240 | } | 240 | } |
241 | err = usX2Y_In04_init(priv); | 241 | err = usX2Y_In04_init(priv); |
242 | if (err) { | 242 | if (err) { |
243 | snd_printk("usX2Y_In04_init error \n"); | 243 | snd_printk(KERN_ERR "usX2Y_In04_init error \n"); |
244 | return err; | 244 | return err; |
245 | } | 245 | } |
246 | err = usX2Y_create_alsa_devices(hw->card); | 246 | err = usX2Y_create_alsa_devices(hw->card); |
247 | if (err) { | 247 | if (err) { |
248 | snd_printk("usX2Y_create_alsa_devices error %i \n", err); | 248 | snd_printk(KERN_ERR "usX2Y_create_alsa_devices error %i \n", err); |
249 | snd_card_free(hw->card); | 249 | snd_card_free(hw->card); |
250 | return err; | 250 | return err; |
251 | } | 251 | } |
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index e6e6da159671..cf77313c609d 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -251,9 +251,8 @@ static void i_usX2Y_In04Int(struct urb* urb, struct pt_regs *regs) | |||
251 | } | 251 | } |
252 | } | 252 | } |
253 | 253 | ||
254 | if (err) { | 254 | if (err) |
255 | snd_printk("In04Int() usb_submit_urb err=%i\n", err); | 255 | snd_printk(KERN_ERR "In04Int() usb_submit_urb err=%i\n", err); |
256 | } | ||
257 | 256 | ||
258 | urb->dev = usX2Y->chip.dev; | 257 | urb->dev = usX2Y->chip.dev; |
259 | usb_submit_urb(urb, GFP_ATOMIC); | 258 | usb_submit_urb(urb, GFP_ATOMIC); |
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index 0f09e0de52dd..affda973cece 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c | |||
@@ -78,7 +78,7 @@ static int usX2Y_urb_capt_retire(snd_usX2Y_substream_t *subs) | |||
78 | for (i = 0; i < nr_of_packs(); i++) { | 78 | for (i = 0; i < nr_of_packs(); i++) { |
79 | cp = (unsigned char*)urb->transfer_buffer + urb->iso_frame_desc[i].offset; | 79 | cp = (unsigned char*)urb->transfer_buffer + urb->iso_frame_desc[i].offset; |
80 | if (urb->iso_frame_desc[i].status) { /* active? hmm, skip this */ | 80 | if (urb->iso_frame_desc[i].status) { /* active? hmm, skip this */ |
81 | snd_printk("activ frame status %i. Most propably some hardware problem.\n", urb->iso_frame_desc[i].status); | 81 | snd_printk(KERN_ERR "activ frame status %i. Most propably some hardware problem.\n", urb->iso_frame_desc[i].status); |
82 | return urb->iso_frame_desc[i].status; | 82 | return urb->iso_frame_desc[i].status; |
83 | } | 83 | } |
84 | len = urb->iso_frame_desc[i].actual_length / usX2Y->stride; | 84 | len = urb->iso_frame_desc[i].actual_length / usX2Y->stride; |
@@ -134,7 +134,7 @@ static int usX2Y_urb_play_prepare(snd_usX2Y_substream_t *subs, | |||
134 | counts = cap_urb->iso_frame_desc[pack].actual_length / usX2Y->stride; | 134 | counts = cap_urb->iso_frame_desc[pack].actual_length / usX2Y->stride; |
135 | count += counts; | 135 | count += counts; |
136 | if (counts < 43 || counts > 50) { | 136 | if (counts < 43 || counts > 50) { |
137 | snd_printk("should not be here with counts=%i\n", counts); | 137 | snd_printk(KERN_ERR "should not be here with counts=%i\n", counts); |
138 | return -EPIPE; | 138 | return -EPIPE; |
139 | } | 139 | } |
140 | /* set up descriptor */ | 140 | /* set up descriptor */ |
@@ -196,7 +196,7 @@ static int usX2Y_urb_submit(snd_usX2Y_substream_t *subs, struct urb *urb, int fr | |||
196 | urb->hcpriv = NULL; | 196 | urb->hcpriv = NULL; |
197 | urb->dev = subs->usX2Y->chip.dev; /* we need to set this at each time */ | 197 | urb->dev = subs->usX2Y->chip.dev; /* we need to set this at each time */ |
198 | if ((err = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { | 198 | if ((err = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { |
199 | snd_printk("usb_submit_urb() returned %i\n", err); | 199 | snd_printk(KERN_ERR "usb_submit_urb() returned %i\n", err); |
200 | return err; | 200 | return err; |
201 | } | 201 | } |
202 | return 0; | 202 | return 0; |
@@ -283,16 +283,16 @@ static void usX2Y_clients_stop(usX2Ydev_t *usX2Y) | |||
283 | 283 | ||
284 | static void usX2Y_error_urb_status(usX2Ydev_t *usX2Y, snd_usX2Y_substream_t *subs, struct urb *urb) | 284 | static void usX2Y_error_urb_status(usX2Ydev_t *usX2Y, snd_usX2Y_substream_t *subs, struct urb *urb) |
285 | { | 285 | { |
286 | snd_printk("ep=%i stalled with status=%i\n", subs->endpoint, urb->status); | 286 | snd_printk(KERN_ERR "ep=%i stalled with status=%i\n", subs->endpoint, urb->status); |
287 | urb->status = 0; | 287 | urb->status = 0; |
288 | usX2Y_clients_stop(usX2Y); | 288 | usX2Y_clients_stop(usX2Y); |
289 | } | 289 | } |
290 | 290 | ||
291 | static void usX2Y_error_sequence(usX2Ydev_t *usX2Y, snd_usX2Y_substream_t *subs, struct urb *urb) | 291 | static void usX2Y_error_sequence(usX2Ydev_t *usX2Y, snd_usX2Y_substream_t *subs, struct urb *urb) |
292 | { | 292 | { |
293 | snd_printk("Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n" | 293 | snd_printk(KERN_ERR "Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n" |
294 | "Most propably some urb of usb-frame %i is still missing.\n" | 294 | KERN_ERR "Most propably some urb of usb-frame %i is still missing.\n" |
295 | "Cause could be too long delays in usb-hcd interrupt handling.\n", | 295 | KERN_ERR "Cause could be too long delays in usb-hcd interrupt handling.\n", |
296 | usb_get_current_frame_number(usX2Y->chip.dev), | 296 | usb_get_current_frame_number(usX2Y->chip.dev), |
297 | subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame); | 297 | subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame); |
298 | usX2Y_clients_stop(usX2Y); | 298 | usX2Y_clients_stop(usX2Y); |
@@ -653,9 +653,8 @@ static void i_usX2Y_04Int(struct urb* urb, struct pt_regs *regs) | |||
653 | { | 653 | { |
654 | usX2Ydev_t* usX2Y = urb->context; | 654 | usX2Ydev_t* usX2Y = urb->context; |
655 | 655 | ||
656 | if (urb->status) { | 656 | if (urb->status) |
657 | snd_printk("snd_usX2Y_04Int() urb->status=%i\n", urb->status); | 657 | snd_printk(KERN_ERR "snd_usX2Y_04Int() urb->status=%i\n", urb->status); |
658 | } | ||
659 | if (0 == --usX2Y->US04->len) | 658 | if (0 == --usX2Y->US04->len) |
660 | wake_up(&usX2Y->In04WaitQueue); | 659 | wake_up(&usX2Y->In04WaitQueue); |
661 | } | 660 | } |
@@ -740,7 +739,7 @@ static int usX2Y_format_set(usX2Ydev_t *usX2Y, snd_pcm_format_t format) | |||
740 | } | 739 | } |
741 | usb_kill_urb(usX2Y->In04urb); | 740 | usb_kill_urb(usX2Y->In04urb); |
742 | if ((err = usb_set_interface(usX2Y->chip.dev, 0, alternate))) { | 741 | if ((err = usb_set_interface(usX2Y->chip.dev, 0, alternate))) { |
743 | snd_printk("usb_set_interface error \n"); | 742 | snd_printk(KERN_ERR "usb_set_interface error \n"); |
744 | return err; | 743 | return err; |
745 | } | 744 | } |
746 | usX2Y->In04urb->dev = usX2Y->chip.dev; | 745 | usX2Y->In04urb->dev = usX2Y->chip.dev; |
@@ -787,7 +786,7 @@ static int snd_usX2Y_pcm_hw_params(snd_pcm_substream_t *substream, | |||
787 | } | 786 | } |
788 | } | 787 | } |
789 | if (0 > (err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)))) { | 788 | if (0 > (err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)))) { |
790 | snd_printk("snd_pcm_lib_malloc_pages(%p, %i) returned %i\n", substream, params_buffer_bytes(hw_params), err); | 789 | snd_printk(KERN_ERR "snd_pcm_lib_malloc_pages(%p, %i) returned %i\n", substream, params_buffer_bytes(hw_params), err); |
791 | return err; | 790 | return err; |
792 | } | 791 | } |
793 | return 0; | 792 | return 0; |
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index d0199c4e5551..0dc828ff9e94 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c | |||
@@ -73,7 +73,7 @@ static int usX2Y_usbpcm_urb_capt_retire(snd_usX2Y_substream_t *subs) | |||
73 | } | 73 | } |
74 | for (i = 0; i < nr_of_packs(); i++) { | 74 | for (i = 0; i < nr_of_packs(); i++) { |
75 | if (urb->iso_frame_desc[i].status) { /* active? hmm, skip this */ | 75 | if (urb->iso_frame_desc[i].status) { /* active? hmm, skip this */ |
76 | snd_printk("activ frame status %i. Most propably some hardware problem.\n", urb->iso_frame_desc[i].status); | 76 | snd_printk(KERN_ERR "activ frame status %i. Most propably some hardware problem.\n", urb->iso_frame_desc[i].status); |
77 | return urb->iso_frame_desc[i].status; | 77 | return urb->iso_frame_desc[i].status; |
78 | } | 78 | } |
79 | lens += urb->iso_frame_desc[i].actual_length / usX2Y->stride; | 79 | lens += urb->iso_frame_desc[i].actual_length / usX2Y->stride; |
@@ -126,7 +126,7 @@ static int usX2Y_hwdep_urb_play_prepare(snd_usX2Y_substream_t *subs, | |||
126 | /* calculate the size of a packet */ | 126 | /* calculate the size of a packet */ |
127 | counts = shm->captured_iso[shm->playback_iso_head].length / usX2Y->stride; | 127 | counts = shm->captured_iso[shm->playback_iso_head].length / usX2Y->stride; |
128 | if (counts < 43 || counts > 50) { | 128 | if (counts < 43 || counts > 50) { |
129 | snd_printk("should not be here with counts=%i\n", counts); | 129 | snd_printk(KERN_ERR "should not be here with counts=%i\n", counts); |
130 | return -EPIPE; | 130 | return -EPIPE; |
131 | } | 131 | } |
132 | /* set up descriptor */ | 132 | /* set up descriptor */ |