Skip to content

Commit 8becf91

Browse files
StefanoRadaelliGitvinodkoul
authored andcommitted
phy: fsl-imx8mq-usb: Clear the PCS_TX_SWING_FULL field before using it
Clear the PCS_TX_SWING_FULL field mask before setting the new value in PHY_CTRL5 register. Without clearing the mask first, the OR operation could leave previously set bits, resulting in incorrect register configuration. Fixes: 63c85ad ("phy: fsl-imx8mp-usb: add support for phy tuning") Suggested-by: Leonid Segal <leonids@variscite.com> Acked-by: Pierluigi Passaro <pierluigi.p@variscite.com> Signed-off-by: Stefano Radaelli <stefano.r@variscite.com> Reviewed-by: Xu Yang <xu.yang_2@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://patch.msgid.link/20251219160912.561431-1-stefano.r@variscite.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 393e132 commit 8becf91

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/phy/freescale/phy-fsl-imx8mq-usb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ static void imx8m_phy_tune(struct imx8mq_usb_phy *imx_phy)
490490

491491
if (imx_phy->pcs_tx_swing_full != PHY_TUNE_DEFAULT) {
492492
value = readl(imx_phy->base + PHY_CTRL5);
493+
value &= ~PHY_CTRL5_PCS_TX_SWING_FULL_MASK;
493494
value |= FIELD_PREP(PHY_CTRL5_PCS_TX_SWING_FULL_MASK,
494495
imx_phy->pcs_tx_swing_full);
495496
writel(value, imx_phy->base + PHY_CTRL5);

0 commit comments

Comments
 (0)