aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/gmidi.c
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2011-09-28 16:41:34 +0200
committerFelipe Balbi <balbi@ti.com>2011-10-13 20:39:52 +0300
commitc8933c3f79568263c90a46f06cf80419e6c63c97 (patch)
treef2e47dc624e9f5aa5e8e6a5b9907dc157dd0e7bb /drivers/usb/gadget/gmidi.c
parent2672eea5a38b35e6d28f851e990e110e217271eb (diff)
USB: gadget: f_midi: allow a dynamic number of input and output ports
The code in the MIDI gadget was already sort of prepared for multi-port configuration, so the streaming logic itself didn't need much tweaking. However, the descriptors change when the number of ports do, and so some rework of the the preparation algorithms were necessary. Successfully tested on Linux and Max OS X hosts for both input and output streams. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/gmidi.c')
-rw-r--r--drivers/usb/gadget/gmidi.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c
index e7c8c3907133..8fcde37aa6d4 100644
--- a/drivers/usb/gadget/gmidi.c
+++ b/drivers/usb/gadget/gmidi.c
@@ -66,6 +66,14 @@ static unsigned int qlen = 32;
module_param(qlen, uint, S_IRUGO);
MODULE_PARM_DESC(qlen, "USB read request queue length");
+static unsigned int in_ports = 1;
+module_param(in_ports, uint, S_IRUGO);
+MODULE_PARM_DESC(in_ports, "Number of MIDI input ports");
+
+static unsigned int out_ports = 1;
+module_param(out_ports, uint, S_IRUGO);
+MODULE_PARM_DESC(out_ports, "Number of MIDI output ports");
+
/* Thanks to Grey Innovation for donating this product ID.
*
* DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
@@ -124,7 +132,9 @@ static struct usb_configuration midi_config = {
static int __init midi_bind_config(struct usb_configuration *c)
{
- return f_midi_bind_config(c, index, id, buflen, qlen);
+ return f_midi_bind_config(c, index, id,
+ in_ports, out_ports,
+ buflen, qlen);
}
static int __init midi_bind(struct usb_composite_dev *cdev)