Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354602
b: refs/heads/master
c: 2b75835
h: refs/heads/master
v: v3
  • Loading branch information
Pratyush Anand authored and Felipe Balbi committed Jan 18, 2013
1 parent fe84c23 commit 0eddbc8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d7668024b3b5f9563eab8dad66cb9a4b80f36ebf
refs/heads/master: 2b758350af19db9a5c98241cf222c2e211d7a912
31 changes: 18 additions & 13 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,23 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
break;
}

/* Enable USB2 LPM Capability */

if ((dwc->revision > DWC3_REVISION_194A)
&& (speed != DWC3_DCFG_SUPERSPEED)) {
reg = dwc3_readl(dwc->regs, DWC3_DCFG);
reg |= DWC3_DCFG_LPM_CAP;
dwc3_writel(dwc->regs, DWC3_DCFG, reg);

reg = dwc3_readl(dwc->regs, DWC3_DCTL);
reg &= ~(DWC3_DCTL_HIRD_THRES_MASK | DWC3_DCTL_L1_HIBER_EN);

/* TODO: This should be configurable */
reg |= DWC3_DCTL_HIRD_THRES(28);

dwc3_writel(dwc->regs, DWC3_DCTL, reg);
}

/* Recent versions support automatic phy suspend and don't need this */
if (dwc->revision < DWC3_REVISION_194A) {
/* Suspend unneeded PHY */
Expand Down Expand Up @@ -2460,20 +2477,8 @@ int dwc3_gadget_init(struct dwc3 *dwc)
DWC3_DEVTEN_DISCONNEVTEN);
dwc3_writel(dwc->regs, DWC3_DEVTEN, reg);

/* Enable USB2 LPM and automatic phy suspend only on recent versions */
/* automatic phy suspend only on recent versions */
if (dwc->revision >= DWC3_REVISION_194A) {
reg = dwc3_readl(dwc->regs, DWC3_DCFG);
reg |= DWC3_DCFG_LPM_CAP;
dwc3_writel(dwc->regs, DWC3_DCFG, reg);

reg = dwc3_readl(dwc->regs, DWC3_DCTL);
reg &= ~(DWC3_DCTL_HIRD_THRES_MASK | DWC3_DCTL_L1_HIBER_EN);

/* TODO: This should be configurable */
reg |= DWC3_DCTL_HIRD_THRES(28);

dwc3_writel(dwc->regs, DWC3_DCTL, reg);

dwc3_gadget_usb2_phy_suspend(dwc, false);
dwc3_gadget_usb3_phy_suspend(dwc, false);
}
Expand Down

0 comments on commit 0eddbc8

Please sign in to comment.