drivers/phy/qualcomm/phy-qcom-qmp-usbc.c

Source file repositories/reference/linux-study-clean/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c

File Facts

System
Linux kernel
Corpus path
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
Extension
.c
Size
61877 bytes
Lines
2044
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 qmp_usbc_offsets {
	u16 serdes;
	u16 pcs;
	u16 pcs_misc;
	u16 tx;
	u16 rx;
	/* for PHYs with >= 2 lanes */
	u16 tx2;
	u16 rx2;

	u16 dp_serdes;
	u16 dp_txa;
	u16 dp_txb;
	u16 dp_dp_phy;
};

struct qmp_usbc;
struct qmp_phy_cfg {
	const struct qmp_usbc_offsets *offsets;

	/* Init sequence for USB PHY blocks - serdes, tx, rx, pcs */
	const struct qmp_phy_init_tbl *serdes_tbl;
	int serdes_tbl_num;
	const struct qmp_phy_init_tbl *tx_tbl;
	int tx_tbl_num;
	const struct qmp_phy_init_tbl *rx_tbl;
	int rx_tbl_num;
	const struct qmp_phy_init_tbl *pcs_tbl;
	int pcs_tbl_num;

	/* Init sequence for DP PHY blocks - serdes, tx, rbr, hbr, hbr2 */
	const struct qmp_phy_init_tbl *dp_serdes_tbl;
	int dp_serdes_tbl_num;
	const struct qmp_phy_init_tbl *dp_tx_tbl;
	int dp_tx_tbl_num;
	const struct qmp_phy_init_tbl *serdes_tbl_rbr;
	int serdes_tbl_rbr_num;
	const struct qmp_phy_init_tbl *serdes_tbl_hbr;
	int serdes_tbl_hbr_num;
	const struct qmp_phy_init_tbl *serdes_tbl_hbr2;
	int serdes_tbl_hbr2_num;

	const u8 (*swing_tbl)[4][4];
	const u8 (*pre_emphasis_tbl)[4][4];

	/* DP PHY callbacks */
	void (*dp_aux_init)(struct qmp_usbc *qmp);
	void (*configure_dp_tx)(struct qmp_usbc *qmp);
	int (*configure_dp_phy)(struct qmp_usbc *qmp);
	int (*calibrate_dp_phy)(struct qmp_usbc *qmp);

	const char * const *reset_list;
	int num_resets;
	const struct regulator_bulk_data *vreg_list;
	int num_vregs;

	/* array of registers with different offsets */
	const unsigned int *regs;
};

struct qmp_usbc {
	struct device *dev;

	const struct qmp_phy_cfg *cfg;

	void __iomem *serdes;
	void __iomem *pcs;
	void __iomem *pcs_misc;
	void __iomem *tx;
	void __iomem *rx;
	void __iomem *tx2;
	void __iomem *rx2;
	void __iomem *dp_dp_phy;
	void __iomem *dp_tx;
	void __iomem *dp_tx2;
	void __iomem *dp_serdes;

	struct clk *pipe_clk;
	struct clk_fixed_rate pipe_clk_fixed;

	struct clk_hw dp_link_hw;
	struct clk_hw dp_pixel_hw;
	struct clk_bulk_data *clks;
	int num_clks;
	int num_resets;
	struct reset_control_bulk_data *resets;
	struct regulator_bulk_data *vregs;

	struct regmap *tcsr_map;
	u32 vls_clamp_reg;

Annotation

Implementation Notes