Lines Matching refs:gadget
35 #include <linux/usb/gadget.h>
123 dma_unmap_single(ep->udc->gadget.dev.parent,
131 dma_sync_single_for_cpu(ep->udc->gadget.dev.parent,
145 /* complete() is from gadget layer,
445 * for example the do_set_interface() in gadget layer,
468 if (!udc->driver || (udc->gadget.speed == USB_SPEED_UNKNOWN))
478 /* Assume the max packet size from gadget is always correct */
794 if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN)
801 req->req.dma = dma_map_single(ep->udc->gadget.dev.parent,
808 dma_sync_single_for_device(ep->udc->gadget.dev.parent,
1035 static int fsl_get_frame(struct usb_gadget *gadget)
1041 * Tries to wake up the host connected to this gadget
1043 static int fsl_wakeup(struct usb_gadget *gadget)
1045 struct fsl_udc *udc = container_of(gadget, struct fsl_udc, gadget);
1069 static int fsl_vbus_session(struct usb_gadget *gadget, int is_active)
1074 udc = container_of(gadget, struct fsl_udc, gadget);
1089 * This call is used by gadget drivers during SET_CONFIGURATION calls,
1095 static int fsl_vbus_draw(struct usb_gadget *gadget, unsigned mA)
1099 udc = container_of(gadget, struct fsl_udc, gadget);
1108 static int fsl_pullup(struct usb_gadget *gadget, int is_on)
1112 udc = container_of(gadget, struct fsl_udc, gadget);
1124 /* defined in gadget.h */
1312 if (!gadget_is_otg(&udc->gadget))
1315 udc->gadget.b_hnp_enable = 1;
1317 udc->gadget.a_hnp_support = 1;
1320 udc->gadget.a_alt_hnp_support = 1;
1338 /* Requests handled by gadget */
1340 /* Data phase from gadget, status phase from udc */
1344 if (udc->driver->setup(&udc->gadget,
1351 /* No data phase, IN status from gadget */
1354 if (udc->driver->setup(&udc->gadget,
1568 udc->gadget.speed = USB_SPEED_HIGH;
1571 udc->gadget.speed = USB_SPEED_FULL;
1574 udc->gadget.speed = USB_SPEED_LOW;
1577 udc->gadget.speed = USB_SPEED_UNKNOWN;
1595 udc->driver->suspend(&udc->gadget);
1605 udc->driver->resume(&udc->gadget);
1618 udc->driver->disconnect(&udc->gadget);
1641 udc->gadget.b_hnp_enable = 0;
1642 udc->gadget.a_hnp_support = 0;
1643 udc->gadget.a_alt_hnp_support = 0;
1764 * Hook to gadget drivers
1765 * Called by initialization code of gadget drivers
1790 udc_controller->gadget.dev.driver = &driver->driver;
1793 /* bind udc driver to gadget driver */
1794 retval = driver->bind(&udc_controller->gadget);
1797 udc_controller->gadget.dev.driver = NULL;
1808 udc_controller->gadget.name, driver->driver.name);
1812 printk(KERN_WARNING "gadget driver register failed %d\n",
1818 /* Disconnect from gadget driver */
1843 udc_controller->gadget.speed = USB_SPEED_UNKNOWN;
1845 list_for_each_entry(loop_ep, &udc_controller->gadget.ep_list,
1851 driver->disconnect(&udc_controller->gadget);
1853 /* unbind gadget and unhook driver. */
1854 driver->unbind(&udc_controller->gadget);
1855 udc_controller->gadget.dev.driver = NULL;
1858 printk(KERN_WARNING "unregistered gadget driver '%s'\n",
2087 /* other gadget->eplist ep */
2088 list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) {
2203 * Link fsl_ep->ep to gadget->ep_list
2220 * for other eps, maxP is set by epautoconfig() called by gadget layer
2229 list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
2230 ep->gadget = &udc->gadget;
2328 /* Setup gadget structure */
2329 udc_controller->gadget.ops = &fsl_gadget_ops;
2330 udc_controller->gadget.is_dualspeed = 1;
2331 udc_controller->gadget.ep0 = &udc_controller->eps[0].ep;
2332 INIT_LIST_HEAD(&udc_controller->gadget.ep_list);
2333 udc_controller->gadget.speed = USB_SPEED_UNKNOWN;
2334 udc_controller->gadget.name = driver_name;
2336 /* Setup gadget.dev and register with kernel */
2337 dev_set_name(&udc_controller->gadget.dev, "gadget");
2338 udc_controller->gadget.dev.release = fsl_udc_release;
2339 udc_controller->gadget.dev.parent = &pdev->dev;
2340 ret = device_register(&udc_controller->gadget.dev);
2350 * for other eps, gadget layer called ep_enable with defined desc
2356 * to gadget.ep_list */
2378 device_unregister(&udc_controller->gadget.dev);
2421 device_unregister(&udc_controller->gadget.dev);
2430 * Used by OTG statemachine to disable gadget temporarily