From: Jianxin Qin Date: Fri, 4 May 2018 03:39:47 +0000 (+0800) Subject: usb: dwc3: add shutdown function for dwc3 driver X-Git-Tag: khadas-vims-v0.9.6-release~1923 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39234ed727ca1b8457ab33d1ba6ceaf153a97356;p=platform%2Fkernel%2Flinux-amlogic.git usb: dwc3: add shutdown function for dwc3 driver PD#164611: usb: dwc3: add shutdown function for dwc3 driver In suspend mode, we will shutdown the USB controller for reducing more power consumption. Change-Id: Icfc3182fce4f5455397e5f11fd08693f763757b3 Signed-off-by: Jianxin Qin --- diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 7a8c51c5..c7c0907 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1278,6 +1278,17 @@ err0: return ret; } +#ifdef CONFIG_AMLOGIC_USB +void dwc3_shutdown(struct platform_device *pdev) +{ + struct dwc3 *dwc = platform_get_drvdata(pdev); + + dev_dbg(dwc->dev, "%s\n", __func__); + usb_phy_shutdown(dwc->usb2_phy); + usb_phy_shutdown(dwc->usb3_phy); +} +#endif + static int dwc3_remove(struct platform_device *pdev) { struct dwc3 *dwc = platform_get_drvdata(pdev); @@ -1529,6 +1540,9 @@ MODULE_DEVICE_TABLE(acpi, dwc3_acpi_match); static struct platform_driver dwc3_driver = { .probe = dwc3_probe, .remove = dwc3_remove, +#ifdef CONFIG_AMLOGIC_USB + .shutdown = dwc3_shutdown, +#endif .driver = { .name = "dwc3", .of_match_table = of_match_ptr(of_dwc3_match),