drivers/usb/isp1760/isp1760-udc.c
Source file repositories/reference/linux-study-clean/drivers/usb/isp1760/isp1760-udc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/isp1760/isp1760-udc.c- Extension
.c- Size
- 39217 bytes
- Lines
- 1601
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/interrupt.hlinux/io.hlinux/kernel.hlinux/list.hlinux/module.hlinux/slab.hlinux/timer.hlinux/usb.hisp1760-core.hisp1760-regs.hisp1760-udc.h
Detected Declarations
struct isp1760_requestfunction isp1760_udc_readfunction isp1760_udc_writefunction isp1760_udc_read_rawfunction isp1760_udc_read_raw16function isp1760_udc_write_rawfunction isp1760_udc_write_raw16function isp1760_udc_setfunction isp1760_udc_clearfunction isp1760_udc_is_setfunction __isp1760_udc_select_epfunction isp1760_udc_select_epfunction isp1760_udc_ctrl_send_statusfunction isp1760_udc_request_completefunction isp1760_udc_ctrl_send_stallfunction isp1760_udc_receivefunction isp1760_udc_transmitfunction isp1760_ep_rx_readyfunction isp1760_ep_tx_completefunction __isp1760_udc_set_haltfunction isp1760_udc_get_statusfunction isp1760_udc_set_addressfunction isp1760_ep0_setup_standardfunction isp1760_ep0_setupfunction isp1760_ep_enablefunction le16_to_cpufunction isp1760_ep_disablefunction list_for_each_entry_safefunction isp1760_ep_free_requestfunction isp1760_ep_queuefunction isp1760_ep_dequeuefunction __isp1760_ep_set_haltfunction isp1760_ep_set_haltfunction isp1760_ep_set_wedgefunction isp1760_ep_fifo_flushfunction isp1760_udc_connectfunction isp1760_udc_disconnectfunction isp1760_udc_init_hwfunction isp1760_udc_resetfunction isp1760_udc_suspendfunction isp1760_udc_resumefunction isp1760_udc_get_framefunction isp1760_udc_wakeupfunction isp1760_udc_set_selfpoweredfunction isp1760_udc_pullupfunction isp1760_udc_startfunction isp1760_udc_stopfunction isp1760_udc_irq_get_status
Annotated Snippet
struct isp1760_request {
struct usb_request req;
struct list_head queue;
struct isp1760_ep *ep;
unsigned int packet_size;
};
static inline struct isp1760_udc *gadget_to_udc(struct usb_gadget *gadget)
{
return container_of(gadget, struct isp1760_udc, gadget);
}
static inline struct isp1760_ep *ep_to_udc_ep(struct usb_ep *ep)
{
return container_of(ep, struct isp1760_ep, ep);
}
static inline struct isp1760_request *req_to_udc_req(struct usb_request *req)
{
return container_of(req, struct isp1760_request, req);
}
static u32 isp1760_udc_read(struct isp1760_udc *udc, u16 field)
{
return isp1760_field_read(udc->fields, field);
}
static void isp1760_udc_write(struct isp1760_udc *udc, u16 field, u32 val)
{
isp1760_field_write(udc->fields, field, val);
}
static u32 isp1760_udc_read_raw(struct isp1760_udc *udc, u16 reg)
{
__le32 val;
regmap_raw_read(udc->regs, reg, &val, 4);
return le32_to_cpu(val);
}
static u16 isp1760_udc_read_raw16(struct isp1760_udc *udc, u16 reg)
{
__le16 val;
regmap_raw_read(udc->regs, reg, &val, 2);
return le16_to_cpu(val);
}
static void isp1760_udc_write_raw(struct isp1760_udc *udc, u16 reg, u32 val)
{
__le32 val_le = cpu_to_le32(val);
regmap_raw_write(udc->regs, reg, &val_le, 4);
}
static void isp1760_udc_write_raw16(struct isp1760_udc *udc, u16 reg, u16 val)
{
__le16 val_le = cpu_to_le16(val);
regmap_raw_write(udc->regs, reg, &val_le, 2);
}
static void isp1760_udc_set(struct isp1760_udc *udc, u32 field)
{
isp1760_udc_write(udc, field, 0xFFFFFFFF);
}
static void isp1760_udc_clear(struct isp1760_udc *udc, u32 field)
{
isp1760_udc_write(udc, field, 0);
}
static bool isp1760_udc_is_set(struct isp1760_udc *udc, u32 field)
{
return !!isp1760_udc_read(udc, field);
}
/* -----------------------------------------------------------------------------
* Endpoint Management
*/
static struct isp1760_ep *isp1760_udc_find_ep(struct isp1760_udc *udc,
u16 index)
{
unsigned int i;
if (index == 0)
return &udc->ep[0];
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/io.h`, `linux/kernel.h`, `linux/list.h`, `linux/module.h`, `linux/slab.h`, `linux/timer.h`, `linux/usb.h`.
- Detected declarations: `struct isp1760_request`, `function isp1760_udc_read`, `function isp1760_udc_write`, `function isp1760_udc_read_raw`, `function isp1760_udc_read_raw16`, `function isp1760_udc_write_raw`, `function isp1760_udc_write_raw16`, `function isp1760_udc_set`, `function isp1760_udc_clear`, `function isp1760_udc_is_set`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.