David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This header declares the utility functions used by "Gadget Zero", plus |
| 3 | * interfaces to its two single-configuration function drivers. |
| 4 | */ |
| 5 | |
| 6 | #ifndef __G_ZERO_H |
| 7 | #define __G_ZERO_H |
| 8 | |
| 9 | #include <linux/usb/composite.h> |
| 10 | |
| 11 | /* global state */ |
David Brownell | e5760fd | 2008-06-19 17:55:35 -0700 | [diff] [blame] | 12 | extern unsigned buflen; |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 13 | extern const struct usb_descriptor_header *otg_desc[]; |
| 14 | |
| 15 | /* common utilities */ |
Paul Zimmerman | b4036cc | 2012-04-16 14:19:06 -0700 | [diff] [blame] | 16 | struct usb_request *alloc_ep_req(struct usb_ep *ep, int len); |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 17 | void free_ep_req(struct usb_ep *ep, struct usb_request *req); |
| 18 | void disable_endpoints(struct usb_composite_dev *cdev, |
Paul Zimmerman | b4036cc | 2012-04-16 14:19:06 -0700 | [diff] [blame] | 19 | struct usb_ep *in, struct usb_ep *out, |
| 20 | struct usb_ep *iso_in, struct usb_ep *iso_out); |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 21 | |
| 22 | /* configuration-specific linkup */ |
David Brownell | ab943a2 | 2009-03-19 14:16:09 -0700 | [diff] [blame] | 23 | int sourcesink_add(struct usb_composite_dev *cdev, bool autoresume); |
| 24 | int loopback_add(struct usb_composite_dev *cdev, bool autoresume); |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 25 | |
| 26 | #endif /* __G_ZERO_H */ |