From: "Felipe F. Tonello" <eu@felipetonello.com>
To: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Felipe Balbi <balbi@kernel.org>,
Michal Nazarewicz <mina86@mina86.com>,
Clemens Ladisch <clemens@ladisch.de>
Subject: [PATCH 4/5] usb: gadget: f_midi: cleanups and typos fixes
Date: Wed, 2 Mar 2016 19:40:39 +0000 [thread overview]
Message-ID: <1456947640-20673-5-git-send-email-eu@felipetonello.com> (raw)
In-Reply-To: <1456947640-20673-1-git-send-email-eu@felipetonello.com>
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
---
drivers/usb/gadget/function/f_midi.c | 77 +++++++++++++++++++-----------------
1 file changed, 40 insertions(+), 37 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 8475e3dc82d4..9a9e6112e224 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -1,5 +1,5 @@
/*
- * f_midi.c -- USB MIDI class function driver
+ * f_midi.c -- USB-MIDI class function driver
*
* Copyright (C) 2006 Thumtronics Pty Ltd.
* Developed for Thumtronics by Grey Innovation
@@ -16,7 +16,7 @@
* Copyright (C) 2006 Thumtronics Pty Ltd.
* Ben Williamson <ben.williamson@greyinnovation.com>
*
- * Licensed under the GPL-2 or later.
+ * Licensed under the GPLv2.
*/
#include <linux/kernel.h>
@@ -41,8 +41,8 @@
MODULE_AUTHOR("Ben Williamson");
MODULE_LICENSE("GPL v2");
-static const char f_midi_shortname[] = "f_midi";
-static const char f_midi_longname[] = "MIDI Gadget";
+static const char f_midi_shortname[] = "f_midi";
+static const char f_midi_longname[] = "MIDI Gadget";
/*
* We can only handle 16 cables on one single endpoint, as cable numbers are
@@ -78,28 +78,31 @@ struct gmidi_in_port {
};
struct f_midi {
- struct usb_function func;
- struct usb_gadget *gadget;
- struct usb_ep *in_ep, *out_ep;
- struct snd_card *card;
- struct snd_rawmidi *rmidi;
- u8 ms_id;
-
- struct snd_rawmidi_substream *out_substream[MAX_PORTS];
-
- unsigned long out_triggered;
- struct tasklet_struct tasklet;
+ struct usb_function func;
+ struct usb_gadget *gadget;
+ struct usb_ep *in_ep, *out_ep;
+ u8 ms_id;
+ unsigned long out_triggered;
unsigned int in_ports;
unsigned int out_ports;
- int index;
- char *id;
- unsigned int buflen, qlen;
+ unsigned int buflen;
+ unsigned int qlen;
+ unsigned int len;
+
/* This fifo is used as a buffer ring for pre-allocated IN usb_requests */
DECLARE_KFIFO_PTR(in_req_fifo, struct usb_request *);
spinlock_t transmit_lock;
+
+ /* ALSA stuff */
+ struct snd_card *card;
+ struct snd_rawmidi *rmidi;
+ struct snd_rawmidi_substream *out_substream[MAX_PORTS];
+ struct tasklet_struct tasklet;
unsigned int in_last_port;
+ int index;
+ char *id;
- struct gmidi_in_port in_ports_array[/* in_ports */];
+ struct gmidi_in_port in_ports_array[/* in_ports */];
};
static inline struct f_midi *func_to_midi(struct usb_function *f)
@@ -191,7 +194,7 @@ static struct usb_ms_endpoint_descriptor_16 ms_in_desc = {
/* string IDs are assigned dynamically */
-#define STRING_FUNC_IDX 0
+#define STRING_FUNC_IDX 0
static struct usb_string midi_string_defs[] = {
[STRING_FUNC_IDX].s = "MIDI function",
@@ -199,7 +202,7 @@ static struct usb_string midi_string_defs[] = {
};
static struct usb_gadget_strings midi_stringtab = {
- .language = 0x0409, /* en-us */
+ .language = 0x0409, /* en-us */
.strings = midi_string_defs,
};
@@ -409,7 +412,7 @@ static int f_midi_snd_free(struct snd_device *device)
}
/*
- * Converts MIDI commands to USB MIDI packets.
+ * Converts MIDI commands to USB-MIDI packets.
*/
static void f_midi_transmit_byte(struct usb_request *req,
struct gmidi_in_port *port, uint8_t b)
@@ -956,15 +959,15 @@ static int f_midi_bind(struct usb_configuration *c, struct usb_function *f)
in_emb->iJack = 0;
midi_function[i++] = (struct usb_descriptor_header *) in_emb;
- out_ext->bLength = USB_DT_MIDI_OUT_SIZE(1);
- out_ext->bDescriptorType = USB_DT_CS_INTERFACE;
- out_ext->bDescriptorSubtype = USB_MS_MIDI_OUT_JACK;
- out_ext->bJackType = USB_MS_EXTERNAL;
- out_ext->bJackID = jack++;
- out_ext->bNrInputPins = 1;
- out_ext->iJack = 0;
- out_ext->pins[0].baSourceID = in_emb->bJackID;
- out_ext->pins[0].baSourcePin = 1;
+ out_ext->bLength = USB_DT_MIDI_OUT_SIZE(1);
+ out_ext->bDescriptorType = USB_DT_CS_INTERFACE;
+ out_ext->bDescriptorSubtype = USB_MS_MIDI_OUT_JACK;
+ out_ext->bJackType = USB_MS_EXTERNAL;
+ out_ext->bJackID = jack++;
+ out_ext->bNrInputPins = 1;
+ out_ext->iJack = 0;
+ out_ext->pins[0].baSourceID = in_emb->bJackID;
+ out_ext->pins[0].baSourcePin = 1;
midi_function[i++] = (struct usb_descriptor_header *) out_ext;
/* link it to the endpoint */
@@ -1251,12 +1254,12 @@ static struct usb_function *f_midi_alloc(struct usb_function_instance *fi)
status = -ENOMEM;
goto setup_fail;
}
- midi->in_ports = opts->in_ports;
- midi->out_ports = opts->out_ports;
- midi->index = opts->index;
- midi->buflen = opts->buflen;
- midi->qlen = opts->qlen;
- midi->in_last_port = 0;
+ midi->in_ports = opts->in_ports;
+ midi->out_ports = opts->out_ports;
+ midi->index = opts->index;
+ midi->buflen = opts->buflen;
+ midi->qlen = opts->qlen;
+ midi->in_last_port = 0;
status = kfifo_alloc(&midi->in_req_fifo, midi->qlen, GFP_KERNEL);
if (status)
--
2.7.2
next prev parent reply other threads:[~2016-03-02 19:38 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 19:40 [PATCH 0/5] MIDI USB Gadget improvements Felipe F. Tonello
2016-03-02 19:40 ` [PATCH 1/5] usb: gadget: f_midi: refactor state machine Felipe F. Tonello
2016-03-02 21:09 ` Clemens Ladisch
2016-03-03 8:57 ` Felipe Ferreri Tonello
2016-03-03 11:38 ` Clemens Ladisch
2016-03-03 16:30 ` Felipe Ferreri Tonello
2016-03-04 8:07 ` Clemens Ladisch
2016-03-04 18:39 ` Felipe Ferreri Tonello
2016-03-04 18:43 ` Clemens Ladisch
2016-03-02 19:40 ` [PATCH 2/5] usb: gadget: f_midi: added spinlock on transmit function Felipe F. Tonello
2016-03-04 7:20 ` Felipe Balbi
2016-03-04 18:49 ` Felipe Ferreri Tonello
2016-03-07 7:32 ` Felipe Balbi
2016-03-07 9:28 ` Felipe Ferreri Tonello
2016-03-08 7:37 ` Felipe Balbi
2016-03-08 13:46 ` Felipe Ferreri Tonello
2016-03-08 14:01 ` Felipe Balbi
2016-03-08 15:40 ` Felipe Ferreri Tonello
2016-03-09 7:22 ` Felipe Balbi
2016-03-02 19:40 ` [PATCH 3/5] usb: gadget: gmidi: remove bus powered requirement on bmAttributes Felipe F. Tonello
2016-03-04 7:16 ` Felipe Balbi
2016-03-04 18:46 ` Felipe Ferreri Tonello
2016-03-07 7:34 ` Felipe Balbi
2016-03-07 9:40 ` Felipe Ferreri Tonello
2016-03-07 10:59 ` Felipe Balbi
2016-03-07 11:13 ` Felipe Ferreri Tonello
2016-03-08 7:43 ` Felipe Balbi
2016-03-08 10:14 ` Krzysztof Opasiak
2016-03-08 10:34 ` Felipe Balbi
2016-03-08 13:54 ` Felipe Ferreri Tonello
2016-03-08 14:04 ` Felipe Balbi
2016-03-08 14:15 ` Krzysztof Opasiak
2016-03-08 14:20 ` Felipe Balbi
2016-03-08 15:24 ` Felipe Ferreri Tonello
2016-03-02 19:40 ` Felipe F. Tonello [this message]
2016-03-04 7:13 ` [PATCH 4/5] usb: gadget: f_midi: cleanups and typos fixes Felipe Balbi
2016-03-04 19:17 ` Michal Nazarewicz
2016-03-04 20:17 ` Felipe Ferreri Tonello
2016-03-05 16:28 ` Michal Nazarewicz
2016-03-05 19:39 ` Greg KH
2016-03-05 23:53 ` Felipe Ferreri Tonello
2016-03-06 3:02 ` Greg KH
2016-03-05 23:57 ` Felipe Ferreri Tonello
2016-03-07 7:35 ` Felipe Balbi
2016-03-07 9:32 ` Felipe Ferreri Tonello
2016-03-08 7:44 ` Felipe Balbi
2016-03-02 19:40 ` [PATCH 5/5] usb: gadget: f_midi: updated copyright Felipe F. Tonello
2016-03-04 7:13 ` Felipe Balbi
2016-03-04 18:41 ` Felipe Ferreri Tonello
2016-03-07 7:36 ` Felipe Balbi
2016-03-07 9:23 ` Felipe Ferreri Tonello
2016-03-04 7:11 ` [PATCH 0/5] MIDI USB Gadget improvements Felipe Balbi
2016-03-04 18:43 ` Felipe Ferreri Tonello
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=1456947640-20673-5-git-send-email-eu@felipetonello.com \
--to=eu@felipetonello.com \
--cc=balbi@kernel.org \
--cc=clemens@ladisch.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mina86@mina86.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®