Skip to content

Commit 027d16b

Browse files
lumagvinodkoul
authored andcommitted
phy: qcom-qmp-pcie: rework regs layout arrays
Use symbolic names for the values inside reg layout arrays. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20221110192248.873973-4-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent d94b1d0 commit 027d16b

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,24 @@ enum qphy_reg_layout {
7575
};
7676

7777
static const unsigned int ipq_pciephy_gen3_regs_layout[QPHY_LAYOUT_SIZE] = {
78-
[QPHY_SW_RESET] = 0x00,
79-
[QPHY_START_CTRL] = 0x44,
80-
[QPHY_PCS_STATUS] = 0x14,
81-
[QPHY_PCS_POWER_DOWN_CONTROL] = 0x40,
78+
[QPHY_SW_RESET] = QPHY_V4_PCS_SW_RESET,
79+
[QPHY_START_CTRL] = QPHY_V4_PCS_START_CONTROL,
80+
[QPHY_PCS_STATUS] = QPHY_V4_PCS_PCS_STATUS1,
81+
[QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V4_PCS_POWER_DOWN_CONTROL,
8282
};
8383

8484
static const unsigned int pciephy_regs_layout[QPHY_LAYOUT_SIZE] = {
85-
[QPHY_SW_RESET] = 0x00,
86-
[QPHY_START_CTRL] = 0x08,
87-
[QPHY_PCS_STATUS] = 0x174,
88-
[QPHY_PCS_POWER_DOWN_CONTROL] = 0x04,
85+
[QPHY_SW_RESET] = QPHY_V2_PCS_SW_RESET,
86+
[QPHY_START_CTRL] = QPHY_V2_PCS_START_CONTROL,
87+
[QPHY_PCS_STATUS] = QPHY_V2_PCS_PCI_PCS_STATUS,
88+
[QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V2_PCS_POWER_DOWN_CONTROL,
8989
};
9090

9191
static const unsigned int sdm845_qmp_pciephy_regs_layout[QPHY_LAYOUT_SIZE] = {
92-
[QPHY_SW_RESET] = 0x00,
93-
[QPHY_START_CTRL] = 0x08,
94-
[QPHY_PCS_STATUS] = 0x174,
95-
[QPHY_PCS_POWER_DOWN_CONTROL] = 0x04,
92+
[QPHY_SW_RESET] = QPHY_V3_PCS_SW_RESET,
93+
[QPHY_START_CTRL] = QPHY_V3_PCS_START_CONTROL,
94+
[QPHY_PCS_STATUS] = QPHY_V3_PCS_PCS_STATUS,
95+
[QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V3_PCS_POWER_DOWN_CONTROL,
9696
};
9797

9898
static const unsigned int sdm845_qhp_pciephy_regs_layout[QPHY_LAYOUT_SIZE] = {
@@ -103,10 +103,10 @@ static const unsigned int sdm845_qhp_pciephy_regs_layout[QPHY_LAYOUT_SIZE] = {
103103
};
104104

105105
static const unsigned int sm8250_pcie_regs_layout[QPHY_LAYOUT_SIZE] = {
106-
[QPHY_SW_RESET] = 0x00,
107-
[QPHY_START_CTRL] = 0x44,
108-
[QPHY_PCS_STATUS] = 0x14,
109-
[QPHY_PCS_POWER_DOWN_CONTROL] = 0x40,
106+
[QPHY_SW_RESET] = QPHY_V4_PCS_SW_RESET,
107+
[QPHY_START_CTRL] = QPHY_V4_PCS_START_CONTROL,
108+
[QPHY_PCS_STATUS] = QPHY_V4_PCS_PCS_STATUS1,
109+
[QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V4_PCS_POWER_DOWN_CONTROL,
110110
};
111111

112112
static const struct qmp_phy_init_tbl msm8998_pcie_serdes_tbl[] = {

drivers/phy/qualcomm/phy-qcom-qmp-pcs-v2.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#define QCOM_PHY_QMP_PCS_V2_H_
88

99
/* Only for QMP V2 PHY - PCS registers */
10+
#define QPHY_V2_PCS_SW_RESET 0x000
1011
#define QPHY_V2_PCS_POWER_DOWN_CONTROL 0x004
12+
#define QPHY_V2_PCS_START_CONTROL 0x008
1113
#define QPHY_V2_PCS_TXDEEMPH_M6DB_V0 0x024
1214
#define QPHY_V2_PCS_TXDEEMPH_M3P5DB_V0 0x028
1315
#define QPHY_V2_PCS_TX_LARGE_AMP_DRV_LVL 0x034
@@ -43,4 +45,6 @@
4345
#define QPHY_V2_PCS_L1SS_WAKEUP_DLY_TIME_AUXCLK_LSB 0x1dc
4446
#define QPHY_V2_PCS_L1SS_WAKEUP_DLY_TIME_AUXCLK_MSB 0x1e0
4547

48+
#define QPHY_V2_PCS_PCI_PCS_STATUS 0x174 /* PCI */
49+
4650
#endif

0 commit comments

Comments
 (0)