diff options
author | Roger Quadros <rogerq@ti.com> | 2017-04-04 12:49:18 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-04-11 10:58:30 +0300 |
commit | 41ce1456e1dbbc7355d0fcc10cf7c337c13def24 (patch) | |
tree | f5e52d7040ff415c60dceb757f598b5dc2330883 /drivers/usb/dwc3/debugfs.c | |
parent | b202c42cbf812070ae1d47209d12512226d1d8a5 (diff) | |
download | lwn-41ce1456e1dbbc7355d0fcc10cf7c337c13def24.tar.gz lwn-41ce1456e1dbbc7355d0fcc10cf7c337c13def24.zip |
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.c | 8 |
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; } |