Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77bcb360 authored by Dov Levenglick's avatar Dov Levenglick
Browse files

usb: dwc3: gadget: start resume sequence on remote-wakeup



As per Synopsys databook, the USB controller does not
trigger a wakeup event when remote-wakeup is used.
Hence, after remote-wakeup sequence is complete, and
the device is back at U0 state, it is required that
the resume sequence is initiated manually by SW.

Change-Id: I2f147d4a0644088b948b1798627c7717c35c0104
Signed-off-by: default avatarBar Weiner <bweiner@codeaurora.org>
Signed-off-by: default avatarDov Levenglick <dovl@codeaurora.org>
parent 538c521c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@

static void dwc3_gadget_usb2_phy_suspend(struct dwc3 *dwc, int suspend);
static void dwc3_gadget_usb3_phy_suspend(struct dwc3 *dwc, int suspend);
static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc);

/**
 * dwc3_gadget_set_test_mode - Enables USB2 Test Modes
@@ -1586,6 +1587,14 @@ static int dwc3_gadget_wakeup(struct usb_gadget *g)
		ret = -EINVAL;
	}

	/*
	 * According to DWC3 databook, the controller does not
	 * trigger a wakeup event when remote-wakeup is used.
	 * Hence, after remote-wakeup sequence is complete, and
	 * the device is back at U0 state, it is required that
	 * the resume sequence is initiated by SW.
	 */
	dwc3_gadget_wakeup_interrupt(dwc);
out:
	spin_unlock_irqrestore(&dwc->lock, flags);