summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2011-10-31 22:25:40 +0100
committerFelipe Balbi <balbi@ti.com>2011-12-12 10:48:26 +0100
commit3140e8cbfec18ecb9c9ef856933fdb98c09af1e8 (patch)
treec4aad9489eabb168e4bf3eaa5006194286a2a158 /drivers/usb/dwc3/gadget.c
parentusb: dwc3: ep0: don't use ep0in for transfers (diff)
downloadlinux-3140e8cbfec18ecb9c9ef856933fdb98c09af1e8.tar.xz
linux-3140e8cbfec18ecb9c9ef856933fdb98c09af1e8.zip
usb: dwc3: use a helper function for operation mode setting
There are two where need to set operational mode: - during initialization while we decide to run in host,device or DRD mode - at runtime via the debugfs interface. This patch provides a new function which sets the operational mode and moves its initialiation to the mode switch instead in the gadget code itself. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to '')
-rw-r--r--drivers/usb/dwc3/gadget.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index b84418e88774..fab4ee0082e2 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1158,9 +1158,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,
reg = dwc3_readl(dwc->regs, DWC3_GCTL);
reg &= ~DWC3_GCTL_SCALEDOWN(3);
- reg &= ~DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG);
reg &= ~DWC3_GCTL_DISSCRAMBLE;
- reg |= DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_DEVICE);
switch (DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams0)) {
case DWC3_GHWPARAMS1_EN_PWROPT_CLK: