usb: dwc3: core: Add shutdown support

The RK3576 platform doesn't use the dwc3 glue layer
which supports to call dwc3_of_simple_shutdown and
dwc3_remove on system shutdown. Therefore, the RK3576
dwc3 controller still keeps working on system shutdown,
and it may cause pending usb irq if usb transmission
happens when do reboot test.

This patch adds shutdown support for RK3576 platform.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I2cc0764402909fc8c168c0bad75909a8719fce80
This commit is contained in:
William Wu
2024-11-15 15:09:26 +08:00
committed by Tao Huang
parent 21226ba125
commit 1c7a3dd86f

View File

@@ -2143,6 +2143,14 @@ static int dwc3_remove(struct platform_device *pdev)
return 0;
}
static void dwc3_shutdown(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
if (of_device_is_compatible(dev->of_node, "rockchip,rk3576-dwc3"))
dwc3_remove(pdev);
}
#ifdef CONFIG_PM
static int dwc3_core_init_for_resume(struct dwc3 *dwc)
{
@@ -2455,6 +2463,7 @@ MODULE_DEVICE_TABLE(acpi, dwc3_acpi_match);
static struct platform_driver dwc3_driver = {
.probe = dwc3_probe,
.remove = dwc3_remove,
.shutdown = dwc3_shutdown,
.driver = {
.name = "dwc3",
.of_match_table = of_match_ptr(of_dwc3_match),