Lines Matching refs:driver

33  * @driver: the gadget driver pointer. For use by the class code
36 * @list: for use by the udc class driver
41 * Set/cleared by gadget_(un)bind_driver() after gadget driver is bound or
51 * to hold information about udc driver and gadget together.
54 struct usb_gadget_driver *driver;
68 /* Protects udc_list, udc->driver, driver->is_bound, and related calls */
96 * When configurations are set, or when interface settings change, the driver
98 * endpoint may be used for i/o until the driver receives a disconnect() from
226 * @gfp_flags: GFP_* flags to use in case the lower level driver couldn't
232 * routine is called to return the request to the driver. Any endpoint
234 * request queued; they complete in FIFO order. Once a gadget driver
236 * is given back to that driver through the completion callback.
238 * Each request is turned into one or more packets. The controller driver
259 * Control endpoints ... after getting a setup() callback, the driver queues
272 * arranges to poll once per interval, and the gadget driver usually will
287 * control of the request is returned to the device driver which submitted it.
350 * gadget driver, a SET_INTERFACE will not be. To reset endpoints for the
404 * requests. If the gadget driver clears the halt status, it will
432 * the IN data written by the gadget driver (and reported by a request
433 * completion). The gadget driver may not have collected all the data
561 * this affects the device status reported by the hardware driver
588 * this affects the device status reported by the hardware driver.
617 * This call is used by a driver for an external transceiver (or GPIO)
680 * This call is used by a driver for an external transceiver (or GPIO)
784 if (gadget->udc->driver)
785 gadget->udc->driver->disconnect(gadget);
803 * for the current gadget driver so that UDC drivers don't need to.
823 * This routine may be used during the gadget driver bind() call to prevent
829 * (such as from within a gadget driver's disconnect() callback).
1159 * The udc driver calls it when it wants to connect or disconnect gadget
1165 * a. Some of the gadget driver implementations expect the ->pullup
1184 * @driver: The gadget driver we want to notify
1186 * If the udc driver has bus reset handler, it needs to call this when the bus
1187 * reset occurs, it notifies the gadget driver that the bus reset occurs as
1191 struct usb_gadget_driver *driver)
1193 driver->reset(gadget);
1202 * This call is issued by the UDC Class driver when it's about
1203 * to register a gadget driver to the device controller, before
1204 * calling gadget driver's bind() method.
1223 ret = udc->gadget->ops->udc_start(udc->gadget, udc->driver);
1234 * This call is issued by the UDC Class driver after calling
1235 * gadget driver's unbind() method.
1257 * current driver
1261 * This call is issued by the UDC Class driver before calling
1263 * connect on speeds the gadget driver doesn't support.
1287 * of usb_gadget_disable_async_callbacks(); the UDC driver should enable IRQs
1305 * The UDC driver doesn't know when the gadget driver's ->unbind callback
1309 * After this function runs, the UDC driver must suppress all ->suspend,
1310 * ->resume, ->disconnect, ->reset, and ->setup callbacks to the gadget driver
1333 * This is called by driver's core in order to free memory once the last
1354 * @parent: the parent device to this udc. Usually the controller driver's
1376 * usb_add_gadget - adds a new gadget to the udc class driver list
1452 * usb_add_gadget_udc_release - adds a new gadget to the udc class driver list
1453 * @parent: the parent device to this udc. Usually the controller driver's
1480 * of the returned name will be still available, when gadget driver registers
1494 if (!udc->driver) {
1505 * usb_add_gadget_udc - adds a new gadget to the udc class driver list
1507 * driver's device.
1566 struct usb_gadget_driver *driver = container_of(drv,
1567 struct usb_gadget_driver, driver);
1569 /* If the driver specifies a udc_name, it must match the UDC's name */
1570 if (driver->udc_name &&
1571 strcmp(driver->udc_name, dev_name(&udc->dev)) != 0)
1574 /* If the driver is already bound to a gadget, it doesn't match */
1575 if (driver->is_bound)
1578 /* Otherwise any gadget driver matches any UDC */
1586 struct usb_gadget_driver *driver = container_of(dev->driver,
1587 struct usb_gadget_driver, driver);
1591 if (driver->is_bound) {
1595 driver->is_bound = true;
1596 udc->driver = driver;
1599 dev_dbg(&udc->dev, "binding gadget driver [%s]\n", driver->function);
1601 usb_gadget_udc_set_speed(udc, driver->max_speed);
1603 ret = driver->bind(udc->gadget, driver);
1633 driver->unbind(udc->gadget);
1638 driver->function, ret);
1641 udc->driver = NULL;
1642 driver->is_bound = false;
1652 struct usb_gadget_driver *driver = udc->driver;
1654 dev_dbg(&udc->dev, "unbinding gadget driver [%s]\n", driver->function);
1665 udc->driver->unbind(gadget);
1672 driver->is_bound = false;
1673 udc->driver = NULL;
1681 int usb_gadget_register_driver_owner(struct usb_gadget_driver *driver,
1686 if (!driver || !driver->bind || !driver->setup)
1689 driver->driver.bus = &gadget_bus_type;
1690 driver->driver.owner = owner;
1691 driver->driver.mod_name = mod_name;
1692 ret = driver_register(&driver->driver);
1694 pr_warn("%s: driver registration failed: %d\n",
1695 driver->function, ret);
1700 if (!driver->is_bound) {
1701 if (driver->match_existing_only) {
1703 driver->function);
1707 driver->function);
1714 driver_unregister(&driver->driver);
1719 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
1721 if (!driver || !driver->unbind)
1724 driver_unregister(&driver->driver);
1750 if (!udc->driver) {
1751 dev_err(dev, "soft-connect without a gadget driver\n");
1797 drv = udc->driver;
1874 if (udc->driver)
1876 udc->driver->function);