All of lore.kernel.org
 help / color / mirror / Atom feed
From: maillist@superlative.org
To: patch@alsa-project.org
Cc: alsa-devel@alsa-project.org,
	"Keith A. Milner" <maillist@superlative.org>,
	"Keith A. Milner" <kamilner@superlative.org>
Subject: [PATCH 1/1] Allow any MIDI endpoint to drive use of interrupt transfer on Roland devices
Date: Sat, 10 Oct 2015 19:59:01 +0100	[thread overview]
Message-ID: <56195ffb.8ac9c20a.97c1e.ffffff8a@mx.google.com> (raw)

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

Signed-off-by: Keith A. Milner <maillist@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

             reply	other threads:[~2015-10-10 18:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-10 18:59 maillist [this message]
2015-10-11  7:17 ` [PATCH 1/1] Allow any MIDI endpoint to drive use of interrupt transfer on Roland devices Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56195ffb.8ac9c20a.97c1e.ffffff8a@mx.google.com \
    --to=maillist@superlative.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=kamilner@superlative.org \
    --cc=patch@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.