[PATCH v17 7/7] phy: rockchip: usbdp: Add DP lane setup to power state update
From: Sebastian Reichel
Date: Fri Nov 13 2026 - 21:01:50 EST
DP lane map and AUX orientation are only configured in the DP PHY
power_on callback right now. This means when the DP controller keeps
the display enabled after a cable is unplugged, it will not come back
properly with the cable re-plugged in swapped orientation.
To fix the issue, we update the DP lane mux configuration in the power
state update. This gets some special handling, because calling
rk_udphy_dp_lane_select() accesses the VOGRF which needs the DP
controller's power domain enabled. It is active while the DP controller
has the PHY powered on.
Apart from that VOGRF may lose its state when the DP controller is
disabled, so we keep the DP PHY power hook as-is instead of fully
relying on the power state update function.
Reported-by: Yury Smirnov <yurymonzon@xxxxxxxxx>
Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index 553b88c45108..d4a46078d049 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1108,6 +1108,13 @@ static int rk_udphy_update_power_state(struct rk_udphy *udphy)
}
}
+ /* Setup DP lanes and the AUX polarity */
+ if ((target_mode & UDPHY_MODE_DP) && (udphy->sw_mode & UDPHY_MODE_DP)) {
+ phy_set_bus_width(udphy->phy_dp, udphy->dp_lanes);
+ rk_udphy_dp_lane_enable(udphy, udphy->dp_lanes);
+ rk_udphy_dp_lane_select(udphy);
+ }
+
/* Ensure USB3 support is enabled when supported */
if (udphy->sw_mode & UDPHY_MODE_USB)
rk_udphy_u3_port_disable(udphy, !usb3_port_enable);
--
2.53.0