Lines Matching full:gadget
9 * Based on drivers under drivers/usb/gadget/udc/
27 #include <linux/usb/gadget.h>
86 bdc->gadget.ep0->maxpacket = EP0_MAX_PKT_SIZE; in bdc_uspc_connected()
87 bdc->gadget.speed = USB_SPEED_SUPER; in bdc_uspc_connected()
98 bdc->gadget.ep0->maxpacket = 64; in bdc_uspc_connected()
99 bdc->gadget.speed = USB_SPEED_HIGH; in bdc_uspc_connected()
104 bdc->gadget.ep0->maxpacket = 64; in bdc_uspc_connected()
105 bdc->gadget.speed = USB_SPEED_FULL; in bdc_uspc_connected()
110 bdc->gadget.ep0->maxpacket = 8; in bdc_uspc_connected()
111 bdc->gadget.speed = USB_SPEED_LOW; in bdc_uspc_connected()
125 usb_gadget_set_state(&bdc->gadget, USB_STATE_DEFAULT); in bdc_uspc_connected()
145 bdc->gadget_driver->disconnect(&bdc->gadget); in bdc_uspc_disconnected()
149 bdc->gadget.speed = USB_SPEED_UNKNOWN; in bdc_uspc_disconnected()
154 usb_gadget_set_state(&bdc->gadget, USB_STATE_NOTATTACHED); in bdc_uspc_disconnected()
188 if ((bdc->gadget.speed != USB_SPEED_UNKNOWN) && in handle_link_state_change()
193 bdc->gadget_driver->suspend(&bdc->gadget); in handle_link_state_change()
200 if (bdc->gadget.speed == USB_SPEED_SUPER) { in handle_link_state_change()
221 bdc->gadget_driver->resume(&bdc->gadget); in handle_link_state_change()
257 usb_gadget_set_state(&bdc->gadget, USB_STATE_POWERED); in bdc_sr_uspc()
362 /* Gadget ops */
363 static int bdc_udc_start(struct usb_gadget *gadget, in bdc_udc_start() argument
366 struct bdc *bdc = gadget_to_bdc(gadget); in bdc_udc_start()
374 bdc->gadget.name, in bdc_udc_start()
390 bdc->gadget.dev.driver = &driver->driver; in bdc_udc_start()
397 static int bdc_udc_stop(struct usb_gadget *gadget) in bdc_udc_stop() argument
399 struct bdc *bdc = gadget_to_bdc(gadget); in bdc_udc_stop()
406 bdc->gadget.dev.driver = NULL; in bdc_udc_stop()
412 static int bdc_udc_pullup(struct usb_gadget *gadget, int is_on) in bdc_udc_pullup() argument
414 struct bdc *bdc = gadget_to_bdc(gadget); in bdc_udc_pullup()
419 if (!gadget) in bdc_udc_pullup()
447 static int bdc_udc_set_selfpowered(struct usb_gadget *gadget, in bdc_udc_set_selfpowered() argument
450 struct bdc *bdc = gadget_to_bdc(gadget); in bdc_udc_set_selfpowered()
454 gadget->is_selfpowered = (is_self != 0); in bdc_udc_set_selfpowered()
466 static int bdc_udc_wakeup(struct usb_gadget *gadget) in bdc_udc_wakeup() argument
468 struct bdc *bdc = gadget_to_bdc(gadget); in bdc_udc_wakeup()
492 if (bdc->gadget.speed == USB_SPEED_SUPER) in bdc_udc_wakeup()
517 /* Init the gadget interface and register the udc */
524 bdc->gadget.ops = &bdc_gadget_ops; in bdc_udc_init()
525 bdc->gadget.max_speed = USB_SPEED_SUPER; in bdc_udc_init()
526 bdc->gadget.speed = USB_SPEED_UNKNOWN; in bdc_udc_init()
527 bdc->gadget.dev.parent = bdc->dev; in bdc_udc_init()
529 bdc->gadget.sg_supported = false; in bdc_udc_init()
532 bdc->gadget.name = BRCM_BDC_NAME; in bdc_udc_init()
548 ret = usb_add_gadget_udc(bdc->dev, &bdc->gadget); in bdc_udc_init()
553 usb_gadget_set_state(&bdc->gadget, USB_STATE_NOTATTACHED); in bdc_udc_init()
572 usb_del_gadget_udc(&bdc->gadget); in bdc_udc_init()
588 usb_del_gadget_udc(&bdc->gadget); in bdc_udc_exit()