summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/debugfs.c
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2017-04-04 12:49:18 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-04-11 10:58:30 +0300
commit41ce1456e1dbbc7355d0fcc10cf7c337c13def24 (patch)
treef5e52d7040ff415c60dceb757f598b5dc2330883 /drivers/usb/dwc3/debugfs.c
parentb202c42cbf812070ae1d47209d12512226d1d8a5 (diff)
usb: dwc3: core: make dwc3_set_mode() work properly
We can't have both Host and Peripheral roles active at the same time because of one detail on DWC3: it shares the same memory area for both Host and Peripheral registers. When swapping roles we must reinitialize the new role every time. Let's make sure this works for our debugfs interface. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/debugfs.c')
-rw-r--r--drivers/usb/dwc3/debugfs.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index e72f2634e493..7be963dd8e3b 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -319,7 +319,6 @@ static ssize_t dwc3_mode_write(struct file *file,
{
struct seq_file *s = file->private_data;
struct dwc3 *dwc = s->private;
- unsigned long flags;
u32 mode = 0;
char buf[32];
@@ -335,11 +334,8 @@ static ssize_t dwc3_mode_write(struct file *file,
if (!strncmp(buf, "otg", 3))
mode = DWC3_GCTL_PRTCAP_OTG;
- if (mode) {
- spin_lock_irqsave(&dwc->lock, flags);
- dwc3_set_mode(dwc, mode);
- spin_unlock_irqrestore(&dwc->lock, flags);
- }
+ dwc3_set_mode(dwc, mode);
+
return count;
}