aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-07-30 01:55:32 -0400
committerLen Brown <len.brown@intel.com>2005-07-30 01:55:32 -0400
commitadbedd34244e2b054557002817f979a9b004a405 (patch)
tree78e4a524e84f8b3e23ae8b49ac689048584e4668 /sound/usb
parentd6ac1a7910d22626bc77e73db091e00b810715f4 (diff)
parentb0825488a642cadcf39709961dde61440cb0731c (diff)
merge 2.6.13-rc4 with ACPI's to-linus tree
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/usbaudio.c105
-rw-r--r--sound/usb/usbaudio.h38
-rw-r--r--sound/usb/usbmidi.c21
-rw-r--r--sound/usb/usbquirks.h29
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.c3
-rw-r--r--sound/usb/usx2y/usx2yhwdeppcm.c6
6 files changed, 126 insertions, 76 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index b5e734d975e0..8298c462c291 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -153,6 +153,7 @@ struct snd_usb_substream {
153 unsigned int format; /* USB data format */ 153 unsigned int format; /* USB data format */
154 unsigned int datapipe; /* the data i/o pipe */ 154 unsigned int datapipe; /* the data i/o pipe */
155 unsigned int syncpipe; /* 1 - async out or adaptive in */ 155 unsigned int syncpipe; /* 1 - async out or adaptive in */
156 unsigned int datainterval; /* log_2 of data packet interval */
156 unsigned int syncinterval; /* P for adaptive mode, 0 otherwise */ 157 unsigned int syncinterval; /* P for adaptive mode, 0 otherwise */
157 unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */ 158 unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */
158 unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */ 159 unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */
@@ -518,7 +519,8 @@ static int prepare_playback_urb(snd_usb_substream_t *subs,
518 if (subs->fill_max) 519 if (subs->fill_max)
519 counts = subs->maxframesize; /* fixed */ 520 counts = subs->maxframesize; /* fixed */
520 else { 521 else {
521 subs->phase = (subs->phase & 0xffff) + subs->freqm; 522 subs->phase = (subs->phase & 0xffff)
523 + (subs->freqm << subs->datainterval);
522 counts = subs->phase >> 16; 524 counts = subs->phase >> 16;
523 if (counts > subs->maxframesize) 525 if (counts > subs->maxframesize)
524 counts = subs->maxframesize; 526 counts = subs->maxframesize;
@@ -790,7 +792,7 @@ static int start_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
790 */ 792 */
791static int wait_clear_urbs(snd_usb_substream_t *subs) 793static int wait_clear_urbs(snd_usb_substream_t *subs)
792{ 794{
793 int timeout = HZ; 795 unsigned long end_time = jiffies + msecs_to_jiffies(1000);
794 unsigned int i; 796 unsigned int i;
795 int alive; 797 int alive;
796 798
@@ -810,7 +812,7 @@ static int wait_clear_urbs(snd_usb_substream_t *subs)
810 break; 812 break;
811 set_current_state(TASK_UNINTERRUPTIBLE); 813 set_current_state(TASK_UNINTERRUPTIBLE);
812 schedule_timeout(1); 814 schedule_timeout(1);
813 } while (--timeout > 0); 815 } while (time_before(jiffies, end_time));
814 if (alive) 816 if (alive)
815 snd_printk(KERN_ERR "timeout: still %d active urbs..\n", alive); 817 snd_printk(KERN_ERR "timeout: still %d active urbs..\n", alive);
816 return 0; 818 return 0;
@@ -899,16 +901,19 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by
899 else 901 else
900 subs->freqn = get_usb_high_speed_rate(rate); 902 subs->freqn = get_usb_high_speed_rate(rate);
901 subs->freqm = subs->freqn; 903 subs->freqm = subs->freqn;
902 subs->freqmax = subs->freqn + (subs->freqn >> 2); /* max. allowed frequency */ 904 /* calculate max. frequency */
903 subs->phase = 0; 905 if (subs->maxpacksize) {
904 906 /* whatever fits into a max. size packet */
905 /* calculate the max. size of packet */
906 maxsize = ((subs->freqmax + 0xffff) * (frame_bits >> 3)) >> 16;
907 if (subs->maxpacksize && maxsize > subs->maxpacksize) {
908 //snd_printd(KERN_DEBUG "maxsize %d is greater than defined size %d\n",
909 // maxsize, subs->maxpacksize);
910 maxsize = subs->maxpacksize; 907 maxsize = subs->maxpacksize;
908 subs->freqmax = (maxsize / (frame_bits >> 3))
909 << (16 - subs->datainterval);
910 } else {
911 /* no max. packet size: just take 25% higher than nominal */
912 subs->freqmax = subs->freqn + (subs->freqn >> 2);
913 maxsize = ((subs->freqmax + 0xffff) * (frame_bits >> 3))
914 >> (16 - subs->datainterval);
911 } 915 }
916 subs->phase = 0;
912 917
913 if (subs->fill_max) 918 if (subs->fill_max)
914 subs->curpacksize = subs->maxpacksize; 919 subs->curpacksize = subs->maxpacksize;
@@ -918,7 +923,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by
918 if (snd_usb_get_speed(subs->dev) == USB_SPEED_FULL) 923 if (snd_usb_get_speed(subs->dev) == USB_SPEED_FULL)
919 urb_packs = nrpacks; 924 urb_packs = nrpacks;
920 else 925 else
921 urb_packs = nrpacks * 8; 926 urb_packs = (nrpacks * 8) >> subs->datainterval;
922 927
923 /* allocate a temporary buffer for playback */ 928 /* allocate a temporary buffer for playback */
924 if (is_playback) { 929 if (is_playback) {
@@ -991,7 +996,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by
991 u->urb->pipe = subs->datapipe; 996 u->urb->pipe = subs->datapipe;
992 u->urb->transfer_flags = URB_ISO_ASAP; 997 u->urb->transfer_flags = URB_ISO_ASAP;
993 u->urb->number_of_packets = u->packets; 998 u->urb->number_of_packets = u->packets;
994 u->urb->interval = 1; 999 u->urb->interval = 1 << subs->datainterval;
995 u->urb->context = u; 1000 u->urb->context = u;
996 u->urb->complete = snd_usb_complete_callback(snd_complete_urb); 1001 u->urb->complete = snd_usb_complete_callback(snd_complete_urb);
997 } 1002 }
@@ -1195,6 +1200,12 @@ static int set_format(snd_usb_substream_t *subs, struct audioformat *fmt)
1195 subs->datapipe = usb_sndisocpipe(dev, ep); 1200 subs->datapipe = usb_sndisocpipe(dev, ep);
1196 else 1201 else
1197 subs->datapipe = usb_rcvisocpipe(dev, ep); 1202 subs->datapipe = usb_rcvisocpipe(dev, ep);
1203 if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH &&
1204 get_endpoint(alts, 0)->bInterval >= 1 &&
1205 get_endpoint(alts, 0)->bInterval <= 4)
1206 subs->datainterval = get_endpoint(alts, 0)->bInterval - 1;
1207 else
1208 subs->datainterval = 0;
1198 subs->syncpipe = subs->syncinterval = 0; 1209 subs->syncpipe = subs->syncinterval = 0;
1199 subs->maxpacksize = fmt->maxpacksize; 1210 subs->maxpacksize = fmt->maxpacksize;
1200 subs->fill_max = 0; 1211 subs->fill_max = 0;
@@ -2397,10 +2408,9 @@ static int parse_audio_format(snd_usb_audio_t *chip, struct audioformat *fp,
2397 if (chip->usb_id == USB_ID(0x041e, 0x3000) || 2408 if (chip->usb_id == USB_ID(0x041e, 0x3000) ||
2398 chip->usb_id == USB_ID(0x041e, 0x3020)) { 2409 chip->usb_id == USB_ID(0x041e, 0x3020)) {
2399 if (fmt[3] == USB_FORMAT_TYPE_I && 2410 if (fmt[3] == USB_FORMAT_TYPE_I &&
2400 stream == SNDRV_PCM_STREAM_PLAYBACK &&
2401 fp->rates != SNDRV_PCM_RATE_48000 && 2411 fp->rates != SNDRV_PCM_RATE_48000 &&
2402 fp->rates != SNDRV_PCM_RATE_96000) 2412 fp->rates != SNDRV_PCM_RATE_96000)
2403 return -1; /* use 48k only */ 2413 return -1;
2404 } 2414 }
2405#endif 2415#endif
2406 return 0; 2416 return 0;
@@ -2492,8 +2502,10 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, int iface_no)
2492 fp->altset_idx = i; 2502 fp->altset_idx = i;
2493 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 2503 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
2494 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 2504 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
2495 /* FIXME: decode wMaxPacketSize of high bandwith endpoints */
2496 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 2505 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
2506 if (snd_usb_get_speed(dev) == USB_SPEED_HIGH)
2507 fp->maxpacksize = (((fp->maxpacksize >> 11) & 3) + 1)
2508 * (fp->maxpacksize & 0x7ff);
2497 fp->attributes = csep[3]; 2509 fp->attributes = csep[3];
2498 2510
2499 /* some quirks for attributes here */ 2511 /* some quirks for attributes here */
@@ -2723,7 +2735,8 @@ static int create_standard_interface_quirk(snd_usb_audio_t *chip,
2723 * to detect the sample rate is by looking at wMaxPacketSize. 2735 * to detect the sample rate is by looking at wMaxPacketSize.
2724 */ 2736 */
2725static int create_ua700_ua25_quirk(snd_usb_audio_t *chip, 2737static int create_ua700_ua25_quirk(snd_usb_audio_t *chip,
2726 struct usb_interface *iface) 2738 struct usb_interface *iface,
2739 const snd_usb_audio_quirk_t *quirk)
2727{ 2740{
2728 static const struct audioformat ua_format = { 2741 static const struct audioformat ua_format = {
2729 .format = SNDRV_PCM_FORMAT_S24_3LE, 2742 .format = SNDRV_PCM_FORMAT_S24_3LE,
@@ -2814,7 +2827,9 @@ static int create_ua700_ua25_quirk(snd_usb_audio_t *chip,
2814/* 2827/*
2815 * Create a stream for an Edirol UA-1000 interface. 2828 * Create a stream for an Edirol UA-1000 interface.
2816 */ 2829 */
2817static int create_ua1000_quirk(snd_usb_audio_t *chip, struct usb_interface *iface) 2830static int create_ua1000_quirk(snd_usb_audio_t *chip,
2831 struct usb_interface *iface,
2832 const snd_usb_audio_quirk_t *quirk)
2818{ 2833{
2819 static const struct audioformat ua1000_format = { 2834 static const struct audioformat ua1000_format = {
2820 .format = SNDRV_PCM_FORMAT_S32_LE, 2835 .format = SNDRV_PCM_FORMAT_S32_LE,
@@ -2891,6 +2906,13 @@ static int create_composite_quirk(snd_usb_audio_t *chip,
2891 return 0; 2906 return 0;
2892} 2907}
2893 2908
2909static int ignore_interface_quirk(snd_usb_audio_t *chip,
2910 struct usb_interface *iface,
2911 const snd_usb_audio_quirk_t *quirk)
2912{
2913 return 0;
2914}
2915
2894 2916
2895/* 2917/*
2896 * boot quirks 2918 * boot quirks
@@ -2926,8 +2948,6 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac
2926 2948
2927static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev) 2949static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev)
2928{ 2950{
2929#if 0
2930 /* TODO: enable this when high speed synchronization actually works */
2931 u8 buf = 1; 2951 u8 buf = 1;
2932 2952
2933 snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x2a, 2953 snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x2a,
@@ -2939,7 +2959,6 @@ static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev)
2939 1, 2000, NULL, 0, 1000); 2959 1, 2000, NULL, 0, 1000);
2940 return -ENODEV; 2960 return -ENODEV;
2941 } 2961 }
2942#endif
2943 return 0; 2962 return 0;
2944} 2963}
2945 2964
@@ -2956,28 +2975,28 @@ static int snd_usb_create_quirk(snd_usb_audio_t *chip,
2956 struct usb_interface *iface, 2975 struct usb_interface *iface,
2957 const snd_usb_audio_quirk_t *quirk) 2976 const snd_usb_audio_quirk_t *quirk)
2958{ 2977{
2959 switch (quirk->type) { 2978 typedef int (*quirk_func_t)(snd_usb_audio_t *, struct usb_interface *,
2960 case QUIRK_MIDI_FIXED_ENDPOINT: 2979 const snd_usb_audio_quirk_t *);
2961 case QUIRK_MIDI_YAMAHA: 2980 static const quirk_func_t quirk_funcs[] = {
2962 case QUIRK_MIDI_MIDIMAN: 2981 [QUIRK_IGNORE_INTERFACE] = ignore_interface_quirk,
2963 case QUIRK_MIDI_NOVATION: 2982 [QUIRK_COMPOSITE] = create_composite_quirk,
2964 case QUIRK_MIDI_MOTU: 2983 [QUIRK_MIDI_STANDARD_INTERFACE] = snd_usb_create_midi_interface,
2965 case QUIRK_MIDI_EMAGIC: 2984 [QUIRK_MIDI_FIXED_ENDPOINT] = snd_usb_create_midi_interface,
2966 return snd_usb_create_midi_interface(chip, iface, quirk); 2985 [QUIRK_MIDI_YAMAHA] = snd_usb_create_midi_interface,
2967 case QUIRK_COMPOSITE: 2986 [QUIRK_MIDI_MIDIMAN] = snd_usb_create_midi_interface,
2968 return create_composite_quirk(chip, iface, quirk); 2987 [QUIRK_MIDI_NOVATION] = snd_usb_create_midi_interface,
2969 case QUIRK_AUDIO_FIXED_ENDPOINT: 2988 [QUIRK_MIDI_RAW] = snd_usb_create_midi_interface,
2970 return create_fixed_stream_quirk(chip, iface, quirk); 2989 [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface,
2971 case QUIRK_AUDIO_STANDARD_INTERFACE: 2990 [QUIRK_MIDI_MIDITECH] = snd_usb_create_midi_interface,
2972 case QUIRK_MIDI_STANDARD_INTERFACE: 2991 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_interface_quirk,
2973 return create_standard_interface_quirk(chip, iface, quirk); 2992 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
2974 case QUIRK_AUDIO_EDIROL_UA700_UA25: 2993 [QUIRK_AUDIO_EDIROL_UA700_UA25] = create_ua700_ua25_quirk,
2975 return create_ua700_ua25_quirk(chip, iface); 2994 [QUIRK_AUDIO_EDIROL_UA1000] = create_ua1000_quirk,
2976 case QUIRK_AUDIO_EDIROL_UA1000: 2995 };
2977 return create_ua1000_quirk(chip, iface); 2996
2978 case QUIRK_IGNORE_INTERFACE: 2997 if (quirk->type < QUIRK_TYPE_COUNT) {
2979 return 0; 2998 return quirk_funcs[quirk->type](chip, iface, quirk);
2980 default: 2999 } else {
2981 snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); 3000 snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
2982 return -ENXIO; 3001 return -ENXIO;
2983 } 3002 }
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index aedb42aaa749..ad9eab211d8f 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -153,20 +153,24 @@ struct snd_usb_audio {
153#define QUIRK_NO_INTERFACE -2 153#define QUIRK_NO_INTERFACE -2
154#define QUIRK_ANY_INTERFACE -1 154#define QUIRK_ANY_INTERFACE -1
155 155
156/* quirk type */ 156enum quirk_type {
157#define QUIRK_MIDI_FIXED_ENDPOINT 0 157 QUIRK_IGNORE_INTERFACE,
158#define QUIRK_MIDI_YAMAHA 1 158 QUIRK_COMPOSITE,
159#define QUIRK_MIDI_MIDIMAN 2 159 QUIRK_MIDI_STANDARD_INTERFACE,
160#define QUIRK_COMPOSITE 3 160 QUIRK_MIDI_FIXED_ENDPOINT,
161#define QUIRK_AUDIO_FIXED_ENDPOINT 4 161 QUIRK_MIDI_YAMAHA,
162#define QUIRK_AUDIO_STANDARD_INTERFACE 5 162 QUIRK_MIDI_MIDIMAN,
163#define QUIRK_MIDI_STANDARD_INTERFACE 6 163 QUIRK_MIDI_NOVATION,
164#define QUIRK_AUDIO_EDIROL_UA700_UA25 7 164 QUIRK_MIDI_RAW,
165#define QUIRK_AUDIO_EDIROL_UA1000 8 165 QUIRK_MIDI_EMAGIC,
166#define QUIRK_IGNORE_INTERFACE 9 166 QUIRK_MIDI_MIDITECH,
167#define QUIRK_MIDI_NOVATION 10 167 QUIRK_AUDIO_STANDARD_INTERFACE,
168#define QUIRK_MIDI_MOTU 11 168 QUIRK_AUDIO_FIXED_ENDPOINT,
169#define QUIRK_MIDI_EMAGIC 12 169 QUIRK_AUDIO_EDIROL_UA700_UA25,
170 QUIRK_AUDIO_EDIROL_UA1000,
171
172 QUIRK_TYPE_COUNT
173};
170 174
171typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t; 175typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t;
172typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t; 176typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t;
@@ -175,7 +179,7 @@ struct snd_usb_audio_quirk {
175 const char *vendor_name; 179 const char *vendor_name;
176 const char *product_name; 180 const char *product_name;
177 int16_t ifnum; 181 int16_t ifnum;
178 int16_t type; 182 uint16_t type;
179 const void *data; 183 const void *data;
180}; 184};
181 185
@@ -205,11 +209,13 @@ struct snd_usb_midi_endpoint_info {
205 209
206/* for QUIRK_IGNORE_INTERFACE, data is NULL */ 210/* for QUIRK_IGNORE_INTERFACE, data is NULL */
207 211
208/* for QUIRK_MIDI_NOVATION and _MOTU, data is NULL */ 212/* for QUIRK_MIDI_NOVATION and _RAW, data is NULL */
209 213
210/* for QUIRK_MIDI_EMAGIC, data points to a snd_usb_midi_endpoint_info 214/* for QUIRK_MIDI_EMAGIC, data points to a snd_usb_midi_endpoint_info
211 * structure (out_cables and in_cables only) */ 215 * structure (out_cables and in_cables only) */
212 216
217/* for QUIRK_MIDI_MIDITECH, data is NULL */
218
213/* 219/*
214 */ 220 */
215 221
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index bee70068dce0..5778a9b725ec 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -524,16 +524,16 @@ static struct usb_protocol_ops snd_usbmidi_novation_ops = {
524}; 524};
525 525
526/* 526/*
527 * Mark of the Unicorn USB MIDI protocol: raw MIDI. 527 * "raw" protocol: used by the MOTU FastLane.
528 */ 528 */
529 529
530static void snd_usbmidi_motu_input(snd_usb_midi_in_endpoint_t* ep, 530static void snd_usbmidi_raw_input(snd_usb_midi_in_endpoint_t* ep,
531 uint8_t* buffer, int buffer_length) 531 uint8_t* buffer, int buffer_length)
532{ 532{
533 snd_usbmidi_input_data(ep, 0, buffer, buffer_length); 533 snd_usbmidi_input_data(ep, 0, buffer, buffer_length);
534} 534}
535 535
536static void snd_usbmidi_motu_output(snd_usb_midi_out_endpoint_t* ep) 536static void snd_usbmidi_raw_output(snd_usb_midi_out_endpoint_t* ep)
537{ 537{
538 int count; 538 int count;
539 539
@@ -549,9 +549,9 @@ static void snd_usbmidi_motu_output(snd_usb_midi_out_endpoint_t* ep)
549 ep->urb->transfer_buffer_length = count; 549 ep->urb->transfer_buffer_length = count;
550} 550}
551 551
552static struct usb_protocol_ops snd_usbmidi_motu_ops = { 552static struct usb_protocol_ops snd_usbmidi_raw_ops = {
553 .input = snd_usbmidi_motu_input, 553 .input = snd_usbmidi_raw_input,
554 .output = snd_usbmidi_motu_output, 554 .output = snd_usbmidi_raw_output,
555}; 555};
556 556
557/* 557/*
@@ -1505,8 +1505,8 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip,
1505 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; 1505 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
1506 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 1506 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
1507 break; 1507 break;
1508 case QUIRK_MIDI_MOTU: 1508 case QUIRK_MIDI_RAW:
1509 umidi->usb_protocol_ops = &snd_usbmidi_motu_ops; 1509 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
1510 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 1510 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
1511 break; 1511 break;
1512 case QUIRK_MIDI_EMAGIC: 1512 case QUIRK_MIDI_EMAGIC:
@@ -1515,6 +1515,9 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip,
1515 sizeof(snd_usb_midi_endpoint_info_t)); 1515 sizeof(snd_usb_midi_endpoint_info_t));
1516 err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); 1516 err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1);
1517 break; 1517 break;
1518 case QUIRK_MIDI_MIDITECH:
1519 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
1520 break;
1518 default: 1521 default:
1519 snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); 1522 snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
1520 err = -ENXIO; 1523 err = -ENXIO;
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index f5135641b3e2..f74e652a1e51 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -116,6 +116,7 @@ YAMAHA_DEVICE(0x1039, NULL),
116YAMAHA_DEVICE(0x103a, NULL), 116YAMAHA_DEVICE(0x103a, NULL),
117YAMAHA_DEVICE(0x103b, NULL), 117YAMAHA_DEVICE(0x103b, NULL),
118YAMAHA_DEVICE(0x103c, NULL), 118YAMAHA_DEVICE(0x103c, NULL),
119YAMAHA_DEVICE(0x103d, NULL),
119YAMAHA_DEVICE(0x2000, "DGP-7"), 120YAMAHA_DEVICE(0x2000, "DGP-7"),
120YAMAHA_DEVICE(0x2001, "DGP-5"), 121YAMAHA_DEVICE(0x2001, "DGP-5"),
121YAMAHA_DEVICE(0x2002, NULL), 122YAMAHA_DEVICE(0x2002, NULL),
@@ -1259,7 +1260,12 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1259/* Mark of the Unicorn devices */ 1260/* Mark of the Unicorn devices */
1260{ 1261{
1261 /* thanks to Robert A. Lerche <ral 'at' msbit.com> */ 1262 /* thanks to Robert A. Lerche <ral 'at' msbit.com> */
1262 USB_DEVICE(0x07fd, 0x0001), 1263 .match_flags = USB_DEVICE_ID_MATCH_VENDOR |
1264 USB_DEVICE_ID_MATCH_PRODUCT |
1265 USB_DEVICE_ID_MATCH_DEV_SUBCLASS,
1266 .idVendor = 0x07fd,
1267 .idProduct = 0x0001,
1268 .bDeviceSubClass = 2,
1263 .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { 1269 .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
1264 .vendor_name = "MOTU", 1270 .vendor_name = "MOTU",
1265 .product_name = "Fastlane", 1271 .product_name = "Fastlane",
@@ -1268,7 +1274,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1268 .data = & (const snd_usb_audio_quirk_t[]) { 1274 .data = & (const snd_usb_audio_quirk_t[]) {
1269 { 1275 {
1270 .ifnum = 0, 1276 .ifnum = 0,
1271 .type = QUIRK_MIDI_MOTU 1277 .type = QUIRK_MIDI_RAW
1272 }, 1278 },
1273 { 1279 {
1274 .ifnum = 1, 1280 .ifnum = 1,
@@ -1373,6 +1379,25 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1373}, 1379},
1374 1380
1375{ 1381{
1382 USB_DEVICE(0x4752, 0x0011),
1383 .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
1384 .vendor_name = "Miditech",
1385 .product_name = "Midistart-2",
1386 .ifnum = 0,
1387 .type = QUIRK_MIDI_MIDITECH
1388 }
1389},
1390{
1391 USB_DEVICE(0x7104, 0x2202),
1392 .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
1393 .vendor_name = "Miditech",
1394 .product_name = "MidiStudio-2",
1395 .ifnum = 0,
1396 .type = QUIRK_MIDI_MIDITECH
1397 }
1398},
1399
1400{
1376 /* 1401 /*
1377 * Some USB MIDI devices don't have an audio control interface, 1402 * Some USB MIDI devices don't have an audio control interface,
1378 * so we have to grab MIDI streaming interfaces here. 1403 * so we have to grab MIDI streaming interfaces here.
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c
index bef9b0c142c4..0281a362857a 100644
--- a/sound/usb/usx2y/usX2Yhwdep.c
+++ b/sound/usb/usx2y/usX2Yhwdep.c
@@ -232,8 +232,7 @@ static int snd_usX2Y_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp)
232 if (err) 232 if (err)
233 return err; 233 return err;
234 if (dsp->index == 1) { 234 if (dsp->index == 1) {
235 set_current_state(TASK_UNINTERRUPTIBLE); 235 msleep(250); // give the device some time
236 schedule_timeout(HZ/4); // give the device some time
237 err = usX2Y_AsyncSeq04_init(priv); 236 err = usX2Y_AsyncSeq04_init(priv);
238 if (err) { 237 if (err) {
239 snd_printk("usX2Y_AsyncSeq04_init error \n"); 238 snd_printk("usX2Y_AsyncSeq04_init error \n");
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c
index bb2c8e9000c6..ef28061287f2 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.c
+++ b/sound/usb/usx2y/usx2yhwdeppcm.c
@@ -50,6 +50,7 @@
50 Currently rawusb dma pcm buffer transport (this file) is only available to snd-usb-usx2y. 50 Currently rawusb dma pcm buffer transport (this file) is only available to snd-usb-usx2y.
51*/ 51*/
52 52
53#include <linux/delay.h>
53#include "usbusx2yaudio.c" 54#include "usbusx2yaudio.c"
54 55
55#if defined(USX2Y_NRPACKS_VARIABLE) || (!defined(USX2Y_NRPACKS_VARIABLE) && USX2Y_NRPACKS == 1) 56#if defined(USX2Y_NRPACKS_VARIABLE) || (!defined(USX2Y_NRPACKS_VARIABLE) && USX2Y_NRPACKS == 1)
@@ -520,11 +521,8 @@ static int snd_usX2Y_usbpcm_prepare(snd_pcm_substream_t *substream)
520 usX2Y->hwdep_pcm_shm->playback_iso_start = -1; 521 usX2Y->hwdep_pcm_shm->playback_iso_start = -1;
521 if (atomic_read(&subs->state) < state_PREPARED) { 522 if (atomic_read(&subs->state) < state_PREPARED) {
522 while (usX2Y_iso_frames_per_buffer(runtime, usX2Y) > usX2Y->hwdep_pcm_shm->captured_iso_frames) { 523 while (usX2Y_iso_frames_per_buffer(runtime, usX2Y) > usX2Y->hwdep_pcm_shm->captured_iso_frames) {
523 signed long timeout;
524 snd_printd("Wait: iso_frames_per_buffer=%i,captured_iso_frames=%i\n", usX2Y_iso_frames_per_buffer(runtime, usX2Y), usX2Y->hwdep_pcm_shm->captured_iso_frames); 524 snd_printd("Wait: iso_frames_per_buffer=%i,captured_iso_frames=%i\n", usX2Y_iso_frames_per_buffer(runtime, usX2Y), usX2Y->hwdep_pcm_shm->captured_iso_frames);
525 set_current_state(TASK_INTERRUPTIBLE); 525 if (msleep_interruptible(10)) {
526 timeout = schedule_timeout(HZ/100 + 1);
527 if (signal_pending(current)) {
528 err = -ERESTARTSYS; 526 err = -ERESTARTSYS;
529 goto up_prepare_mutex; 527 goto up_prepare_mutex;
530 } 528 }