diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-09-13 11:54:39 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-04-30 04:31:21 -0400 |
commit | e6a3b5e2888b51e37c65c97dae966f793bc4806a (patch) | |
tree | 934c2a7578d15dedbe2221c28cbdff7afd28588f /drivers/usb/dwc3/gadget.c | |
parent | 51249dca627d9d0e6b41531e716cbc308554a62c (diff) |
usb: dwc3: ep0: add LPM handling
On device loading the driver enables LPM and the acceptance of U1 and U2
states. The [Set|Clear]Feature requests for "U1/U2" are forwarded
directly to the hardware and allow / forbid the initiation of the low
power links.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index dda56b8f8617..906db570ef4f 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
@@ -1933,6 +1933,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) | |||
1933 | 1933 | ||
1934 | reg = dwc3_readl(dwc->regs, DWC3_DCTL); | 1934 | reg = dwc3_readl(dwc->regs, DWC3_DCTL); |
1935 | reg &= ~DWC3_DCTL_TSTCTRL_MASK; | 1935 | reg &= ~DWC3_DCTL_TSTCTRL_MASK; |
1936 | reg &= ~(DWC3_DCTL_INITU1ENA | DWC3_DCTL_INITU2ENA); | ||
1936 | dwc3_writel(dwc->regs, DWC3_DCTL, reg); | 1937 | dwc3_writel(dwc->regs, DWC3_DCTL, reg); |
1937 | dwc->test_mode = false; | 1938 | dwc->test_mode = false; |
1938 | 1939 | ||
@@ -2330,6 +2331,14 @@ int __devinit dwc3_gadget_init(struct dwc3 *dwc) | |||
2330 | goto err5; | 2331 | goto err5; |
2331 | } | 2332 | } |
2332 | 2333 | ||
2334 | reg = dwc3_readl(dwc->regs, DWC3_DCFG); | ||
2335 | reg |= DWC3_DCFG_LPM_CAP; | ||
2336 | dwc3_writel(dwc->regs, DWC3_DCFG, reg); | ||
2337 | |||
2338 | reg = dwc3_readl(dwc->regs, DWC3_DCTL); | ||
2339 | reg |= DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA; | ||
2340 | dwc3_writel(dwc->regs, DWC3_DCTL, reg); | ||
2341 | |||
2333 | /* Enable all but Start and End of Frame IRQs */ | 2342 | /* Enable all but Start and End of Frame IRQs */ |
2334 | reg = (DWC3_DEVTEN_VNDRDEVTSTRCVEDEN | | 2343 | reg = (DWC3_DEVTEN_VNDRDEVTSTRCVEDEN | |
2335 | DWC3_DEVTEN_EVNTOVERFLOWEN | | 2344 | DWC3_DEVTEN_EVNTOVERFLOWEN | |