/linux-6.12.1/drivers/usb/gadget/udc/ |
D | core.c | 55 struct usb_gadget *gadget; member 485 int usb_gadget_frame_number(struct usb_gadget *gadget) in usb_gadget_frame_number() argument 489 ret = gadget->ops->get_frame(gadget); in usb_gadget_frame_number() 491 trace_usb_gadget_frame_number(gadget, ret); in usb_gadget_frame_number() 510 int usb_gadget_wakeup(struct usb_gadget *gadget) in usb_gadget_wakeup() argument 514 if (!gadget->ops->wakeup) { in usb_gadget_wakeup() 519 ret = gadget->ops->wakeup(gadget); in usb_gadget_wakeup() 522 trace_usb_gadget_wakeup(gadget, ret); in usb_gadget_wakeup() 537 int usb_gadget_set_remote_wakeup(struct usb_gadget *gadget, int set) in usb_gadget_set_remote_wakeup() argument 541 if (!gadget->ops->set_remote_wakeup) { in usb_gadget_set_remote_wakeup() [all …]
|
D | fsl_udc_core.c | 183 usb_gadget_unmap_request(&ep->udc->gadget, &req->req, ep_is_in(ep)); in done() 186 dev_vdbg(&udc->gadget.dev, "complete %s req %p stat %d len %u/%u\n", in done() 288 dev_err(&udc->gadget.dev, "udc reset timeout!\n"); in dr_controller_setup() 311 dev_vdbg(&udc->gadget.dev, in dr_controller_setup() 383 if (udc->gadget.is_otg) { in dr_controller_stop() 502 dev_vdbg(&udc->gadget.dev, "error ep type is %d\n", ep_type); in struct_ep_qh_setup() 558 if (!udc->driver || (udc->gadget.speed == USB_SPEED_UNKNOWN)) in fsl_ep_enable() 615 dev_vdbg(&udc->gadget.dev, "enabled %s (ep%d%s) maxpacket %d\n", in fsl_ep_enable() 666 dev_vdbg(&udc->gadget.dev, "disabled %s OK\n", _ep->name); in fsl_ep_disable() 815 dev_vdbg(&udc_controller->gadget.dev, "multi-dtd request!\n"); in fsl_build_dtd() [all …]
|
/linux-6.12.1/include/linux/usb/ |
D | gadget.h | 315 int (*func_wakeup)(struct usb_gadget *gadget, int intf_id); 329 void (*udc_set_ssp_rate)(struct usb_gadget *gadget, 331 void (*udc_async_callbacks)(struct usb_gadget *gadget, bool enable); 335 int (*check_config)(struct usb_gadget *gadget); 462 static inline void set_gadget_data(struct usb_gadget *gadget, void *data) in set_gadget_data() argument 463 { dev_set_drvdata(&gadget->dev, data); } in set_gadget_data() 464 static inline void *get_gadget_data(struct usb_gadget *gadget) in get_gadget_data() argument 465 { return dev_get_drvdata(&gadget->dev); } in get_gadget_data() 470 static inline struct usb_gadget *usb_get_gadget(struct usb_gadget *gadget) in usb_get_gadget() argument 472 get_device(&gadget->dev); in usb_get_gadget() [all …]
|
/linux-6.12.1/Documentation/ABI/testing/ |
D | configfs-usb-gadget | 1 What: /config/usb-gadget 8 What: /config/usb-gadget/gadget 13 The attributes of a gadget: 16 UDC bind a gadget to UDC/unbind a gadget; 18 to bind a gadget, empty string "" to unbind. 34 What: /config/usb-gadget/gadget/configs 38 This group contains a USB gadget's configurations 40 What: /config/usb-gadget/gadget/configs/config 51 What: /config/usb-gadget/gadget/configs/config/strings 58 What: /config/usb-gadget/gadget/configs/config/strings/language [all …]
|
D | configfs-usb-gadget-uvc | 1 What: /config/usb-gadget/gadget/functions/uvc.name 13 What: /config/usb-gadget/gadget/functions/uvc.name/control 27 What: /config/usb-gadget/gadget/functions/uvc.name/control/class 32 What: /config/usb-gadget/gadget/functions/uvc.name/control/class/ss 37 What: /config/usb-gadget/gadget/functions/uvc.name/control/class/fs 42 What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal 47 What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal/output 52 What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal/output/default 69 What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal/camera 74 What: /config/usb-gadget/gadget/functions/uvc.name/control/terminal/camera/default [all …]
|
/linux-6.12.1/drivers/usb/gadget/ |
D | epautoconf.c | 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() 150 struct usb_gadget *gadget, in usb_ep_autoconfig() argument [all …]
|
D | composite.c | 407 status = usb_gadget_deactivate(cdev->gadget); in usb_function_deactivate() 442 status = usb_gadget_activate(cdev->gadget); in usb_function_activate() 505 struct usb_gadget *gadget = func->config->cdev->gadget; in usb_func_wakeup() local 508 if (!gadget->ops->func_wakeup) in usb_func_wakeup() 525 return gadget->ops->func_wakeup(gadget, id); in usb_func_wakeup() 616 struct usb_gadget *gadget = cdev->gadget; in config_desc() local 622 if (gadget->speed >= USB_SPEED_SUPER) in config_desc() 623 speed = gadget->speed; in config_desc() 624 else if (gadget_is_dualspeed(gadget)) { in config_desc() 626 if (gadget->speed == USB_SPEED_HIGH) in config_desc() [all …]
|
/linux-6.12.1/drivers/usb/gadget/udc/bdc/ |
D | bdc_udc.c | 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() [all …]
|
/linux-6.12.1/drivers/usb/gadget/legacy/ |
D | dbgp.c | 27 struct usb_gadget *gadget; member 124 dev_dbg(&dbgp.gadget->dev, in dbgp_complete() 162 dev_dbg(&dbgp.gadget->dev, in dbgp_enable_ep_req() 204 dev_dbg(&dbgp.gadget->dev, "enable ep: failure (%d:%d)\n", stp, err); in dbgp_enable_ep() 209 static void dbgp_disconnect(struct usb_gadget *gadget) in dbgp_disconnect() argument 218 static void dbgp_unbind(struct usb_gadget *gadget) in dbgp_unbind() argument 226 usb_ep_free_request(gadget->ep0, dbgp.req); in dbgp_unbind() 235 static int dbgp_configure_endpoints(struct usb_gadget *gadget) in dbgp_configure_endpoints() argument 239 usb_ep_autoconfig_reset(gadget); in dbgp_configure_endpoints() 241 dbgp.i_ep = usb_ep_autoconfig(gadget, &i_desc); in dbgp_configure_endpoints() [all …]
|
D | raw_gadget.c | 175 struct usb_gadget *gadget; member 216 usb_ep_dequeue(dev->gadget->ep0, dev->req); in dev_free() 217 usb_ep_free_request(dev->gadget->ep0, dev->req); in dev_free() 280 static int gadget_bind(struct usb_gadget *gadget, in gadget_bind() argument 289 if (strcmp(gadget->name, dev->udc_name) != 0) in gadget_bind() 292 set_gadget_data(gadget, dev); in gadget_bind() 293 req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL); in gadget_bind() 295 dev_err(&gadget->dev, "usb_ep_alloc_request failed\n"); in gadget_bind() 296 set_gadget_data(gadget, NULL); in gadget_bind() 304 dev->gadget = gadget; in gadget_bind() [all …]
|
D | ether.c | 214 if (gadget_is_otg(c->cdev->gadget)) { in rndis_do_config() 256 if (gadget_is_otg(c->cdev->gadget)) { in eth_do_config() 271 } else if (can_support_ecm(c->cdev->gadget)) { in eth_do_config() 306 struct usb_gadget *gadget = cdev->gadget; in eth_bind() local 327 } else if (can_support_ecm(gadget)) { in eth_bind() 367 gether_set_gadget(net, cdev->gadget); in eth_bind() 374 else if (can_support_ecm(gadget)) in eth_bind() 402 if (gadget_is_otg(gadget) && !otg_desc[0]) { in eth_bind() 405 usb_desc = usb_otg_descriptor_alloc(gadget); in eth_bind() 410 usb_otg_descriptor_init(gadget, usb_desc); in eth_bind() [all …]
|
D | cdc2.c | 93 if (gadget_is_otg(c->cdev->gadget)) { in cdc_do_config() 140 struct usb_gadget *gadget = cdev->gadget; in cdc_bind() local 144 if (!can_support_ecm(cdev->gadget)) { in cdc_bind() 145 dev_err(&gadget->dev, "controller '%s' not usable\n", in cdc_bind() 146 gadget->name); in cdc_bind() 178 if (gadget_is_otg(gadget) && !otg_desc[0]) { in cdc_bind() 181 usb_desc = usb_otg_descriptor_alloc(gadget); in cdc_bind() 186 usb_otg_descriptor_init(gadget, usb_desc); in cdc_bind() 197 dev_info(&gadget->dev, "%s, version: " DRIVER_VERSION "\n", in cdc_bind()
|
D | printer.c | 116 struct usb_gadget *gadget = c->cdev->gadget; in printer_do_config() local 119 usb_ep_autoconfig_reset(gadget); in printer_do_config() 121 usb_gadget_set_selfpowered(gadget); in printer_do_config() 123 if (gadget_is_otg(gadget)) { in printer_do_config() 174 if (gadget_is_otg(cdev->gadget) && !otg_desc[0]) { in printer_bind() 177 usb_desc = usb_otg_descriptor_alloc(cdev->gadget); in printer_bind() 182 usb_otg_descriptor_init(cdev->gadget, usb_desc); in printer_bind()
|
D | inode.c | 147 struct usb_gadget *gadget; member 785 switch (data->dev->gadget->speed) { in ep_config() 938 (void) usb_ep_set_halt (dev->gadget->ep0); in ep0_read() 943 struct usb_ep *ep = dev->gadget->ep0; in ep0_read() 959 if (gadget_is_dualspeed(dev->gadget) in ep0_read() 960 && (dev->gadget->speed in ep0_read() 965 usb_gadget_vbus_draw(dev->gadget, 2 * power); in ep0_read() 1001 clean_req (dev->gadget->ep0, dev->req); in ep0_read() 1141 retval = setup_req (dev->gadget->ep0, dev->req, len); in ep0_write() 1152 dev->gadget->ep0, dev->req, in ep0_write() [all …]
|
D | ncm.c | 99 if (gadget_is_otg(c->cdev->gadget)) { in ncm_do_config() 129 struct usb_gadget *gadget = cdev->gadget; in gncm_bind() local 155 if (gadget_is_otg(gadget) && !otg_desc[0]) { in gncm_bind() 158 usb_desc = usb_otg_descriptor_alloc(gadget); in gncm_bind() 163 usb_otg_descriptor_init(gadget, usb_desc); in gncm_bind() 174 dev_info(&gadget->dev, "%s\n", DRIVER_DESC); in gncm_bind()
|
D | multi.c | 138 if (gadget_is_otg(c->cdev->gadget)) { in rndis_do_config() 220 if (gadget_is_otg(c->cdev->gadget)) { in cdc_do_config() 296 struct usb_gadget *gadget = cdev->gadget; in multi_bind() local 307 if (!can_support_ecm(cdev->gadget)) { in multi_bind() 308 dev_err(&gadget->dev, "controller '%s' not usable\n", in multi_bind() 309 gadget->name); in multi_bind() 350 gether_set_gadget(ecm_opts->net, cdev->gadget); in multi_bind() 398 if (gadget_is_otg(gadget) && !otg_desc[0]) { in multi_bind() 401 usb_desc = usb_otg_descriptor_alloc(gadget); in multi_bind() 406 usb_otg_descriptor_init(gadget, usb_desc); in multi_bind() [all …]
|
/linux-6.12.1/drivers/usb/gadget/udc/aspeed-vhub/ |
D | dev.c | 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() [all …]
|
/linux-6.12.1/drivers/usb/phy/ |
D | phy-gpio-vbus-usb.c | 98 if (!gpio_vbus->phy.otg->gadget) in gpio_vbus_work() 116 usb_gadget_vbus_connect(gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 126 status, gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 135 usb_gadget_vbus_disconnect(gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 141 status, gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 155 otg->gadget ? otg->gadget->name : "none"); in gpio_vbus_irq() 157 if (otg->gadget) in gpio_vbus_irq() 167 struct usb_gadget *gadget) in gpio_vbus_set_peripheral() argument 175 if (!gadget) { in gpio_vbus_set_peripheral() 177 otg->gadget->name); in gpio_vbus_set_peripheral() [all …]
|
/linux-6.12.1/Documentation/usb/ |
D | gadget_serial.rst | 27 This document and the gadget serial driver itself are 36 Versions of the gadget serial driver are available for the 38 version 2.3 or later of the gadget serial driver in a 2.6 45 gadget and usb drivers as modules. 56 The gadget serial driver is a Linux USB gadget driver, a USB device 61 The gadget serial driver talks over USB to either a CDC ACM driver 84 On the device-side Linux system, the gadget serial driver looks 87 On the host-side system, the gadget serial device looks like a 98 With the gadget serial driver and the host side ACM or generic 100 the host and the gadget side systems as if they were connected by a [all …]
|
D | gadget_configfs.rst | 2 Linux USB gadget configured through configfs 18 A gadget is seen by its host as a set of configurations, each of which contains 19 a number of interfaces which, from the gadget's perspective, are known as 24 Creating a gadget means deciding what configurations there will be 31 It also describes how configfs integration into gadget is designed. 62 For each gadget to be created its corresponding directory must be created:: 64 $ mkdir $CONFIGFS_HOME/usb_gadget/<gadget name> 76 Each gadget needs to have its vendor id <VID> and product id <PID> specified:: 81 A gadget also needs its serial number, manufacturer and product strings. 106 Each gadget will consist of a number of configurations, their corresponding [all …]
|
D | gadget_multi.rst | 8 The Multifunction Composite Gadget (or g_multi) is a composite gadget 10 a... multifunction gadget. 17 and RNDIS can be turned off. If they are both enabled the gadget will 26 To make use of the gadget one needs to make it work on host side -- 27 without that there's no hope of achieving anything with the gadget. 33 Since the gadget uses standard composite framework and appears as such 45 For the gadget to work under Windows two conditions have to be met: 47 Detecting as composite gadget 50 First of all, Windows need to detect the gadget as an USB composite 51 gadget which on its own have some conditions[4]. If they are met, [all …]
|
D | raw-gadget.rst | 5 USB Raw Gadget is a gadget driver that gives userspace low-level control over 6 the gadget's communication process. 8 Like any other gadget driver, Raw Gadget implements USB devices via the 9 USB gadget API. Unlike most gadget drivers, Raw Gadget does not implement 21 USB gadget layer for userspace. The key differences are: 26 its own and never forward them to the gadget layer. 46 The user can interact with Raw Gadget by opening ``/dev/raw-gadget`` and 53 1. Create a Raw Gadget instance by opening ``/dev/raw-gadget``. 57 Raw Gadget and react to those depending on what kind of USB gadget must 66 endpoints for the gadget and assign addresses in the endpoint descriptors [all …]
|
/linux-6.12.1/drivers/usb/isp1760/ |
D | isp1760-udc.c | 35 static inline struct isp1760_udc *gadget_to_udc(struct usb_gadget *gadget) in gadget_to_udc() argument 37 return container_of(gadget, struct isp1760_udc, gadget); in gadget_to_udc() 566 if (udc->gadget.state != USB_STATE_DEFAULT && in isp1760_udc_set_address() 567 udc->gadget.state != USB_STATE_ADDRESS) { in isp1760_udc_set_address() 569 udc->gadget.state); in isp1760_udc_set_address() 573 usb_gadget_set_state(&udc->gadget, addr ? USB_STATE_ADDRESS : in isp1760_udc_set_address() 684 if (udc->gadget.state != USB_STATE_ADDRESS && in isp1760_ep0_setup_standard() 685 udc->gadget.state != USB_STATE_CONFIGURED) in isp1760_ep0_setup_standard() 688 stall = udc->driver->setup(&udc->gadget, req) < 0; in isp1760_ep0_setup_standard() 692 usb_gadget_set_state(&udc->gadget, req->wValue ? in isp1760_ep0_setup_standard() [all …]
|
/linux-6.12.1/drivers/usb/renesas_usbhs/ |
D | mod_gadget.c | 40 struct usb_gadget gadget; member 88 container_of(g, struct usbhsg_gpriv, gadget) 107 #define usbhsg_is_not_connected(gp) ((gp)->gadget.speed == USB_SPEED_UNKNOWN) 462 gpriv->gadget.speed = usbhs_bus_get_speed(priv); in usbhsg_irq_dev_state() 464 dev_dbg(dev, "state = %x : speed : %d\n", state, gpriv->gadget.speed); in usbhsg_irq_dev_state() 466 if (gpriv->gadget.speed != USB_SPEED_UNKNOWN && in usbhsg_irq_dev_state() 469 gpriv->driver->suspend(&gpriv->gadget); in usbhsg_irq_dev_state() 470 usb_gadget_set_state(&gpriv->gadget, USB_STATE_SUSPENDED); in usbhsg_irq_dev_state() 543 ret = gpriv->driver->setup(&gpriv->gadget, &ctrl); in usbhsg_irq_ctrl_stage() 906 gpriv->gadget.speed = USB_SPEED_UNKNOWN; in usbhsg_try_stop() [all …]
|
/linux-6.12.1/drivers/usb/chipidea/ |
D | udc.c | 834 static int _gadget_stop_activity(struct usb_gadget *gadget) in _gadget_stop_activity() argument 837 struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget); in _gadget_stop_activity() 841 gadget_for_each_ep(ep, gadget) { in _gadget_stop_activity() 848 gadget_for_each_ep(ep, gadget) { in _gadget_stop_activity() 858 ci->gadget.speed = USB_SPEED_UNKNOWN; in _gadget_stop_activity() 883 if (ci->gadget.speed != USB_SPEED_UNKNOWN) in isr_reset_handler() 884 usb_gadget_udc_reset(&ci->gadget, ci->driver); in isr_reset_handler() 886 retval = _gadget_stop_activity(&ci->gadget); in isr_reset_handler() 1019 ci->gadget.is_selfpowered; in isr_get_status_response() 1065 usb_gadget_set_state(&ci->gadget, USB_STATE_ADDRESS); in isr_setup_status_complete() [all …]
|