Commit a6a712ae authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela

[ALSA] usb-audio: allow output interrupt transfers for MIDI

Allow output interrupt transfers for some MIDI devices that require
them.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent d53d7d9e
...@@ -983,7 +983,9 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi, ...@@ -983,7 +983,9 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
snd_usbmidi_out_endpoint_delete(ep); snd_usbmidi_out_endpoint_delete(ep);
return -ENOMEM; return -ENOMEM;
} }
/* we never use interrupt output pipes */ 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); pipe = usb_sndbulkpipe(umidi->chip->dev, ep_info->out_ep);
if (umidi->chip->usb_id == USB_ID(0x0a92, 0x1020)) /* ESI M4U */ if (umidi->chip->usb_id == USB_ID(0x0a92, 0x1020)) /* ESI M4U */
/* FIXME: we need more URBs to get reasonable bandwidth here: */ /* FIXME: we need more URBs to get reasonable bandwidth here: */
...@@ -996,8 +998,14 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi, ...@@ -996,8 +998,14 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
snd_usbmidi_out_endpoint_delete(ep); snd_usbmidi_out_endpoint_delete(ep);
return -ENOMEM; return -ENOMEM;
} }
usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, if (ep_info->out_interval)
ep->max_transfer, snd_usbmidi_out_urb_complete, ep); 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; ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
spin_lock_init(&ep->buffer_lock); spin_lock_init(&ep->buffer_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment