Commit cbe1e903 authored by Artur Petrosyan's avatar Artur Petrosyan Committed by Greg Kroah-Hartman

usb: dwc2: Allow entering clock gating from USB_SUSPEND interrupt

If core doesn't support hibernation or partial power
down power saving options, power can still be saved
using clock gating on all the clocks.

- Added entering clock gating state from USB_SUSPEND
  interrupt.
Acked-by: default avatarMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: default avatarArtur Petrosyan <Arthur.Petrosyan@synopsys.com>
Link: https://lore.kernel.org/r/20210413073623.65355A022E@mailhost.synopsys.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 79c87c3c
......@@ -529,14 +529,18 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
/* Ask phy to be suspended */
if (!IS_ERR_OR_NULL(hsotg->uphy))
usb_phy_set_suspend(hsotg->uphy, true);
}
if (hsotg->hw_params.hibernation) {
} else if (hsotg->hw_params.hibernation) {
ret = dwc2_enter_hibernation(hsotg, 0);
if (ret && ret != -ENOTSUPP)
dev_err(hsotg->dev,
"%s: enter hibernation failed\n",
__func__);
} else {
/*
* If not hibernation nor partial power down are supported,
* clock gating is used to save power.
*/
dwc2_gadget_enter_clock_gating(hsotg);
}
skip_power_saving:
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment