drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
Source file repositories/reference/linux-study-clean/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c- Extension
.c- Size
- 22138 bytes
- Lines
- 816
- 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/module.hlinux/of.hlinux/of_address.hlinux/phy/phy.hlinux/platform_device.hlinux/regulator/consumer.hlinux/reset.hlinux/slab.hphy-qcom-qmp-common.hphy-qcom-qmp.h
Detected Declarations
struct qmp_phy_cfgstruct qmp_phystruct qcom_qmpenum qphy_reg_layoutfunction qphy_setbitsfunction qphy_clrbitsfunction qmp_pcie_msm8996_serdes_initfunction qmp_pcie_msm8996_com_initfunction qmp_pcie_msm8996_com_exitfunction qmp_pcie_msm8996_initfunction qmp_pcie_msm8996_power_onfunction qmp_pcie_msm8996_power_offfunction qmp_pcie_msm8996_exitfunction qmp_pcie_msm8996_enablefunction qmp_pcie_msm8996_disablefunction qmp_pcie_msm8996_vreg_initfunction qmp_pcie_msm8996_reset_initfunction qmp_pcie_msm8996_clk_initfunction phy_clk_release_providerfunction phy_pipe_clk_registerfunction qcom_qmp_reset_control_putfunction qmp_pcie_msm8996_createfunction qmp_pcie_msm8996_probe
Annotated Snippet
struct qmp_phy_cfg {
/* number of PHYs provided by this block */
int num_phys;
/* Init sequence for 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;
/* clock ids to be requested */
const char * const *clk_list;
int num_clks;
/* resets to be requested */
const char * const *reset_list;
int num_resets;
/* regulators to be requested */
const char * const *vreg_list;
int num_vregs;
/* array of registers with different offsets */
const unsigned int *regs;
};
/**
* struct qmp_phy - per-lane phy descriptor
*
* @phy: generic phy
* @cfg: phy specific configuration
* @serdes: iomapped memory space for phy's serdes (i.e. PLL)
* @tx: iomapped memory space for lane's tx
* @rx: iomapped memory space for lane's rx
* @pcs: iomapped memory space for lane's pcs
* @pipe_clk: pipe clock
* @index: lane index
* @qmp: QMP phy to which this lane belongs
* @lane_rst: lane's reset controller
*/
struct qmp_phy {
struct phy *phy;
const struct qmp_phy_cfg *cfg;
void __iomem *serdes;
void __iomem *tx;
void __iomem *rx;
void __iomem *pcs;
struct clk *pipe_clk;
unsigned int index;
struct qcom_qmp *qmp;
struct reset_control *lane_rst;
};
/**
* struct qcom_qmp - structure holding QMP phy block attributes
*
* @dev: device
*
* @clks: array of clocks required by phy
* @resets: array of resets required by phy
* @vregs: regulator supplies bulk data
*
* @phys: array of per-lane phy descriptors
* @phy_mutex: mutex lock for PHY common block initialization
* @init_count: phy common block initialization count
*/
struct qcom_qmp {
struct device *dev;
struct clk_bulk_data *clks;
struct reset_control_bulk_data *resets;
struct regulator_bulk_data *vregs;
struct qmp_phy **phys;
struct mutex phy_mutex;
int init_count;
};
static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val)
{
u32 reg;
reg = readl(base + offset);
reg |= val;
writel(reg, base + offset);
/* ensure that above write is through */
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/module.h`.
- Detected declarations: `struct qmp_phy_cfg`, `struct qmp_phy`, `struct qcom_qmp`, `enum qphy_reg_layout`, `function qphy_setbits`, `function qphy_clrbits`, `function qmp_pcie_msm8996_serdes_init`, `function qmp_pcie_msm8996_com_init`, `function qmp_pcie_msm8996_com_exit`, `function qmp_pcie_msm8996_init`.
- 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.