Commit 8becf917 authored by Stefano Radaelli's avatar Stefano Radaelli Committed by Vinod Koul
Browse files

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: 63c85ad0 ("phy: fsl-imx8mp-usb: add support for phy tuning")
Suggested-by: default avatarLeonid Segal <leonids@variscite.com>
Acked-by: default avatarPierluigi Passaro <pierluigi.p@variscite.com>
Signed-off-by: default avatarStefano Radaelli <stefano.r@variscite.com>
Reviewed-by: default avatarXu Yang <xu.yang_2@nxp.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Reviewed-by: default avatarFabio Estevam <festevam@gmail.com>
Reviewed-by: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
Link: https://patch.msgid.link/20251219160912.561431-1-stefano.r@variscite.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 393e132e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -490,6 +490,7 @@ static void imx8m_phy_tune(struct imx8mq_usb_phy *imx_phy)

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