aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/r8a66597-udc.c
diff options
context:
space:
mode:
authorMagnus Damm2009-08-19 14:26:10 +0000
committerPaul Mundt2009-08-20 10:30:45 +0900
commit0bb886d2a9c2d4e069ca364e36c52c7ae6d1ca8c (patch)
tree34bd4255913ab3c2576627f54fe21592eedf6ece /drivers/usb/gadget/r8a66597-udc.c
parentef5ce3b69028ea32aa87e98c9a3802e7c9f824b6 (diff)
usb: r8a66597-udc disable interrupts on shutdown fix
This patch improves the disable_controller() function in the r8a66597-udc driver to disable all interrupts and also clear status flags. With this patch in place the driver survives kexec. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/usb/gadget/r8a66597-udc.c')
-rw-r--r--drivers/usb/gadget/r8a66597-udc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c
index 956618400a7c..9ca867a85a05 100644
--- a/drivers/usb/gadget/r8a66597-udc.c
+++ b/drivers/usb/gadget/r8a66597-udc.c
@@ -614,8 +614,17 @@ static void disable_controller(struct r8a66597 *r8a66597)
if (r8a66597->pdata->on_chip) {
r8a66597_bset(r8a66597, SCKE, SYSCFG0);
+ /* disable interrupts */
r8a66597_write(r8a66597, 0, INTENB0);
r8a66597_write(r8a66597, 0, INTENB1);
+ r8a66597_write(r8a66597, 0, BRDYENB);
+ r8a66597_write(r8a66597, 0, BEMPENB);
+ r8a66597_write(r8a66597, 0, NRDYENB);
+
+ /* clear status */
+ r8a66597_write(r8a66597, 0, BRDYSTS);
+ r8a66597_write(r8a66597, 0, NRDYSTS);
+ r8a66597_write(r8a66597, 0, BEMPSTS);
r8a66597_bclr(r8a66597, USBE, SYSCFG0);
r8a66597_bclr(r8a66597, SCKE, SYSCFG0);