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.

Dependency Surface

Detected Declarations

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

Implementation Notes