phy: qcom: edp: Add SC8280XP eDP and DP PHYs
authorBjorn Andersson <bjorn.andersson@linaro.org>
Wed, 10 Aug 2022 04:07:45 +0000 (21:07 -0700)
committerVinod Koul <vkoul@kernel.org>
Tue, 30 Aug 2022 05:31:23 +0000 (11:01 +0530)
The Qualcomm SC8280XP platform has a number of eDP and DP PHY instances,
add support for these.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220810040745.3582985-6-bjorn.andersson@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-edp.c

index 301ac422d2fe0bfc850c5e7b06bedcbce2cff0e7..de696108cf6ef2c671e3f8f7f809b7f15a0213d9 100644 (file)
@@ -100,6 +100,78 @@ struct qcom_edp {
        struct regulator_bulk_data supplies[2];
 };
 
+static const u8 dp_swing_hbr_rbr[4][4] = {
+       { 0x08, 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, 0x0d, 0x14, 0x1a },
+       { 0x00, 0x0e, 0x15, 0xff },
+       { 0x00, 0x0e, 0xff, 0xff },
+       { 0x03, 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_cfg dp_phy_cfg = {
+       .is_dp = true,
+       .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 edp_swing_hbr_rbr[4][4] = {
+       { 0x07, 0x0f, 0x16, 0x1f },
+       { 0x0d, 0x16, 0x1e, 0xff },
+       { 0x11, 0x1b, 0xff, 0xff },
+       { 0x16, 0xff, 0xff, 0xff }
+};
+
+static const u8 edp_pre_emp_hbr_rbr[4][4] = {
+       { 0x05, 0x12, 0x17, 0x1d },
+       { 0x05, 0x11, 0x18, 0xff },
+       { 0x06, 0x11, 0xff, 0xff },
+       { 0x00, 0xff, 0xff, 0xff }
+};
+
+static const u8 edp_swing_hbr2_hbr3[4][4] = {
+       { 0x0b, 0x11, 0x17, 0x1c },
+       { 0x10, 0x19, 0x1f, 0xff },
+       { 0x19, 0x1f, 0xff, 0xff },
+       { 0x1f, 0xff, 0xff, 0xff }
+};
+
+static const u8 edp_pre_emp_hbr2_hbr3[4][4] = {
+       { 0x08, 0x11, 0x17, 0x1b },
+       { 0x00, 0x0c, 0x13, 0xff },
+       { 0x05, 0x10, 0xff, 0xff },
+       { 0x00, 0xff, 0xff, 0xff }
+};
+
+static const struct qcom_edp_cfg edp_phy_cfg = {
+       .is_dp = false,
+       .swing_hbr_rbr = &edp_swing_hbr_rbr,
+       .swing_hbr3_hbr2 = &edp_swing_hbr2_hbr3,
+       .pre_emphasis_hbr_rbr = &edp_pre_emp_hbr_rbr,
+       .pre_emphasis_hbr3_hbr2 = &edp_pre_emp_hbr2_hbr3,
+};
+
 static int qcom_edp_phy_init(struct phy *phy)
 {
        struct qcom_edp *edp = phy_get_drvdata(phy);
@@ -767,6 +839,8 @@ static int qcom_edp_phy_probe(struct platform_device *pdev)
 static const struct of_device_id qcom_edp_phy_match_table[] = {
        { .compatible = "qcom,sc7280-edp-phy" },
        { .compatible = "qcom,sc8180x-edp-phy" },
+       { .compatible = "qcom,sc8280xp-dp-phy", .data = &dp_phy_cfg },
+       { .compatible = "qcom,sc8280xp-edp-phy", .data = &edp_phy_cfg },
        { }
 };
 MODULE_DEVICE_TABLE(of, qcom_edp_phy_match_table);