- Added backup of DCFG register. - Added Set the Power-On Programming done bit. Signed-off-by: Artur Petrosyan <arturp@xxxxxxxxxxxx> --- drivers/usb/dwc2/gadget.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 6812a8a3a98b..dcb0fbb8bc42 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -5004,6 +5004,7 @@ int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup) { struct dwc2_dregs_backup *dr; int i; + u32 dctl; dev_dbg(hsotg->dev, "%s\n", __func__); @@ -5019,6 +5020,15 @@ int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup) if (!remote_wakeup) dwc2_writel(hsotg, dr->dctl, DCTL); + if (hsotg->params.power_down == DWC2_POWER_DOWN_PARAM_PARTIAL) { + dwc2_writel(hsotg, dr->dcfg, DCFG); + + /* Set the Power-On Programming done bit */ + dctl = dwc2_readl(hsotg, DCTL); + dctl |= DCTL_PWRONPRGDONE; + dwc2_writel(hsotg, dctl, DCTL); + } + dwc2_writel(hsotg, dr->daintmsk, DAINTMSK); dwc2_writel(hsotg, dr->diepmsk, DIEPMSK); dwc2_writel(hsotg, dr->doepmsk, DOEPMSK); -- 2.11.0