Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1266676
| From | "Felipe F. Tonello" <eu@felipetonello.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v5 6/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface |
| Date | 2015-11-10 19:00 +0100 |
| Message-ID | <qtln4-8aF-19@gated-at.bofh.it> (permalink) |
| References | <qtln3-8aF-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This avoids duplication of USB requests for OUT endpoint and
re-enabling endpoints.
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
---
drivers/usb/gadget/function/f_midi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 76ea53c..615d632 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -75,6 +75,7 @@ struct f_midi {
struct usb_ep *in_ep, *out_ep;
struct snd_card *card;
struct snd_rawmidi *rmidi;
+ u8 ms_id;
struct snd_rawmidi_substream *in_substream[MAX_PORTS];
struct snd_rawmidi_substream *out_substream[MAX_PORTS];
@@ -322,7 +323,7 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
int err;
/* For Control Device interface we do nothing */
- if (intf == 0)
+ if (intf != midi->ms_id)
return 0;
err = f_midi_start_ep(midi, f, midi->in_ep);
@@ -730,6 +731,7 @@ static int f_midi_bind(struct usb_configuration *c, struct usb_function *f)
goto fail;
ms_interface_desc.bInterfaceNumber = status;
ac_header_desc.baInterfaceNr[0] = status;
+ midi->ms_id = status;
status = -ENODEV;
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v5 6/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface "Felipe F. Tonello" <eu@felipetonello.com> - 2015-11-10 19:00 +0100
Re: [PATCH v5 6/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-11-10 19:50 +0100
Re: [PATCH v5 6/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface Felipe Ferreri Tonello <eu@felipetonello.com> - 2015-11-11 10:40 +0100
Re: [PATCH v5 6/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-11-11 19:10 +0100
Re: [PATCH v5 6/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface Clemens Ladisch <clemens@ladisch.de> - 2015-11-13 09:20 +0100
Re: [PATCH v5 6/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface Clemens Ladisch <clemens@ladisch.de> - 2015-11-13 09:20 +0100
csiph-web