]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: renesas_usbhs: disable attch irq after device attached
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 9 Dec 2011 02:29:22 +0000 (18:29 -0800)
committerFelipe Balbi <balbi@ti.com>
Tue, 13 Dec 2011 11:06:27 +0000 (13:06 +0200)
attch interrupt might happen infinitely on some USB hub (self power?).
This patch disable attch irq after device attached,
and enable it again when detach irq happen.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/mod_host.c

index 72ee8e55e717e5e8c30f221862b53a05f46ccdf2..c947d0aca9bfb68defc75044d5d75d5bd489a864 100644 (file)
@@ -1245,6 +1245,14 @@ static int usbhsh_irq_attch(struct usbhs_priv *priv,
        usbhsh_port_stat_set(hpriv, USB_PORT_STAT_CONNECTION);
        usbhsh_port_stat_set(hpriv, USB_PORT_STAT_C_CONNECTION << 16);
 
+       /*
+        * attch interrupt might happen infinitely on some device
+        * (on self power USB hub ?)
+        * disable it here.
+        */
+       hpriv->mod.irq_attch = NULL;
+       usbhs_irq_callback_update(priv, &hpriv->mod);
+
        return 0;
 }
 
@@ -1259,6 +1267,12 @@ static int usbhsh_irq_dtch(struct usbhs_priv *priv,
        usbhsh_port_stat_clear(hpriv, USB_PORT_STAT_CONNECTION);
        usbhsh_port_stat_set(hpriv, USB_PORT_STAT_C_CONNECTION << 16);
 
+       /*
+        * enable attch interrupt again
+        */
+       hpriv->mod.irq_attch = usbhsh_irq_attch;
+       usbhs_irq_callback_update(priv, &hpriv->mod);
+
        return 0;
 }