Skip to contentSkip to conversation

phy: qcom-qmp: add hbr3_hbr2 voltage and premphasis swing table

PATCH Applied Kuogee Hsieh 4 participants 4 messages Mar 16, 2021 – May 26, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 phy: qcom-qmp: add hbr3_hbr2 voltage and premphasis swing table

Add hbr3_hbr2 voltage and premphasis swing table to support HBR3 link rate.

Changes in V2:
-- replaced upper case with lower case at hbr3_hbr2 table

Changes in v3:
-- replace space with tab at hbr3_hbr2 table

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +21 -2
index 0939a9e..6aaa59c 100644
@@ -2965,6 +2965,20 @@ static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy)
 	       qphy->pcs + QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK);
 }
 
+static const u8 qmp_dp_v3_pre_emphasis_hbr3_hbr2[4][4] = {
+	{ 0x00, 0x0c, 0x15, 0x1a },
+	{ 0x02, 0x0e, 0x16, 0xff },
+	{ 0x02, 0x11, 0xff, 0xff },
+	{ 0x04, 0xff, 0xff, 0xff }
+};
+
+static const u8 qmp_dp_v3_voltage_swing_hbr3_hbr2[4][4] = {
+	{ 0x02, 0x12, 0x16, 0x1a },
+	{ 0x09, 0x19, 0x1f, 0xff },
+	{ 0x10, 0x1f, 0xff, 0xff },
+	{ 0x1f, 0xff, 0xff, 0xff }
+};
+
 static const u8 qmp_dp_v3_pre_emphasis_hbr_rbr[4][4] = {
 	{ 0x00, 0x0c, 0x14, 0x19 },
 	{ 0x00, 0x0b, 0x12, 0xff },
@@ -3000,8 +3014,13 @@ static void qcom_qmp_phy_configure_dp_tx(struct qmp_phy *qphy)
 		drvr_en = 0x10;
 	}
 
-	voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
-	pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+	if (dp_opts->link_rate <= 2700) {
+		voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
+		pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+	} else {
+		voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr3_hbr2[v_level][p_level];
+		pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr3_hbr2[v_level][p_level];
+	}
 
 	/* TODO: Move check to config check */
 	if (voltage_swing_cfg == 0xFF && pre_emphasis_cfg == 0xFF)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

Quoting Kuogee Hsieh (2021-03-16 10:12:41)

Quoted 6 lines

Add hbr3_hbr2 voltage and premphasis swing table to support HBR3 link rate.

Changes in V2:
-- replaced upper case with lower case at hbr3_hbr2 table

Quoted 6 lines

Changes in v3:
-- replace space with tab at hbr3_hbr2 table

Fixes 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy")
maintainer
#2 lore raw
In reply to Kuogee Hsieh
Quoted 8 lines · Kuogee Hsieh

Add hbr3_hbr2 voltage and premphasis swing table to support HBR3 link rate.

Changes in V2:
-- replaced upper case with lower case at hbr3_hbr2 table

Changes in v3:
-- replace space with tab at hbr3_hbr2 table

This should be after the --- line below

Quoted 2 lines

No need of blank line here

Quoted 2 lines

I took the liberty of fixing these two, applying the fixes tag and applied..

Signature · 1 line
~Vinod
#3 lore raw
In reply to Kuogee Hsieh
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 10 lines · On Tue, 16 Mar 2021 10:12:41 -0700 you wrote:

Add hbr3_hbr2 voltage and premphasis swing table to support HBR3 link rate.

Changes in V2:
-- replaced upper case with lower case at hbr3_hbr2 table

Changes in v3:
-- replace space with tab at hbr3_hbr2 table

[...]

Here is the summary with links:
- [v3] phy: qcom-qmp: add hbr3_hbr2 voltage and premphasis swing table

    https://git.kernel.org/qcom/c/3f2ec77c954c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html