Commit 755d0eff authored by Artur Petrosyan's avatar Artur Petrosyan Committed by Greg Kroah-Hartman
Browse files

usb: dwc2: Add hibernation entering flow by system suspend

parent c3595df7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -4387,6 +4387,16 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
		clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
		break;
	case DWC2_POWER_DOWN_PARAM_HIBERNATION:
		/* Enter hibernation */
		spin_unlock_irqrestore(&hsotg->lock, flags);
		ret = dwc2_enter_hibernation(hsotg, 1);
		if (ret)
			dev_err(hsotg->dev, "enter hibernation failed\n");
		spin_lock_irqsave(&hsotg->lock, flags);

		/* After entering suspend, hardware is not accessible */
		clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
		break;
	case DWC2_POWER_DOWN_PARAM_NONE:
		/*
		 * If not hibernation nor partial power down are supported,