diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-10-31 17:25:40 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-12-12 04:48:26 -0500 |
commit | 3140e8cbfec18ecb9c9ef856933fdb98c09af1e8 (patch) | |
tree | c4aad9489eabb168e4bf3eaa5006194286a2a158 /drivers/usb/dwc3/gadget.c | |
parent | c2da2ff00606ae008f0e233bd29c3307d0c3ce85 (diff) |
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 'drivers/usb/dwc3/gadget.c')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 2 |
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, | |||
1158 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); | 1158 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); |
1159 | 1159 | ||
1160 | reg &= ~DWC3_GCTL_SCALEDOWN(3); | 1160 | reg &= ~DWC3_GCTL_SCALEDOWN(3); |
1161 | reg &= ~DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG); | ||
1162 | reg &= ~DWC3_GCTL_DISSCRAMBLE; | 1161 | reg &= ~DWC3_GCTL_DISSCRAMBLE; |
1163 | reg |= DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_DEVICE); | ||
1164 | 1162 | ||
1165 | switch (DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams0)) { | 1163 | switch (DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams0)) { |
1166 | case DWC3_GHWPARAMS1_EN_PWROPT_CLK: | 1164 | case DWC3_GHWPARAMS1_EN_PWROPT_CLK: |