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.
- 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
dt-bindings/phy/phy.hdt-bindings/phy/phy-cadence.hlinux/clk.hlinux/clk-provider.hlinux/delay.hlinux/err.hlinux/io.hlinux/iopoll.hlinux/kernel.hlinux/module.hlinux/of.hlinux/phy/phy.hlinux/platform_device.hlinux/reset.hlinux/regmap.h
Detected Declarations
struct cdns_torrent_inststruct cdns_torrent_phystruct cdns_torrent_refclk_driverstruct cdns_torrent_derived_refclkstruct cdns_torrent_received_refclkstruct cdns_reg_pairsstruct cdns_torrent_valsstruct cdns_torrent_vals_entrystruct cdns_torrent_vals_tablestruct cdns_torrent_datastruct cdns_regmap_cdb_contextstruct coefficientsenum cdns_torrent_refclk_out_cmnenum cdns_torrent_phy_typeenum cdns_torrent_ref_clkenum cdns_torrent_ssc_modeenum phy_powerstatefunction cdns_regmap_writefunction cdns_regmap_readfunction cdns_regmap_dptx_writefunction cdns_regmap_dptx_readfunction cdns_torrent_phy_writefunction cdns_torrent_phy_readfunction cdns_torrent_dp_writefunction cdns_torrent_dp_readfunction cdns_torrent_dp_enable_ssc_19_2mhzfunction cdns_torrent_dp_pma_cmn_vco_cfg_19_2mhzfunction cdns_torrent_dp_enable_ssc_25mhzfunction cdns_torrent_dp_pma_cmn_vco_cfg_25mhzfunction cdns_torrent_dp_pma_cmn_vco_cfg_100mhzfunction cdns_torrent_dp_get_pllfunction cdns_torrent_dp_set_pll_enfunction cdns_torrent_dp_set_power_statefunction cdns_torrent_dp_runfunction cdns_torrent_dp_wait_pma_cmn_readyfunction cdns_torrent_dp_pma_cmn_ratefunction cdns_torrent_dp_configure_ratefunction cdns_torrent_dp_verify_configfunction cdns_torrent_dp_set_a0_pllfunction cdns_torrent_dp_set_lanesfunction cdns_torrent_dp_set_ratefunction cdns_torrent_dp_set_voltagesfunction cdns_torrent_dp_configurefunction cdns_torrent_phy_onfunction cdns_torrent_phy_offfunction cdns_torrent_dp_common_initfunction cdns_torrent_dp_startfunction cdns_torrent_dp_init
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
- Immediate include surface: `dt-bindings/phy/phy.h`, `dt-bindings/phy/phy-cadence.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/delay.h`, `linux/err.h`, `linux/io.h`, `linux/iopoll.h`.
- Detected declarations: `struct cdns_torrent_inst`, `struct cdns_torrent_phy`, `struct cdns_torrent_refclk_driver`, `struct cdns_torrent_derived_refclk`, `struct cdns_torrent_received_refclk`, `struct cdns_reg_pairs`, `struct cdns_torrent_vals`, `struct cdns_torrent_vals_entry`, `struct cdns_torrent_vals_table`, `struct cdns_torrent_data`.
- 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.