drivers/usb/musb/musb_dsps.c
Source file repositories/reference/linux-study-clean/drivers/usb/musb/musb_dsps.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/musb/musb_dsps.c- Extension
.c- Size
- 26645 bytes
- Lines
- 1049
- 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/io.hlinux/irq.hlinux/err.hlinux/platform_device.hlinux/dma-mapping.hlinux/pm_runtime.hlinux/module.hlinux/usb/usb_phy_generic.hlinux/platform_data/usb-omap.hlinux/sizes.hlinux/string_choices.hlinux/of.hlinux/of_address.hlinux/usb/of.hlinux/debugfs.hmusb_core.h
Detected Declarations
struct dsps_musb_wrapperstruct dsps_contextstruct dsps_gluefunction dsps_mod_timerfunction dsps_mod_timer_optionalfunction dsps_musb_enablefunction dsps_musb_disablefunction dsps_check_statusfunction otg_timerfunction dsps_musb_clear_ep_rxintrfunction dsps_interruptfunction dsps_musb_dbg_initfunction dsps_musb_initfunction dsps_musb_exitfunction dsps_musb_set_modefunction dsps_sw_babble_controlfunction dsps_musb_recoverfunction dsps_read_fifo32function dsps_dma_controller_callbackfunction dsps_dma_controller_createfunction dsps_dma_controller_suspendfunction dsps_dma_controller_resumefunction dsps_dma_controller_suspendfunction get_int_propfunction dsps_create_musb_pdevfunction dsps_vbus_threaded_irqfunction dsps_setup_optional_vbus_irqfunction dsps_probefunction dsps_removefunction dsps_suspendfunction dsps_resume
Annotated Snippet
struct dsps_musb_wrapper {
u16 revision;
u16 control;
u16 status;
u16 epintr_set;
u16 epintr_clear;
u16 epintr_status;
u16 coreintr_set;
u16 coreintr_clear;
u16 coreintr_status;
u16 phy_utmi;
u16 mode;
u16 tx_mode;
u16 rx_mode;
/* bit positions for control */
unsigned reset:5;
/* bit positions for interrupt */
unsigned usb_shift:5;
u32 usb_mask;
u32 usb_bitmap;
unsigned drvvbus:5;
unsigned txep_shift:5;
u32 txep_mask;
u32 txep_bitmap;
unsigned rxep_shift:5;
u32 rxep_mask;
u32 rxep_bitmap;
/* bit positions for phy_utmi */
unsigned otg_disable:5;
/* bit positions for mode */
unsigned iddig:5;
unsigned iddig_mux:5;
/* miscellaneous stuff */
unsigned poll_timeout;
};
/*
* register shadow for suspend
*/
struct dsps_context {
u32 control;
u32 epintr;
u32 coreintr;
u32 phy_utmi;
u32 mode;
u32 tx_mode;
u32 rx_mode;
};
/*
* DSPS glue structure.
*/
struct dsps_glue {
struct device *dev;
struct platform_device *musb; /* child musb pdev */
const struct dsps_musb_wrapper *wrp; /* wrapper register offsets */
int vbus_irq; /* optional vbus irq */
unsigned long last_timer; /* last timer data for each instance */
bool sw_babble_enabled;
void __iomem *usbss_base;
struct dsps_context context;
struct debugfs_regset32 regset;
struct dentry *dbgfs_root;
};
static const struct debugfs_reg32 dsps_musb_regs[] = {
{ "revision", 0x00 },
{ "control", 0x14 },
{ "status", 0x18 },
{ "eoi", 0x24 },
{ "intr0_stat", 0x30 },
{ "intr1_stat", 0x34 },
{ "intr0_set", 0x38 },
{ "intr1_set", 0x3c },
{ "txmode", 0x70 },
{ "rxmode", 0x74 },
{ "autoreq", 0xd0 },
{ "srpfixtime", 0xd4 },
{ "tdown", 0xd8 },
{ "phy_utmi", 0xe0 },
{ "mode", 0xe8 },
};
Annotation
- Immediate include surface: `linux/io.h`, `linux/irq.h`, `linux/err.h`, `linux/platform_device.h`, `linux/dma-mapping.h`, `linux/pm_runtime.h`, `linux/module.h`, `linux/usb/usb_phy_generic.h`.
- Detected declarations: `struct dsps_musb_wrapper`, `struct dsps_context`, `struct dsps_glue`, `function dsps_mod_timer`, `function dsps_mod_timer_optional`, `function dsps_musb_enable`, `function dsps_musb_disable`, `function dsps_check_status`, `function otg_timer`, `function dsps_musb_clear_ep_rxintr`.
- 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.