[alsa-devel] [PATCH 1/1] Allow any MIDI endpoint to drive use of interrupt transfer on Roland devices

maillist at superlative.org maillist at superlative.org
Sat Oct 10 20:59:01 CEST 2015


From: "Keith A. Milner" <kamilner at superlative.org>

Signed-off-by: Keith A. Milner <maillist at superlative.org>

diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index b901f46..52b8c72 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1860,9 +1860,14 @@ static void snd_usbmidi_switch_roland_altsetting(struct snd_usb_midi* umidi)
 
 	hostif = &intf->altsetting[1];
 	intfd = get_iface_desc(hostif);
+	/* If either or both of the endpoints support interrupt transfer,
+	 * then use the alternate setting
+	 */
 	if (intfd->bNumEndpoints != 2 ||
-	    (get_endpoint(hostif, 0)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK ||
-	    (get_endpoint(hostif, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
+	    !((get_endpoint(hostif, 0)->bmAttributes
+	      & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT ||
+	    (get_endpoint(hostif, 1)->bmAttributes
+	      & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT))
 		return;
 
 	snd_printdd(KERN_INFO "switching to altsetting %d with int ep\n",
-- 
1.9.1



More information about the Alsa-devel mailing list