summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/f_midi.c
AgeCommit message (Collapse)Author
2011-11-14usb: gadget: fix MIDI gadget jack allocationDaniel Mack
The dynamic jack allocation of the MIDI gadget currently links all external jacks to one single instance of an embedded jack. According to the spec, this is only valid if these streams always carry the same data stream, as described in the USB MIDI 1.0 spec, chapter 3.3.1. Also, genius Windows 7(tm) terminates it's life cycle instantly with a blue screen of death once a device with more than one input and output port with the current implementation is connected. While at it, and because it grew again by this change, allocate the temporary function pointer list on the heap, not on the stack. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-18USB: gadget: midi: memory leak in f_midi_bind_config()Dan Carpenter
There is a small memory leak on the error paths. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-18USB: gadget: midi: fix range check in f_midi_out_open()Dan Carpenter
! has higher precedence than >= and since neither 0 nor 1 are greater than 8 the condition is always false. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-13USB: gadget: f_midi: allow a dynamic number of input and output portsDaniel Mack
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>
2011-10-13USB: gadget: midi: refactor the device codeDaniel Mack
Make use of the newly added MIDI function in f_midi.c and strip down the MIDI gadget code radically. Also use the generic framework function to avoid code duplication and rename some symbols to bring them in sync with other code in the gadget framework. [ balbi@ti.com : fix Section mismatch warnings. rebased on top of usb_speed_string() patch to avoid conflicts. ] Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13USB: gadget: midi: add midi function driverDaniel Mack
This patch adds f_midi.c to implement a USB gadget function that works with the composite framework, so it can be combined with other USB functions. The code for the ALSA/MIDI logic was taken from the midi device gadget, other parts have been rewritten to benefit from the dynamic descriptor allocation features. This was successfully tested on an OMAP3 board. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>