drivers/phy/qualcomm/phy-qcom-edp.c

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

File Facts

System
Linux kernel
Corpus path
drivers/phy/qualcomm/phy-qcom-edp.c
Extension
.c
Size
43503 bytes
Lines
1509
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 qcom_edp_swing_pre_emph_cfg {
	const u8 (*swing_hbr_rbr)[4][4];
	const u8 (*swing_hbr3_hbr2)[4][4];
	const u8 (*pre_emphasis_hbr_rbr)[4][4];
	const u8 (*pre_emphasis_hbr3_hbr2)[4][4];
};

struct qcom_edp;

struct phy_ver_ops {
	int (*com_power_on)(const struct qcom_edp *edp);
	int (*com_resetsm_cntrl)(const struct qcom_edp *edp);
	int (*com_bias_en_clkbuflr)(const struct qcom_edp *edp);
	int (*com_clk_fwd_cfg)(const struct qcom_edp *edp);
	int (*com_configure_pll)(const struct qcom_edp *edp);
	int (*com_configure_ssc)(const struct qcom_edp *edp);
	int (*com_ldo_config)(const struct qcom_edp *edp);
};

struct qcom_edp_phy_cfg {
	bool is_edp;
	const u8 *aux_cfg;
	const u8 *vco_div_cfg;
	const struct qcom_edp_swing_pre_emph_cfg *dp_swing_pre_emph_cfg;
	const struct qcom_edp_swing_pre_emph_cfg *edp_swing_pre_emph_cfg;
	const struct phy_ver_ops *ver_ops;
};

struct qcom_edp {
	struct device *dev;
	const struct qcom_edp_phy_cfg *cfg;

	struct phy *phy;

	void __iomem *edp;
	void __iomem *tx0;
	void __iomem *tx1;
	void __iomem *pll;

	struct clk_hw dp_link_hw;
	struct clk_hw dp_pixel_hw;

	struct phy_configure_opts_dp dp_opts;

	struct clk_bulk_data *clks;
	int num_clks;

	struct regulator_bulk_data supplies[2];

	bool is_edp;
};

static const u8 dp_swing_hbr_rbr[4][4] = {
	{ 0x07, 0x0f, 0x16, 0x1f },
	{ 0x11, 0x1e, 0x1f, 0xff },
	{ 0x16, 0x1f, 0xff, 0xff },
	{ 0x1f, 0xff, 0xff, 0xff }
};

static const u8 dp_pre_emp_hbr_rbr[4][4] = {
	{ 0x00, 0x0e, 0x15, 0x1a },
	{ 0x00, 0x0e, 0x15, 0xff },
	{ 0x00, 0x0e, 0xff, 0xff },
	{ 0x04, 0xff, 0xff, 0xff }
};

static const u8 dp_swing_hbr2_hbr3[4][4] = {
	{ 0x02, 0x12, 0x16, 0x1a },
	{ 0x09, 0x19, 0x1f, 0xff },
	{ 0x10, 0x1f, 0xff, 0xff },
	{ 0x1f, 0xff, 0xff, 0xff }
};

static const u8 dp_pre_emp_hbr2_hbr3[4][4] = {
	{ 0x00, 0x0c, 0x15, 0x1b },
	{ 0x02, 0x0e, 0x16, 0xff },
	{ 0x02, 0x11, 0xff, 0xff },
	{ 0x04, 0xff, 0xff, 0xff }
};

static const struct qcom_edp_swing_pre_emph_cfg dp_phy_swing_pre_emph_cfg = {
	.swing_hbr_rbr = &dp_swing_hbr_rbr,
	.swing_hbr3_hbr2 = &dp_swing_hbr2_hbr3,
	.pre_emphasis_hbr_rbr = &dp_pre_emp_hbr_rbr,
	.pre_emphasis_hbr3_hbr2 = &dp_pre_emp_hbr2_hbr3,
};

static const u8 dp_pre_emp_hbr_rbr_v8[4][4] = {
	{ 0x00, 0x0e, 0x15, 0x1a },
	{ 0x00, 0x0e, 0x15, 0xff },

Annotation

Implementation Notes