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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/clk-provider.hlinux/delay.hlinux/err.hlinux/io.hlinux/iopoll.hlinux/kernel.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/of_address.hlinux/phy/phy.hlinux/platform_device.hlinux/regmap.hlinux/regulator/consumer.hlinux/reset.hlinux/slab.hlinux/usb/typec.hlinux/usb/typec_mux.hdt-bindings/phy/phy-qcom-qmp.hphy-qcom-qmp-common.hphy-qcom-qmp.hphy-qcom-qmp-pcs-misc-v3.hphy-qcom-qmp-dp-phy.hphy-qcom-qmp-dp-phy-v2.h
Detected Declarations
struct qmp_usbc_offsetsstruct qmp_usbcstruct qmp_phy_cfgstruct qmp_usbcenum qphy_reg_layoutfunction qphy_setbitsfunction qphy_clrbitsfunction qmp_usbc_set_phy_modefunction qmp_usbc_com_initfunction qmp_usbc_com_exitfunction qmp_v2_dp_aux_initfunction qmp_v2_configure_dp_swingfunction qmp_usbc_configure_dp_modefunction qmp_usbc_configure_dp_clocksfunction qmp_v2_configure_dp_txfunction qmp_v2_configure_dp_phyfunction qmp_v2_calibrate_dp_phyfunction qmp_usbc_usb_power_onfunction qmp_usbc_usb_power_offfunction qmp_usbc_check_phy_statusfunction qmp_usbc_usb_enablefunction qmp_usbc_usb_disablefunction qmp_usbc_usb_set_modefunction qmp_usbc_dp_enablefunction qmp_usbc_dp_disablefunction qmp_usbc_dp_configurefunction qmp_usbc_dp_calibratefunction qmp_usbc_dp_serdes_initfunction qmp_usbc_dp_power_onfunction qmp_usbc_dp_power_offfunction qmp_usbc_enable_autonomous_modefunction qmp_usbc_disable_autonomous_modefunction qmp_usbc_runtime_suspendfunction qmp_usbc_runtime_resumefunction qmp_usbc_reset_initfunction qmp_usbc_clk_initfunction phy_pipe_clk_registerfunction qmp_dp_pixel_clk_determine_ratefunction qmp_dp_pixel_clk_recalc_ratefunction qmp_dp_link_clk_determine_ratefunction qmp_dp_link_clk_recalc_ratefunction phy_dp_clks_registerfunction phy_clk_release_providerfunction qmp_usbc_register_clocksfunction qmp_usbc_typec_switch_setfunction qmp_usbc_typec_unregisterfunction qmp_usbc_typec_switch_registerfunction qmp_usbc_typec_switch_register
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
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/delay.h`, `linux/err.h`, `linux/io.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/mfd/syscon.h`.
- Detected declarations: `struct qmp_usbc_offsets`, `struct qmp_usbc`, `struct qmp_phy_cfg`, `struct qmp_usbc`, `enum qphy_reg_layout`, `function qphy_setbits`, `function qphy_clrbits`, `function qmp_usbc_set_phy_mode`, `function qmp_usbc_com_init`, `function qmp_usbc_com_exit`.
- Atlas domain: Driver Families / drivers/phy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.