summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/hcd.c
diff options
context:
space:
mode:
authorArtur Petrosyan <Arthur.Petrosyan@synopsys.com>2021-04-13 09:37:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-13 12:25:12 +0200
commit50fb0c128b6e8df62200ba85c05ecd6b1396476d (patch)
tree5f58c1ef905cc87ae9a34f5a5f08913b5cf910af /drivers/usb/dwc2/hcd.c
parentusb: dwc2: Allow exit clock gating in urb enqueue (diff)
downloadlinux-50fb0c128b6e8df62200ba85c05ecd6b1396476d.tar.xz
linux-50fb0c128b6e8df62200ba85c05ecd6b1396476d.zip
usb: dwc2: Add clock gating entering flow by system suspend
If not hibernation nor partial power down are supported, clock gating is used to save power. Adds a new flow of entering clock gating when PC is suspended. Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com> Link: https://lore.kernel.org/r/20210413073716.30C13A0094@mailhost.synopsys.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc2/hcd.c')
-rw-r--r--drivers/usb/dwc2/hcd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 31d6a1b87228..09dcd37b9ef8 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -4372,6 +4372,15 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
break;
case DWC2_POWER_DOWN_PARAM_HIBERNATION:
case DWC2_POWER_DOWN_PARAM_NONE:
+ /*
+ * If not hibernation nor partial power down are supported,
+ * clock gating is used to save power.
+ */
+ dwc2_host_enter_clock_gating(hsotg);
+
+ /* After entering suspend, hardware is not accessible */
+ clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+ break;
default:
goto skip_power_saving;
}