Skip to content

Commit 112c237

Browse files
konradybciovinodkoul
authored andcommitted
phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1
There are two instances of the POWER_STATE_CONFIG1 register: one in the PCS space and another one in PCS_USB. The downstream init sequence pokes the latter one while we've been poking the former one (and misnamed it as the latter one, impostor!). Fix that up to avoid UB. Fixes: 49742e9 ("phy: qcom-qmp-combo: Add support for SM8550") Reviewed-by: Abel Vesa <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent ecec1de commit 112c237

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,10 @@ static const struct qmp_phy_init_tbl sm8550_usb3_pcs_tbl[] = {
859859
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_PCS_TX_RX_CONFIG, 0x0c),
860860
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG1, 0x4b),
861861
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG5, 0x10),
862-
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
863862
};
864863

865864
static const struct qmp_phy_init_tbl sm8550_usb3_pcs_usb_tbl[] = {
865+
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
866866
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
867867
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
868868
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L, 0x40),

drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG3 0xcc
1313
#define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG6 0xd8
1414
#define QPHY_USB_V6_PCS_REFGEN_REQ_CONFIG1 0xdc
15-
#define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x90
15+
#define QPHY_USB_V6_PCS_POWER_STATE_CONFIG1 0x90
1616
#define QPHY_USB_V6_PCS_RX_SIGDET_LVL 0x188
1717
#define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_L 0x190
1818
#define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_H 0x194
@@ -23,6 +23,7 @@
2323
#define QPHY_USB_V6_PCS_EQ_CONFIG1 0x1dc
2424
#define QPHY_USB_V6_PCS_EQ_CONFIG5 0x1ec
2525

26+
#define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x00
2627
#define QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL 0x18
2728
#define QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 0x3c
2829
#define QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40

0 commit comments

Comments
 (0)