Skip to contentSkip to conversation

usb: dwc2: disable platform lowlevel hw resources during shutdown

PATCH In review Jisheng Zhang 2 participants 2 messages Jun 29, 2025 – Jun 30, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc2: disable platform lowlevel hw resources during shutdown

On some SoC platforms, in shutdown stage, most components' power is cut off, but there's still power supply to the so called always-on domain, so if the dwc2's regulator is from the always-on domain, we need to explicitly disable it to save power.

Disable platform lowlevel hw resources such as phy, clock and regulators etc. in device shutdown hook to reduce non-necessary power consumption when the platform enters shutdown stage.

---
 drivers/usb/dwc2/platform.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/dwc2/platform.c +3 -0
index 12b4dc07d08a..3f83ecc9fc23 100644
@@ -371,6 +371,9 @@ static void dwc2_driver_shutdown(struct platform_device *dev)
 
 	dwc2_disable_global_interrupts(hsotg);
 	synchronize_irq(hsotg->irq);
+
+	if (hsotg->ll_hw_enabled)
+		dwc2_lowlevel_hw_disable(hsotg);
 }
 
 /**
Signature · 1 line
2.49.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jisheng Zhang

On some SoC platforms, in shutdown stage, most components' power is cut off, but there's still power supply to the so called always-on domain, so if the dwc2's regulator is from the always-on domain, we need to explicitly disable it to save power.

Disable platform lowlevel hw resources such as phy, clock and regulators etc. in device shutdown hook to reduce non-necessary power consumption when the platform enters shutdown stage.

Quoted 18 lines
---
  drivers/usb/dwc2/platform.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/usb/dwc2/platform.c +3 -0
index 12b4dc07d08a..3f83ecc9fc23 100644
@@ -371,6 +371,9 @@ static void dwc2_driver_shutdown(struct platform_device *dev)
 
  	dwc2_disable_global_interrupts(hsotg);
  	synchronize_irq(hsotg->irq);
+
+	if (hsotg->ll_hw_enabled)
+		dwc2_lowlevel_hw_disable(hsotg);
  }
 
  /**