diff options
Diffstat (limited to 'drivers/usb/dwc2/hcd.c')
-rw-r--r-- | drivers/usb/dwc2/hcd.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 2192a2873c7c..4c78a390c958 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
@@ -5587,3 +5587,22 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, | |||
5587 | dev_dbg(hsotg->dev, "Host hibernation restore complete\n"); | 5587 | dev_dbg(hsotg->dev, "Host hibernation restore complete\n"); |
5588 | return ret; | 5588 | return ret; |
5589 | } | 5589 | } |
5590 | |||
5591 | bool dwc2_host_can_poweroff_phy(struct dwc2_hsotg *dwc2) | ||
5592 | { | ||
5593 | struct usb_device *root_hub = dwc2_hsotg_to_hcd(dwc2)->self.root_hub; | ||
5594 | |||
5595 | /* If the controller isn't allowed to wakeup then we can power off. */ | ||
5596 | if (!device_may_wakeup(dwc2->dev)) | ||
5597 | return true; | ||
5598 | |||
5599 | /* | ||
5600 | * We don't want to power off the PHY if something under the | ||
5601 | * root hub has wakeup enabled. | ||
5602 | */ | ||
5603 | if (usb_wakeup_enabled_descendants(root_hub)) | ||
5604 | return false; | ||
5605 | |||
5606 | /* No reason to keep the PHY powered, so allow poweroff */ | ||
5607 | return true; | ||
5608 | } | ||