1a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell/*
2a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell * This header declares the utility functions used by "Gadget Zero", plus
3a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell * interfaces to its two single-configuration function drivers.
4a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell */
5a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell
6a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell#ifndef __G_ZERO_H
7a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell#define __G_ZERO_H
8a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell
9a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell#include <linux/usb/composite.h>
10a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell
11a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell/* global state */
12e5760fdac8c8aeca060d1afc8a233ea3d7a46720David Brownellextern unsigned buflen;
13a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownellextern const struct usb_descriptor_header *otg_desc[];
14a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell
15a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell/* common utilities */
16a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownellstruct usb_request *alloc_ep_req(struct usb_ep *ep);
17a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownellvoid free_ep_req(struct usb_ep *ep, struct usb_request *req);
18a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownellvoid disable_endpoints(struct usb_composite_dev *cdev,
19a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell		struct usb_ep *in, struct usb_ep *out);
20a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell
21a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell/* configuration-specific linkup */
22ab943a2e125b098489ccaa0166c2c52f8266d9edDavid Brownellint sourcesink_add(struct usb_composite_dev *cdev, bool autoresume);
23ab943a2e125b098489ccaa0166c2c52f8266d9edDavid Brownellint loopback_add(struct usb_composite_dev *cdev, bool autoresume);
24a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell
25a400cadc0774c31f67c419a835d80ba611128c2aDavid Brownell#endif /* __G_ZERO_H */
26