[ALSA] usb-audio: allow output interrupt transfers for MIDI
authorClemens Ladisch <clemens@ladisch.de>
Tue, 21 Aug 2007 06:56:08 +0000 (08:56 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 16 Oct 2007 13:59:18 +0000 (15:59 +0200)
Allow output interrupt transfers for some MIDI devices that require
them.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/usb/usbmidi.c

index 2bb1834a8c22fe532ab611ae9c1cc8051f377f35..4bacb50e9ad9aafbaf9d17b84bf848b6233be9ff 100644 (file)
@@ -983,8 +983,10 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
                snd_usbmidi_out_endpoint_delete(ep);
                return -ENOMEM;
        }
-       /* we never use interrupt output pipes */
-       pipe = usb_sndbulkpipe(umidi->chip->dev, ep_info->out_ep);
+       if (ep_info->out_interval)
+               pipe = usb_sndintpipe(umidi->chip->dev, ep_info->out_ep);
+       else
+               pipe = usb_sndbulkpipe(umidi->chip->dev, ep_info->out_ep);
        if (umidi->chip->usb_id == USB_ID(0x0a92, 0x1020)) /* ESI M4U */
                /* FIXME: we need more URBs to get reasonable bandwidth here: */
                ep->max_transfer = 4;
@@ -996,8 +998,14 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
                snd_usbmidi_out_endpoint_delete(ep);
                return -ENOMEM;
        }
-       usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer,
-                         ep->max_transfer, snd_usbmidi_out_urb_complete, ep);
+       if (ep_info->out_interval)
+               usb_fill_int_urb(ep->urb, umidi->chip->dev, pipe, buffer,
+                                ep->max_transfer, snd_usbmidi_out_urb_complete,
+                                ep, ep_info->out_interval);
+       else
+               usb_fill_bulk_urb(ep->urb, umidi->chip->dev,
+                                 pipe, buffer, ep->max_transfer,
+                                 snd_usbmidi_out_urb_complete, ep);
        ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
 
        spin_lock_init(&ep->buffer_lock);