All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 1/1] Allow any MIDI endpoint to drive use of interrupt transfer on newer Roland devices
@ 2015-10-11 14:19 maillist
  2015-10-11 16:21 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: maillist @ 2015-10-11 14:19 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel, Keith A. Milner

From: "Keith A. Milner" <maillist@superlative.org>

This patch enables interrupt transfer mode for MIDI ports on newer
Boss/Roland devices such as the GT-100/001 which support interrupt
transfer on both IN and OUT MIDI endpoints. Previously this wasn't being
enabled for these devices as the code was specifically looking for the
scenario where the IN endpoint supported interrupt transfer and the OUT
endpoint was bulk transfer. Newer devices support interrupt transfer for
both endpoints.

This has been tested on Boss devices GT-001, BR-80 and JS-8 and Roland
VS-20.

It would benefit from some regresison testing with other devices if
possible.

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

diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index b901f46..d50c649 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-11 17:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-11 14:19 [RESEND PATCH 1/1] Allow any MIDI endpoint to drive use of interrupt transfer on newer Roland devices maillist
2015-10-11 16:21 ` Takashi Iwai
2015-10-11 17:23   ` Keith A. Milner
2015-10-11 17:44     ` Takashi Iwai
2015-10-11 17:48       ` Keith A. Milner
2015-10-11 17:50         ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.