drivers/usb/gadget/udc/aspeed-vhub/dev.c
Source file repositories/reference/linux-study-clean/drivers/usb/gadget/udc/aspeed-vhub/dev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/gadget/udc/aspeed-vhub/dev.c- Extension
.c- Size
- 14701 bytes
- Lines
- 613
- Domain
- Driver Families
- Bucket
- drivers/usb
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/platform_device.hlinux/delay.hlinux/ioport.hlinux/slab.hlinux/errno.hlinux/list.hlinux/interrupt.hlinux/proc_fs.hlinux/prefetch.hlinux/clk.hlinux/usb/gadget.hlinux/of.hlinux/regmap.hlinux/dma-mapping.hlinux/usb.hlinux/usb/hcd.hvhub.h
Detected Declarations
function ast_vhub_dev_irqfunction ast_vhub_dev_enablefunction ast_vhub_dev_disablefunction ast_vhub_dev_featurefunction ast_vhub_ep_featurefunction ast_vhub_dev_statusfunction ast_vhub_ep_statusfunction ast_vhub_dev_set_addressfunction ast_vhub_std_dev_requestfunction ast_vhub_udc_wakeupfunction ast_vhub_udc_get_framefunction ast_vhub_dev_nukefunction ast_vhub_udc_pullupfunction ast_vhub_udc_startfunction ast_vhub_udc_stopfunction ast_vhub_dev_suspendfunction ast_vhub_dev_resumefunction ast_vhub_dev_resetfunction ast_vhub_del_devfunction ast_vhub_dev_releasefunction ast_vhub_init_dev
Annotated Snippet
rc = device_add(d->port_dev);
if (rc)
goto fail_add;
/* Populate gadget */
INIT_LIST_HEAD(&d->gadget.ep_list);
d->gadget.ops = &ast_vhub_udc_ops;
d->gadget.ep0 = &d->ep0.ep;
d->gadget.name = KBUILD_MODNAME;
if (vhub->force_usb1)
d->gadget.max_speed = USB_SPEED_FULL;
else
d->gadget.max_speed = USB_SPEED_HIGH;
d->gadget.speed = USB_SPEED_UNKNOWN;
d->gadget.dev.of_node = vhub->pdev->dev.of_node;
dev_set_of_node_reused(&d->gadget.dev);
rc = usb_add_gadget_udc(d->port_dev, &d->gadget);
if (rc != 0)
goto fail_udc;
d->registered = true;
return 0;
fail_udc:
device_del(d->port_dev);
fail_add:
put_device(d->port_dev);
fail_alloc:
kfree(d->epns);
return rc;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/platform_device.h`, `linux/delay.h`, `linux/ioport.h`, `linux/slab.h`, `linux/errno.h`, `linux/list.h`.
- Detected declarations: `function ast_vhub_dev_irq`, `function ast_vhub_dev_enable`, `function ast_vhub_dev_disable`, `function ast_vhub_dev_feature`, `function ast_vhub_ep_feature`, `function ast_vhub_dev_status`, `function ast_vhub_ep_status`, `function ast_vhub_dev_set_address`, `function ast_vhub_std_dev_request`, `function ast_vhub_udc_wakeup`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.