[PATCH v4 4/5] phy: rockchip: inno-usb2: move suspend handling into new function
Sebastian Reichel
sebastian.reichel at collabora.com
Mon Nov 9 16:02:49 PST 2026
Move handling of the PHY suspend handling into its own dedicated
function. No functional changes intended.
Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
---
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 38 ++++++++++++++++-----------
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 6b3104901695..642c996d23de 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -321,6 +321,27 @@ rockchip_usb2phy_clk480m_clkout_ctl(struct clk_hw *hw, struct regmap **base,
}
}
+static void rockchip_usb2phy_set_suspend(struct rockchip_usb2phy *rphy,
+ struct rockchip_usb2phy_port *rport,
+ bool do_suspend)
+{
+ property_enable(rphy->grf, &rport->port_cfg->phy_sus, do_suspend);
+
+ if (!do_suspend) {
+ /*
+ * For rk3588, it needs to reset phy when exit from suspend
+ * mode with common_on_n 1'b1(aka REFCLK_LOGIC, Bias, and PLL
+ * blocks are powered down) for lower power consumption. If you
+ * don't want to reset phy, please keep the common_on_n 1'b0 to
+ * set these blocks remain powered.
+ */
+ rockchip_usb2phy_reset(rphy);
+
+ /* waiting for the utmi_clk to become stable */
+ usleep_range(1500, 2000);
+ }
+}
+
static int rockchip_usb2phy_clk480m_prepare(struct clk_hw *hw)
{
const struct usb2phy_reg *clkout_ctl;
@@ -538,20 +559,7 @@ static int rockchip_usb2phy_power_on(struct phy *phy)
if (ret)
return ret;
- property_enable(rphy->grf, &rport->port_cfg->phy_sus, false);
-
- /*
- * For rk3588, it needs to reset phy when exit from
- * suspend mode with common_on_n 1'b1(aka REFCLK_LOGIC,
- * Bias, and PLL blocks are powered down) for lower
- * power consumption. If you don't want to reset phy,
- * please keep the common_on_n 1'b0 to set these blocks
- * remain powered.
- */
- rockchip_usb2phy_reset(rphy);
-
- /* waiting for the utmi_clk to become stable */
- usleep_range(1500, 2000);
+ rockchip_usb2phy_set_suspend(rphy, rport, false);
rport->suspended = false;
return 0;
@@ -567,7 +575,7 @@ static int rockchip_usb2phy_power_off(struct phy *phy)
if (rport->suspended)
return 0;
- property_enable(rphy->grf, &rport->port_cfg->phy_sus, true);
+ rockchip_usb2phy_set_suspend(rphy, rport, true);
rport->suspended = true;
clk_disable_unprepare(rphy->clk480m);
--
2.53.0
More information about the Linux-rockchip
mailing list