phy: qcom: qmp-combo: fix Display Port PHY configuration for SM8550
authorNeil Armstrong <neil.armstrong@linaro.org>
Thu, 1 Jun 2023 09:39:58 +0000 (11:39 +0200)
committerVinod Koul <vkoul@kernel.org>
Wed, 21 Jun 2023 12:16:35 +0000 (17:46 +0530)
The SM8550 PHY also uses a different offset for the CMN_STATUS reg,
use the right one for the v6 Display Port configuration.

Fixes: 49742e9edab3 ("phy: qcom-qmp-combo: Add support for SM8550")
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230601-topic-sm8550-upstream-dp-phy-init-fix-v1-1-4e9da9f97991@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-qmp-combo.c

index 33cc99d..bebce8c 100644 (file)
@@ -2151,6 +2151,7 @@ static void qmp_v4_configure_dp_tx(struct qmp_combo *qmp)
 static int qmp_v456_configure_dp_phy(struct qmp_combo *qmp,
                                     unsigned int com_resetm_ctrl_reg,
                                     unsigned int com_c_ready_status_reg,
+                                    unsigned int com_cmn_status_reg,
                                     unsigned int dp_phy_status_reg)
 {
        const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts;
@@ -2207,14 +2208,14 @@ static int qmp_v456_configure_dp_phy(struct qmp_combo *qmp,
                        10000))
                return -ETIMEDOUT;
 
-       if (readl_poll_timeout(qmp->dp_serdes + QSERDES_V4_COM_CMN_STATUS,
+       if (readl_poll_timeout(qmp->dp_serdes + com_cmn_status_reg,
                        status,
                        ((status & BIT(0)) > 0),
                        500,
                        10000))
                return -ETIMEDOUT;
 
-       if (readl_poll_timeout(qmp->dp_serdes + QSERDES_V4_COM_CMN_STATUS,
+       if (readl_poll_timeout(qmp->dp_serdes + com_cmn_status_reg,
                        status,
                        ((status & BIT(1)) > 0),
                        500,
@@ -2250,6 +2251,7 @@ static int qmp_v4_configure_dp_phy(struct qmp_combo *qmp)
 
        ret = qmp_v456_configure_dp_phy(qmp, QSERDES_V4_COM_RESETSM_CNTRL,
                                        QSERDES_V4_COM_C_READY_STATUS,
+                                       QSERDES_V4_COM_CMN_STATUS,
                                        QSERDES_V4_DP_PHY_STATUS);
        if (ret < 0)
                return ret;
@@ -2314,6 +2316,7 @@ static int qmp_v5_configure_dp_phy(struct qmp_combo *qmp)
 
        ret = qmp_v456_configure_dp_phy(qmp, QSERDES_V4_COM_RESETSM_CNTRL,
                                        QSERDES_V4_COM_C_READY_STATUS,
+                                       QSERDES_V4_COM_CMN_STATUS,
                                        QSERDES_V4_DP_PHY_STATUS);
        if (ret < 0)
                return ret;
@@ -2373,6 +2376,7 @@ static int qmp_v6_configure_dp_phy(struct qmp_combo *qmp)
 
        ret = qmp_v456_configure_dp_phy(qmp, QSERDES_V6_COM_RESETSM_CNTRL,
                                        QSERDES_V6_COM_C_READY_STATUS,
+                                       QSERDES_V6_COM_CMN_STATUS,
                                        QSERDES_V6_DP_PHY_STATUS);
        if (ret < 0)
                return ret;