phy: qcom-qmp-pcie-msm8996: clean up ready and status polling
authorJohan Hovold <johan+linaro@kernel.org>
Wed, 12 Oct 2022 08:49:48 +0000 (10:49 +0200)
committerVinod Koul <vkoul@kernel.org>
Fri, 28 Oct 2022 12:25:04 +0000 (17:55 +0530)
Clean up the PHY ready and status polling by dropping the configuration
masks which are no longer needed since the QMP driver split.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20221012085002.24099-6-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c

index 899be7b..b9260c8 100644 (file)
@@ -35,7 +35,6 @@
 #define PLL_READY_GATE_EN                      BIT(3)
 /* QPHY_PCS_STATUS bit */
 #define PHYSTATUS                              BIT(6)
-#define PHYSTATUS_4_20                         BIT(7)
 /* QPHY_COM_PCS_READY_STATUS bit */
 #define PCS_READY                              BIT(0)
 
@@ -200,9 +199,6 @@ struct qmp_phy_cfg {
 
        unsigned int start_ctrl;
        unsigned int pwrdn_ctrl;
-       unsigned int mask_com_pcs_ready;
-       /* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */
-       unsigned int phy_status;
 };
 
 /**
@@ -318,8 +314,6 @@ static const struct qmp_phy_cfg msm8996_pciephy_cfg = {
 
        .start_ctrl             = PCS_START | PLL_READY_GATE_EN,
        .pwrdn_ctrl             = SW_PWRDN | REFCLK_DRV_DSBL,
-       .mask_com_pcs_ready     = PCS_READY,
-       .phy_status             = PHYSTATUS,
 };
 
 static void qmp_pcie_msm8996_configure_lane(void __iomem *base,
@@ -356,7 +350,7 @@ static int qmp_pcie_msm8996_serdes_init(struct qmp_phy *qphy)
        const struct qmp_phy_init_tbl *serdes_tbl = cfg->serdes_tbl;
        int serdes_tbl_num = cfg->serdes_tbl_num;
        void __iomem *status;
-       unsigned int mask, val;
+       unsigned int val;
        int ret;
 
        qmp_pcie_msm8996_configure(serdes, serdes_tbl, serdes_tbl_num);
@@ -366,9 +360,7 @@ static int qmp_pcie_msm8996_serdes_init(struct qmp_phy *qphy)
                     SERDES_START | PCS_START);
 
        status = serdes + cfg->regs[QPHY_COM_PCS_READY_STATUS];
-       mask = cfg->mask_com_pcs_ready;
-
-       ret = readl_poll_timeout(status, val, (val & mask), 10,
+       ret = readl_poll_timeout(status, val, (val & PCS_READY), 10,
                                 PHY_INIT_COMPLETE_TIMEOUT);
        if (ret) {
                dev_err(qmp->dev,
@@ -484,7 +476,7 @@ static int qmp_pcie_msm8996_power_on(struct phy *phy)
        void __iomem *rx = qphy->rx;
        void __iomem *pcs = qphy->pcs;
        void __iomem *status;
-       unsigned int mask, val, ready;
+       unsigned int val;
        int ret;
 
        qmp_pcie_msm8996_serdes_init(qphy);
@@ -522,10 +514,7 @@ static int qmp_pcie_msm8996_power_on(struct phy *phy)
        qphy_setbits(pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl);
 
        status = pcs + cfg->regs[QPHY_PCS_STATUS];
-       mask = cfg->phy_status;
-       ready = 0;
-
-       ret = readl_poll_timeout(status, val, (val & mask) == ready, 10,
+       ret = readl_poll_timeout(status, val, !(val & PHYSTATUS), 10,
                                 PHY_INIT_COMPLETE_TIMEOUT);
        if (ret) {
                dev_err(qmp->dev, "phy initialization timed-out\n");