]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
usb: gadget: renesas_usbhs: tidyup INTENB0 method
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 11 Oct 2011 05:01:15 +0000 (22:01 -0700)
committerFelipe Balbi <balbi@ti.com>
Thu, 13 Oct 2011 17:41:37 +0000 (20:41 +0300)
This patch tidyup Interrupt Enable Register 0 (INTENB0)
which has relationship with picky BEMPENB/BRDYENB.

 - add explain comment
 - ignore nonsense 0 write case

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

index 621f6cc50db6da77674fcec2e2beccca721d4d95..74ef49e7dd5fe1dd041cc44896439decb0a52ee8 100644 (file)
@@ -292,6 +292,14 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod)
        u16 intenb0 = 0;
        struct usbhs_mod_info *info = usbhs_priv_to_modinfo(priv);
 
+       /*
+        * BEMPENB/BRDYENB are picky.
+        * below method is required
+        *
+        *  - clear  INTSTS0
+        *  - update BEMPENB/BRDYENB
+        *  - update INTSTS0
+        */
        usbhs_write(priv, INTENB0, 0);
 
        usbhs_write(priv, BEMPENB, 0);
@@ -324,5 +332,6 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod)
                }
        }
 
-       usbhs_write(priv, INTENB0, intenb0);
+       if (intenb0)
+               usbhs_write(priv, INTENB0, intenb0);
 }