Lines Matching full:gadget
3 * aspeed-vhub -- Driver for Aspeed SoC "vHub" USB gadget
5 * dev.c - Individual device/gadget management (ie, a port = a gadget)
22 #include <linux/usb/gadget.h>
60 if (d->gadget.speed == USB_SPEED_HIGH) in ast_vhub_dev_enable()
104 d->gadget.speed = USB_SPEED_UNKNOWN; in ast_vhub_dev_disable()
173 st0 = d->gadget.is_selfpowered << USB_DEVICE_SELF_POWERED; in ast_vhub_dev_status()
238 if (d->gadget.speed == USB_SPEED_UNKNOWN) { in ast_vhub_std_dev_request()
239 d->gadget.speed = ep->vhub->speed; in ast_vhub_std_dev_request()
240 if (d->gadget.speed > d->driver->max_speed) in ast_vhub_std_dev_request()
241 d->gadget.speed = d->driver->max_speed; in ast_vhub_std_dev_request()
243 d->gadget.speed); in ast_vhub_std_dev_request()
276 static int ast_vhub_udc_wakeup(struct usb_gadget* gadget) in ast_vhub_udc_wakeup() argument
278 struct ast_vhub_dev *d = to_ast_dev(gadget); in ast_vhub_udc_wakeup()
296 static int ast_vhub_udc_get_frame(struct usb_gadget* gadget) in ast_vhub_udc_get_frame() argument
298 struct ast_vhub_dev *d = to_ast_dev(gadget); in ast_vhub_udc_get_frame()
314 static int ast_vhub_udc_pullup(struct usb_gadget* gadget, int on) in ast_vhub_udc_pullup() argument
316 struct ast_vhub_dev *d = to_ast_dev(gadget); in ast_vhub_udc_pullup()
340 static int ast_vhub_udc_start(struct usb_gadget *gadget, in ast_vhub_udc_start() argument
343 struct ast_vhub_dev *d = to_ast_dev(gadget); in ast_vhub_udc_start()
352 d->gadget.is_selfpowered = 1; in ast_vhub_udc_start()
359 static struct usb_ep *ast_vhub_udc_match_ep(struct usb_gadget *gadget, in ast_vhub_udc_match_ep() argument
363 struct ast_vhub_dev *d = to_ast_dev(gadget); in ast_vhub_udc_match_ep()
373 * this gadget. This duplicates the code in usb_ep_autoconfig_ss() in ast_vhub_udc_match_ep()
376 list_for_each_entry(u_ep, &gadget->ep_list, ep_list) { in ast_vhub_udc_match_ep()
377 if (usb_gadget_ep_match_desc(gadget, u_ep, desc, ss)) { in ast_vhub_udc_match_ep()
395 if (gadget_is_dualspeed(gadget)) in ast_vhub_udc_match_ep()
401 if (gadget_is_dualspeed(gadget)) in ast_vhub_udc_match_ep()
407 if (gadget_is_dualspeed(gadget)) in ast_vhub_udc_match_ep()
444 static int ast_vhub_udc_stop(struct usb_gadget *gadget) in ast_vhub_udc_stop() argument
446 struct ast_vhub_dev *d = to_ast_dev(gadget); in ast_vhub_udc_stop()
454 d->gadget.speed = USB_SPEED_UNKNOWN; in ast_vhub_udc_stop()
479 d->driver->suspend(&d->gadget); in ast_vhub_dev_suspend()
488 d->driver->resume(&d->gadget); in ast_vhub_dev_resume()
508 usb_gadget_udc_reset(&d->gadget, d->driver); in ast_vhub_dev_reset()
532 usb_del_gadget_udc(&d->gadget); in ast_vhub_del_dev()
582 /* Populate gadget */ in ast_vhub_init_dev()
583 INIT_LIST_HEAD(&d->gadget.ep_list); in ast_vhub_init_dev()
584 d->gadget.ops = &ast_vhub_udc_ops; in ast_vhub_init_dev()
585 d->gadget.ep0 = &d->ep0.ep; in ast_vhub_init_dev()
586 d->gadget.name = KBUILD_MODNAME; in ast_vhub_init_dev()
588 d->gadget.max_speed = USB_SPEED_FULL; in ast_vhub_init_dev()
590 d->gadget.max_speed = USB_SPEED_HIGH; in ast_vhub_init_dev()
591 d->gadget.speed = USB_SPEED_UNKNOWN; in ast_vhub_init_dev()
592 d->gadget.dev.of_node = vhub->pdev->dev.of_node; in ast_vhub_init_dev()
593 d->gadget.dev.of_node_reused = true; in ast_vhub_init_dev()
595 rc = usb_add_gadget_udc(d->port_dev, &d->gadget); in ast_vhub_init_dev()