diff options
author | George Cherian <george.cherian@ti.com> | 2015-02-12 23:43:24 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-02-23 10:36:34 -0500 |
commit | 96e5d31244c5542f5b2ea81d76f14ba4b8a7d440 (patch) | |
tree | 4f3e02b8104dc6d3f460bd0990bd7ddaf3bbcdbf | |
parent | 1f754ef10350681f3dc1980d357e77487d308c52 (diff) |
usb: dwc3: dwc3-omap: Fix disable IRQ
In the wrapper the IRQ disable should be done by writing 1's to the
IRQ*_CLR register. Existing code is broken because it instead writes
zeros to IRQ*_SET register.
Fix this by adding functions dwc3_omap_write_irqmisc_clr() and
dwc3_omap_write_irq0_clr() which do the right thing.
Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
Cc: <stable@vger.kernel.org> # v3.2+
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/dwc3/dwc3-omap.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 172d64e585b6..52e0c4e5e48e 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c | |||
@@ -205,6 +205,18 @@ static void dwc3_omap_write_irq0_set(struct dwc3_omap *omap, u32 value) | |||
205 | omap->irq0_offset, value); | 205 | omap->irq0_offset, value); |
206 | } | 206 | } |
207 | 207 | ||
208 | static void dwc3_omap_write_irqmisc_clr(struct dwc3_omap *omap, u32 value) | ||
209 | { | ||
210 | dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_MISC + | ||
211 | omap->irqmisc_offset, value); | ||
212 | } | ||
213 | |||
214 | static void dwc3_omap_write_irq0_clr(struct dwc3_omap *omap, u32 value) | ||
215 | { | ||
216 | dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_0 - | ||
217 | omap->irq0_offset, value); | ||
218 | } | ||
219 | |||
208 | static void dwc3_omap_set_mailbox(struct dwc3_omap *omap, | 220 | static void dwc3_omap_set_mailbox(struct dwc3_omap *omap, |
209 | enum omap_dwc3_vbus_id_status status) | 221 | enum omap_dwc3_vbus_id_status status) |
210 | { | 222 | { |
@@ -345,9 +357,23 @@ static void dwc3_omap_enable_irqs(struct dwc3_omap *omap) | |||
345 | 357 | ||
346 | static void dwc3_omap_disable_irqs(struct dwc3_omap *omap) | 358 | static void dwc3_omap_disable_irqs(struct dwc3_omap *omap) |
347 | { | 359 | { |
360 | u32 reg; | ||
361 | |||
348 | /* disable all IRQs */ | 362 | /* disable all IRQs */ |
349 | dwc3_omap_write_irqmisc_set(omap, 0x00); | 363 | reg = USBOTGSS_IRQO_COREIRQ_ST; |
350 | dwc3_omap_write_irq0_set(omap, 0x00); | 364 | dwc3_omap_write_irq0_clr(omap, reg); |
365 | |||
366 | reg = (USBOTGSS_IRQMISC_OEVT | | ||
367 | USBOTGSS_IRQMISC_DRVVBUS_RISE | | ||
368 | USBOTGSS_IRQMISC_CHRGVBUS_RISE | | ||
369 | USBOTGSS_IRQMISC_DISCHRGVBUS_RISE | | ||
370 | USBOTGSS_IRQMISC_IDPULLUP_RISE | | ||
371 | USBOTGSS_IRQMISC_DRVVBUS_FALL | | ||
372 | USBOTGSS_IRQMISC_CHRGVBUS_FALL | | ||
373 | USBOTGSS_IRQMISC_DISCHRGVBUS_FALL | | ||
374 | USBOTGSS_IRQMISC_IDPULLUP_FALL); | ||
375 | |||
376 | dwc3_omap_write_irqmisc_clr(omap, reg); | ||
351 | } | 377 | } |
352 | 378 | ||
353 | static u64 dwc3_omap_dma_mask = DMA_BIT_MASK(32); | 379 | static u64 dwc3_omap_dma_mask = DMA_BIT_MASK(32); |