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

Commit ab2a92e7 authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: dwc3: gadget: only resume USB2 PHY in <=HIGHSPEED



As a micro-power optimization, let's only resume the
USB2 PHY if we're working on <=HIGHSPEED. If we're
gonna work on SUPERSPEED or SUPERSPEED+, there's no
point in resuming the USB2 PHY.

Fixes: 2b0f11df ("usb: dwc3: gadget: clear SUSPHY bit before ep cmds")
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 3f308d17
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -258,12 +258,14 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
	 * We will also set SUSPHY bit to what it was before returning as stated
	 * by the same section on Synopsys databook.
	 */
	if (dwc->gadget.speed <= USB_SPEED_HIGH) {
		reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
		if (unlikely(reg & DWC3_GUSB2PHYCFG_SUSPHY)) {
			susphy = true;
			reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
			dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
		}
	}

	if (cmd == DWC3_DEPCMD_STARTTRANSFER) {
		int		needs_wakeup;