USB: imx_udc: Fix IMX UDC gadget general irq handling

Previous thread: USB: usb-serial ch341: support for DTR/RTS/CTS by Linux Kernel Mailing List on Thursday, March 26, 2009 - 12:28 pm. (1 message)

Next thread: USB: gpio_vbus: add delayed vbus_session calls by Linux Kernel Mailing List on Thursday, March 26, 2009 - 12:28 pm. (1 message)
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 12:28 pm

Gitweb:     http://git.kernel.org/linus/b633d28e2c5fbe1c8d163892644f57df04aa1421
Commit:     b633d28e2c5fbe1c8d163892644f57df04aa1421
Parent:     d24921a36df31332c32e1bb539671284d9e36bfa
Author:     Darius Augulis <augulis.darius@gmail.com>
AuthorDate: Wed Jan 21 15:19:19 2009 +0200
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Tue Mar 24 16:20:29 2009 -0700

    USB: imx_udc: Fix IMX UDC gadget general irq handling
    
    Workaround of hw bug in IMX UDC.
    This bug causes wrong handling of CFG_CHG interrupt.
    Workaround is documented inline source code.
    
    Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/gadget/imx_udc.c |  158 +++++++++++++++++++++++++-----------------
 drivers/usb/gadget/imx_udc.h |    1 +
 2 files changed, 94 insertions(+), 65 deletions(-)

diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index e590464..8d3c6a9 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -28,6 +28,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
+#include <linux/timer.h>
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
@@ -1013,70 +1014,32 @@ static void udc_stop_activity(struct imx_udc_struct *imx_usb,
  *******************************************************************************
  */
 
-static irqreturn_t imx_udc_irq(int irq, void *dev)
+/*
+ * Called when timer expires.
+ * Timer is started when CFG_CHG is received.
+ */
+static void handle_config(unsigned long data)
 {
-	struct imx_udc_struct *imx_usb = dev;
+	struct imx_udc_struct *imx_usb = (void *)data;
 	struct usb_ctrlrequest u;
 	int temp, cfg, intf, alt;
-	int intr = __raw_readl(imx_usb->base + USB_INTR);
-
-	if (intr & (INTR_WAKEUP | INTR_SUSPEND | INTR_RESUME | INTR_RESET_START
-			| INTR_RESET_STOP | INTR_CFG_CHG)) {
-				dump_intr(__func__, intr, imx_usb->dev);
-				dump_usb_stat(__func__, ...
Previous thread: USB: usb-serial ch341: support for DTR/RTS/CTS by Linux Kernel Mailing List on Thursday, March 26, 2009 - 12:28 pm. (1 message)

Next thread: USB: gpio_vbus: add delayed vbus_session calls by Linux Kernel Mailing List on Thursday, March 26, 2009 - 12:28 pm. (1 message)