diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-06-20 04:55:23 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-22 02:16:02 +0400 |
commit | a400cadc0774c31f67c419a835d80ba611128c2a (patch) | |
tree | bd28acffcc157e504e397f0eaba76043f2453f7f /drivers/usb/gadget/g_zero.h | |
parent | 40982be52d8f64c3e10adce17e66ab755a4fa26b (diff) | |
download | linux-a400cadc0774c31f67c419a835d80ba611128c2a.tar.xz |
usb gadget zero: split out source/sink config
This splits the gadget zero "source/sink" configuration into a standalone
"configuration driver", building on the composite gadget framework code.
It doesn't yet pull the original code out of gadget zero or update how
that driver is built.
Neither this, nor its sibling "loopback" configuration, is a function
driver that can be combined with other functions. (The host "usbtest"
driver wouldn't know how to deal with that!) However the code becomes
simpler because of this conversion, so it's a net win.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/g_zero.h')
-rw-r--r-- | drivers/usb/gadget/g_zero.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/usb/gadget/g_zero.h b/drivers/usb/gadget/g_zero.h new file mode 100644 index 000000000000..2781221b9469 --- /dev/null +++ b/drivers/usb/gadget/g_zero.h @@ -0,0 +1,23 @@ +/* + * This header declares the utility functions used by "Gadget Zero", plus + * interfaces to its two single-configuration function drivers. + */ + +#ifndef __G_ZERO_H +#define __G_ZERO_H + +#include <linux/usb/composite.h> + +/* global state */ +extern const struct usb_descriptor_header *otg_desc[]; + +/* common utilities */ +struct usb_request *alloc_ep_req(struct usb_ep *ep); +void free_ep_req(struct usb_ep *ep, struct usb_request *req); +void disable_endpoints(struct usb_composite_dev *cdev, + struct usb_ep *in, struct usb_ep *out); + +/* configuration-specific linkup */ +int sourcesink_add(struct usb_composite_dev *cdev); + +#endif /* __G_ZERO_H */ |