Commit ab2a92e7 authored by Felipe Balbi's avatar Felipe Balbi

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
...@@ -258,11 +258,13 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd, ...@@ -258,11 +258,13 @@ 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 * We will also set SUSPHY bit to what it was before returning as stated
* by the same section on Synopsys databook. * by the same section on Synopsys databook.
*/ */
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); if (dwc->gadget.speed <= USB_SPEED_HIGH) {
if (unlikely(reg & DWC3_GUSB2PHYCFG_SUSPHY)) { reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
susphy = true; if (unlikely(reg & DWC3_GUSB2PHYCFG_SUSPHY)) {
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; susphy = true;
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
}
} }
if (cmd == DWC3_DEPCMD_STARTTRANSFER) { if (cmd == DWC3_DEPCMD_STARTTRANSFER) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment