Lines Matching full:gadget
3 * epautoconf.c -- endpoint autoconfiguration for usb gadget drivers
17 #include <linux/usb/gadget.h>
22 * @gadget: The device to which the endpoint must belong.
37 * this routine simplifies writing gadget drivers that work with
64 struct usb_gadget *gadget, in usb_ep_autoconfig_ss() argument
71 if (gadget->ops->match_ep) { in usb_ep_autoconfig_ss()
72 ep = gadget->ops->match_ep(gadget, desc, ep_comp); in usb_ep_autoconfig_ss()
78 list_for_each_entry (ep, &gadget->ep_list, ep_list) { in usb_ep_autoconfig_ss()
79 if (usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) in usb_ep_autoconfig_ss()
100 if (++gadget->in_epnum > 15) in usb_ep_autoconfig_ss()
102 desc->bEndpointAddress = USB_DIR_IN | gadget->in_epnum; in usb_ep_autoconfig_ss()
104 if (++gadget->out_epnum > 15) in usb_ep_autoconfig_ss()
106 desc->bEndpointAddress |= gadget->out_epnum; in usb_ep_autoconfig_ss()
120 * @gadget: The device to which the endpoint must belong.
126 * routine simplifies writing gadget drivers that work with multiple
150 struct usb_gadget *gadget, in usb_ep_autoconfig() argument
157 ep = usb_ep_autoconfig_ss(gadget, desc, NULL); in usb_ep_autoconfig()
196 * @gadget: device for which autoconfig state will be reset
203 void usb_ep_autoconfig_reset (struct usb_gadget *gadget) in usb_ep_autoconfig_reset() argument
207 list_for_each_entry (ep, &gadget->ep_list, ep_list) { in usb_ep_autoconfig_reset()
211 gadget->in_epnum = 0; in usb_ep_autoconfig_reset()
212 gadget->out_epnum = 0; in usb_ep_autoconfig_reset()