diff options
| author | David Brownell <david-b@pacbell.net> | 2004-03-24 21:43:15 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2004-03-24 21:43:15 -0800 |
| commit | b71db443ea7998de4dfddce7adad640db70f221c (patch) | |
| tree | 7c68d326de47cec220d40274d2d2f9fa0334d88a /include/linux | |
| parent | f5cd10245b11f86e5f36c4de86775b39a8f1c634 (diff) | |
[PATCH] USB: USB gadgets can autoconfigure endpoints
This adds some code that gadget drivers can call from
driver initialization, to simplify the "configure against
this hardware" step.
Add endpoint autoconfiguration for gadget drivers.
Endpoint selection is currently being done with conditional compilation.
That doesn't look nice, but more importantly it doesn't work well with
the model that some distributions won't be custom-matched to hardware.
Say, a PDA distro running on iPaq (pxa2xx_udc) or Axim (mq11xx_udc).
This code just makes it easier for drivers to match to hardware at
run-time. It's a convenience function for something they could have
been doing already, but weren't.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/usb_gadget.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index 503abfe9a9aa..3ba4e10d0372 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h @@ -731,6 +731,15 @@ int usb_descriptor_fillbuf(void *, unsigned, int usb_gadget_config_buf(const struct usb_config_descriptor *config, void *buf, unsigned buflen, const struct usb_descriptor_header **desc); +/*-------------------------------------------------------------------------*/ + +/* utility wrapping a simple endpoint selection policy */ + +extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, + struct usb_endpoint_descriptor *) __init; + +extern void usb_ep_autoconfig_reset (struct usb_gadget *) __init; + #endif /* __KERNEL__ */ #endif /* __LINUX_USB_GADGET_H */ |
