summaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-12-23 21:10:20 +0100
committerFelipe Balbi <balbi@ti.com>2013-01-21 20:52:47 +0200
commita59233407aed54b8a9121cea75d9c6a2a470d8d3 (patch)
treef073dd5e345f1ba8e1a23480e418cee608dc825e /include/linux/usb
parent4c49a5f0ef1bc61395329ea7a9fce2893e97eaa6 (diff)
downloadop-kernel-dev-a59233407aed54b8a9121cea75d9c6a2a470d8d3.zip
op-kernel-dev-a59233407aed54b8a9121cea75d9c6a2a470d8d3.tar.gz
usb: gadget: factor out two helper functions from composite_bind()
This patch factors out two helper functions from composite_bind() that is composite_dev_prepare() and its counterpart composite_dev_cleanup(). This will be used by the configfs which requries a slightly different bind/setup code because part of its configurations (i.e. config descripts, cdev, …) are setup in advance and VID/PID and so one should not be overwritten. Also the setup of ep0 endpoint can be delayed until the UDC is assigned. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/composite.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 771de7a..bd6d857 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -323,7 +323,15 @@ struct usb_composite_driver {
extern int usb_composite_probe(struct usb_composite_driver *driver);
extern void usb_composite_unregister(struct usb_composite_driver *driver);
extern void usb_composite_setup_continue(struct usb_composite_dev *cdev);
+extern int composite_dev_prepare(struct usb_composite_driver *composite,
+ struct usb_composite_dev *cdev);
+void composite_dev_cleanup(struct usb_composite_dev *cdev);
+static inline struct usb_composite_driver *to_cdriver(
+ struct usb_gadget_driver *gdrv)
+{
+ return container_of(gdrv, struct usb_composite_driver, gadget_driver);
+}
/**
* struct usb_composite_device - represents one composite usb gadget
OpenPOWER on IntegriCloud