Skip to content

Commit 5abed58

Browse files
bebarinovinodkoul
authored andcommitted
phy: qcom: qmp-combo: Fix VCO div offset on v3
Commit ec17373 ("phy: qcom: qmp-combo: extract common function to setup clocks") changed the offset that is used to write to DP_PHY_VCO_DIV from QSERDES_V3_DP_PHY_VCO_DIV to QSERDES_V4_DP_PHY_VCO_DIV. Unfortunately, this offset is different between v3 and v4 phys: #define QSERDES_V3_DP_PHY_VCO_DIV 0x064 #define QSERDES_V4_DP_PHY_VCO_DIV 0x070 meaning that we write the wrong register on v3 phys now. Add another generic register to 'regs' and use it here instead of a version specific define to fix this. This was discovered after Abhinav looked over register dumps with me from sc7180 Trogdor devices that started failing to light up the external display with v6.6 based kernels. It turns out that some monitors are very specific about their link clk frequency and if the default power on reset value is still there the monitor will show a blank screen or a garbled display. Other monitors are perfectly happy to get a bad clock signal. Cc: Douglas Anderson <[email protected]> Cc: Abhinav Kumar <[email protected]> Cc: Dmitry Baryshkov <[email protected]> Fixes: ec17373 ("phy: qcom: qmp-combo: extract common function to setup clocks") Signed-off-by: Stephen Boyd <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent d16d400 commit 5abed58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/phy/qualcomm/phy-qcom-qmp-combo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ enum qphy_reg_layout {
7777
QPHY_COM_BIAS_EN_CLKBUFLR_EN,
7878

7979
QPHY_DP_PHY_STATUS,
80+
QPHY_DP_PHY_VCO_DIV,
8081

8182
QPHY_TX_TX_POL_INV,
8283
QPHY_TX_TX_DRV_LVL,
@@ -102,6 +103,7 @@ static const unsigned int qmp_v3_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = {
102103
[QPHY_COM_BIAS_EN_CLKBUFLR_EN] = QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN,
103104

104105
[QPHY_DP_PHY_STATUS] = QSERDES_V3_DP_PHY_STATUS,
106+
[QPHY_DP_PHY_VCO_DIV] = QSERDES_V3_DP_PHY_VCO_DIV,
105107

106108
[QPHY_TX_TX_POL_INV] = QSERDES_V3_TX_TX_POL_INV,
107109
[QPHY_TX_TX_DRV_LVL] = QSERDES_V3_TX_TX_DRV_LVL,
@@ -126,6 +128,7 @@ static const unsigned int qmp_v45_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = {
126128
[QPHY_COM_BIAS_EN_CLKBUFLR_EN] = QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN,
127129

128130
[QPHY_DP_PHY_STATUS] = QSERDES_V4_DP_PHY_STATUS,
131+
[QPHY_DP_PHY_VCO_DIV] = QSERDES_V4_DP_PHY_VCO_DIV,
129132

130133
[QPHY_TX_TX_POL_INV] = QSERDES_V4_TX_TX_POL_INV,
131134
[QPHY_TX_TX_DRV_LVL] = QSERDES_V4_TX_TX_DRV_LVL,
@@ -2162,6 +2165,7 @@ static int qmp_combo_configure_dp_clocks(struct qmp_combo *qmp)
21622165
const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts;
21632166
u32 phy_vco_div;
21642167
unsigned long pixel_freq;
2168+
const struct qmp_phy_cfg *cfg = qmp->cfg;
21652169

21662170
switch (dp_opts->link_rate) {
21672171
case 1620:
@@ -2184,7 +2188,7 @@ static int qmp_combo_configure_dp_clocks(struct qmp_combo *qmp)
21842188
/* Other link rates aren't supported */
21852189
return -EINVAL;
21862190
}
2187-
writel(phy_vco_div, qmp->dp_dp_phy + QSERDES_V4_DP_PHY_VCO_DIV);
2191+
writel(phy_vco_div, qmp->dp_dp_phy + cfg->regs[QPHY_DP_PHY_VCO_DIV]);
21882192

21892193
clk_set_rate(qmp->dp_link_hw.clk, dp_opts->link_rate * 100000);
21902194
clk_set_rate(qmp->dp_pixel_hw.clk, pixel_freq);

0 commit comments

Comments
 (0)