]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
usb: dwc2: disable platform lowlevel hw resources during shutdown
authorJisheng Zhang <jszhang@kernel.org>
Sun, 29 Jun 2025 09:46:55 +0000 (17:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Jun 2025 13:42:36 +0000 (15:42 +0200)
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.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Acked-by: Minas Harutyunyan <hminas@synopsys.com>
Link: https://lore.kernel.org/r/20250629094655.747-1-jszhang@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/platform.c

index 12b4dc07d08a47fe8ecf47d158b46b9bf63da18c..3f83ecc9fc236e11aac22e3bd81586cebaed5781 100644 (file)
@@ -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);
 }
 
 /**