drivers/phy/cadence/phy-cadence-torrent.c

Source file repositories/reference/linux-study-clean/drivers/phy/cadence/phy-cadence-torrent.c

File Facts

System
Linux kernel
Corpus path
drivers/phy/cadence/phy-cadence-torrent.c
Extension
.c
Size
211513 bytes
Lines
5877
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 cdns_torrent_inst {
	struct phy *phy;
	u32 mlane;
	enum cdns_torrent_phy_type phy_type;
	u32 num_lanes;
	struct reset_control *lnk_rst;
	enum cdns_torrent_ssc_mode ssc_mode;
};

struct cdns_torrent_phy {
	void __iomem *base;	/* DPTX registers base */
	void __iomem *sd_base; /* SD0801 registers base */
	u32 max_bit_rate; /* Maximum link bit rate to use (in Mbps) */
	u32 dp_pll;
	u32 protocol_bitmask;
	struct reset_control *phy_rst;
	struct reset_control *apb_rst;
	struct device *dev;
	struct clk *clk;
	struct clk *clk1;
	enum cdns_torrent_ref_clk ref_clk_rate;
	enum cdns_torrent_ref_clk ref_clk1_rate;
	struct cdns_torrent_inst phys[MAX_NUM_LANES];
	int nsubnodes;
	int already_configured;
	const struct cdns_torrent_data *init_data;
	struct regmap *regmap_common_cdb;
	struct regmap *regmap_phy_pcs_common_cdb;
	struct regmap *regmap_phy_pma_common_cdb;
	struct regmap *regmap_tx_lane_cdb[MAX_NUM_LANES];
	struct regmap *regmap_rx_lane_cdb[MAX_NUM_LANES];
	struct regmap *regmap_phy_pcs_lane_cdb[MAX_NUM_LANES];
	struct regmap *regmap_dptx_phy_reg;
	struct regmap_field *phy_pll_cfg;
	struct regmap_field *phy_pipe_cmn_ctrl1_0;
	struct regmap_field *cmn_cdiag_refclk_ovrd_4;
	struct regmap_field *phy_pma_cmn_ctrl_1;
	struct regmap_field *phy_pma_cmn_ctrl_2;
	struct regmap_field *phy_pma_pll_raw_ctrl;
	struct regmap_field *phy_reset_ctrl;
	struct regmap_field *phy_pcs_iso_link_ctrl_1[MAX_NUM_LANES];
	struct clk_hw_onecell_data *clk_hw_data;
};

enum phy_powerstate {
	POWERSTATE_A0 = 0,
	/* Powerstate A1 is unused */
	POWERSTATE_A2 = 2,
	POWERSTATE_A3 = 3,
};

struct cdns_torrent_refclk_driver {
	struct clk_hw		hw;
	struct regmap_field	*cmn_fields[REFCLK_OUT_NUM_CMN_CONFIG];
	struct clk_init_data	clk_data;
	u8 parent_index;
};

#define to_cdns_torrent_refclk_driver(_hw)	\
			container_of(_hw, struct cdns_torrent_refclk_driver, hw)

struct cdns_torrent_derived_refclk {
	struct clk_hw		hw;
	struct regmap_field	*phy_pipe_cmn_ctrl1_0;
	struct regmap_field	*cmn_cdiag_refclk_ovrd_4;
	struct clk_init_data	clk_data;
};

#define to_cdns_torrent_derived_refclk(_hw)	\
			container_of(_hw, struct cdns_torrent_derived_refclk, hw)

struct cdns_torrent_received_refclk {
	struct clk_hw		hw;
	struct regmap_field	*phy_pipe_cmn_ctrl1_0;
	struct regmap_field	*cmn_cdiag_refclk_ovrd_4;
	struct clk_init_data	clk_data;
};

#define to_cdns_torrent_received_refclk(_hw)	\
			container_of(_hw, struct cdns_torrent_received_refclk, hw)

struct cdns_reg_pairs {
	u32 val;
	u32 off;
};

struct cdns_torrent_vals {
	const struct cdns_reg_pairs *reg_pairs;
	u32 num_regs;
};

Annotation

Implementation Notes