summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/amd5536udc.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior2012-12-23 21:10:00 +0100
committerFelipe Balbi2013-01-21 19:52:40 +0100
commitde53c25447117eae6b3f8952f663f08a09e0dbb7 (patch)
tree3474ccbad34a526bd9a6826e4512162e4801cafb /drivers/usb/gadget/amd5536udc.h
parentusb: gadget: move loopback's config descriptor out of f_loopback (diff)
downloadkernel-qcow2-linux-de53c25447117eae6b3f8952f663f08a09e0dbb7.tar.gz
kernel-qcow2-linux-de53c25447117eae6b3f8952f663f08a09e0dbb7.tar.xz
kernel-qcow2-linux-de53c25447117eae6b3f8952f663f08a09e0dbb7.zip
usb: gadget: add some infracture to register/unregister functions
This patch provides an infrastructure to register & unregister a USB function. This allows to turn a function into a module and avoid the '#include "f_.*.c"' magic and we get a clear API / cut between the bare gadget and its functions. The concept is simple: Each function defines the DECLARE_USB_FUNCTION_INIT macro whith an unique name of the function and two allocation functions. - one to create an "instance". The instance holds the current configuration set. In case there are two usb_configudations with one function there will be one instance and two usb_functions - one to create an "function" from the instance. The name of the instance is used to automaticaly load the module if it the instance is not yet available. The usb_function callbacks are slightly modified and extended: - usb_get_function() creates a struct usb_function inclunding all pointers (bind, unbind,…). It uses the "instance" to map its configuration. So we can have _two_ struct usb_function, one for each usb_configuration. - ->unbind() Since the struct usb_function was not allocated in ->bind() it should not kfree()d here. This function should only reverse what happens in ->bind() that is request cleanup and the cleanup of allocated descriptors. - ->free_func() a simple kfree() of the struct usb_function Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/amd5536udc.h')
0 files changed, 0 insertions, 0 deletions