blob: 71ca193358b85c23a039e12bdead188425c0490c [file] [log] [blame]
David Brownella400cad2008-06-19 17:55:23 -07001/*
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 Brownelle5760fd2008-06-19 17:55:35 -070012extern unsigned buflen;
David Brownella400cad2008-06-19 17:55:23 -070013extern const struct usb_descriptor_header *otg_desc[];
14
15/* common utilities */
Paul Zimmermanb4036cc2012-04-16 14:19:06 -070016struct usb_request *alloc_ep_req(struct usb_ep *ep, int len);
David Brownella400cad2008-06-19 17:55:23 -070017void free_ep_req(struct usb_ep *ep, struct usb_request *req);
18void disable_endpoints(struct usb_composite_dev *cdev,
Paul Zimmermanb4036cc2012-04-16 14:19:06 -070019 struct usb_ep *in, struct usb_ep *out,
20 struct usb_ep *iso_in, struct usb_ep *iso_out);
David Brownella400cad2008-06-19 17:55:23 -070021
22/* configuration-specific linkup */
David Brownellab943a22009-03-19 14:16:09 -070023int sourcesink_add(struct usb_composite_dev *cdev, bool autoresume);
24int loopback_add(struct usb_composite_dev *cdev, bool autoresume);
David Brownella400cad2008-06-19 17:55:23 -070025
26#endif /* __G_ZERO_H */