@@ -4660,6 +4660,21 @@ static int dwc2_hsotg_vbus_draw(struct usb_gadget *gadget, unsigned int mA)
return usb_phy_set_power(hsotg->uphy, mA);
}
+static int dwc2_hsotg_wakeup(struct usb_gadget *gadget)
+{
+ struct dwc2_hsotg *hsotg = to_hsotg(gadget);
+ unsigned long flags;
+
+ spin_lock_irqsave(&hsotg->lock, flags);
+
+ dwc2_set_bit(hsotg, DCTL, DCTL_RMTWKUPSIG);
+ mdelay(10);
+ dwc2_clear_bit(hsotg, DCTL, DCTL_RMTWKUPSIG);
+
+ spin_unlock_irqrestore(&hsotg->lock, flags);
+ return 0;
+}
+
static const struct usb_gadget_ops dwc2_hsotg_gadget_ops = {
.get_frame = dwc2_hsotg_gadget_getframe,
.set_selfpowered = dwc2_hsotg_set_selfpowered,
@@ -4668,6 +4683,7 @@ static const struct usb_gadget_ops dwc2_hsotg_gadget_ops = {
.pullup = dwc2_hsotg_pullup,
.vbus_session = dwc2_hsotg_vbus_session,
.vbus_draw = dwc2_hsotg_vbus_draw,
+ .wakeup = dwc2_hsotg_wakeup,
};
/**