drivers/phy/qualcomm/phy-qcom-m31.c
Source file repositories/reference/linux-study-clean/drivers/phy/qualcomm/phy-qcom-m31.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/qualcomm/phy-qcom-m31.c- Extension
.c- Size
- 7358 bytes
- Lines
- 349
- Domain
- Driver Families
- Bucket
- drivers/phy
- 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.
- 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/clk.hlinux/delay.hlinux/err.hlinux/io.hlinux/kernel.hlinux/module.hlinux/of.hlinux/phy/phy.hlinux/platform_device.hlinux/reset.hlinux/slab.h
Detected Declarations
struct m31_phy_regsstruct m31_priv_datastruct m31usb_phyfunction m31usb_phy_initfunction m31usb_phy_shutdownfunction m31usb_phy_probe
Annotated Snippet
struct m31_phy_regs {
u32 off;
u32 val;
u32 delay;
};
struct m31_priv_data {
bool ulpi_mode;
const struct m31_phy_regs *regs;
unsigned int nregs;
};
static const struct m31_phy_regs m31_ipq5018_regs[] = {
{
.off = USB_PHY_CFG0,
.val = UTMI_PHY_OVERRIDE_EN
},
{
.off = USB_PHY_UTMI_CTRL5,
.val = POR_EN,
.delay = 15
},
{
.off = USB_PHY_FSEL_SEL,
.val = FREQ_SEL
},
{
.off = USB_PHY_HS_PHY_CTRL_COMMON0,
.val = COMMONONN | FSEL | RETENABLEN
},
{
.off = USB_PHY_REFCLK_CTRL,
.val = CLKCORE
},
{
.off = USB_PHY_UTMI_CTRL5,
.val = POR_EN
},
{
.off = USB_PHY_HS_PHY_CTRL2,
.val = USB2_SUSPEND_N_SEL | USB2_SUSPEND_N | USB2_UTMI_CLK_EN
},
{
.off = USB_PHY_UTMI_CTRL5,
.val = 0x0
},
{
.off = USB_PHY_HS_PHY_CTRL2,
.val = USB2_SUSPEND_N | USB2_UTMI_CLK_EN
},
{
.off = USB_PHY_CFG0,
.val = 0x0
},
};
static struct m31_phy_regs m31_ipq5332_regs[] = {
{
USB_PHY_CFG0,
UTMI_PHY_OVERRIDE_EN,
0
},
{
USB_PHY_UTMI_CTRL5,
POR_EN,
15
},
{
USB_PHY_FSEL_SEL,
FREQ_SEL,
0
},
{
USB_PHY_HS_PHY_CTRL_COMMON0,
COMMONONN | FREQ_24MHZ | RETENABLEN,
0
},
{
USB_PHY_UTMI_CTRL5,
POR_EN,
0
},
{
USB_PHY_HS_PHY_CTRL2,
USB2_SUSPEND_N_SEL | USB2_SUSPEND_N | USB2_UTMI_CLK_EN,
0
},
{
USB2PHY_USB_PHY_M31_XCFGI_11,
XCFG_COARSE_TUNE_NUM | XCFG_FINE_TUNE_NUM,
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/err.h`, `linux/io.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/phy/phy.h`.
- Detected declarations: `struct m31_phy_regs`, `struct m31_priv_data`, `struct m31usb_phy`, `function m31usb_phy_init`, `function m31usb_phy_shutdown`, `function m31usb_phy_probe`.
- Atlas domain: Driver Families / drivers/phy.
- Implementation status: source implementation candidate.
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.