aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/gadget.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb/gadget.h')
-rw-r--r--include/linux/usb/gadget.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 2e297e80d59a..c454a88abf2e 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -482,6 +482,7 @@ struct usb_gadget_ops {
482 * @speed: Speed of current connection to USB host. 482 * @speed: Speed of current connection to USB host.
483 * @max_speed: Maximal speed the UDC can handle. UDC must support this 483 * @max_speed: Maximal speed the UDC can handle. UDC must support this
484 * and all slower speeds. 484 * and all slower speeds.
485 * @state: the state we are now (attached, suspended, configured, etc)
485 * @sg_supported: true if we can handle scatter-gather 486 * @sg_supported: true if we can handle scatter-gather
486 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the 487 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
487 * gadget driver must provide a USB OTG descriptor. 488 * gadget driver must provide a USB OTG descriptor.
@@ -525,6 +526,7 @@ struct usb_gadget {
525 struct list_head ep_list; /* of usb_ep */ 526 struct list_head ep_list; /* of usb_ep */
526 enum usb_device_speed speed; 527 enum usb_device_speed speed;
527 enum usb_device_speed max_speed; 528 enum usb_device_speed max_speed;
529 enum usb_device_state state;
528 unsigned sg_supported:1; 530 unsigned sg_supported:1;
529 unsigned is_otg:1; 531 unsigned is_otg:1;
530 unsigned is_a_peripheral:1; 532 unsigned is_a_peripheral:1;
@@ -872,6 +874,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver);
872 */ 874 */
873int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); 875int usb_gadget_unregister_driver(struct usb_gadget_driver *driver);
874 876
877extern int usb_add_gadget_udc_release(struct device *parent,
878 struct usb_gadget *gadget, void (*release)(struct device *dev));
875extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); 879extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
876extern void usb_del_gadget_udc(struct usb_gadget *gadget); 880extern void usb_del_gadget_udc(struct usb_gadget *gadget);
877extern int udc_attach_driver(const char *name, 881extern int udc_attach_driver(const char *name,
@@ -959,6 +963,13 @@ extern void usb_gadget_unmap_request(struct usb_gadget *gadget,
959 963
960/*-------------------------------------------------------------------------*/ 964/*-------------------------------------------------------------------------*/
961 965
966/* utility to set gadget state properly */
967
968extern void usb_gadget_set_state(struct usb_gadget *gadget,
969 enum usb_device_state state);
970
971/*-------------------------------------------------------------------------*/
972
962/* utility wrapping a simple endpoint selection policy */ 973/* utility wrapping a simple endpoint selection policy */
963 974
964extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, 975extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *,