usb: r8a66597-udc: Add processing when USB was removed.
authorYusuke Goda <yusuke.goda.sx@renesas.com>
Wed, 20 Oct 2010 00:28:08 +0000 (09:28 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 22 Oct 2010 17:22:18 +0000 (10:22 -0700)
When USB was removed, this patch prepares for the next insertion.

Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/r8a66597-udc.c

index 157640f7d2a8edb21c719028c548c9e6cc6dbc98..20d43da319ae401a3223581fb5412154287c1582 100644 (file)
@@ -42,6 +42,7 @@ static const char *r8a66597_ep_name[] = {
        "ep8", "ep9",
 };
 
+static void init_controller(struct r8a66597 *r8a66597);
 static void disable_controller(struct r8a66597 *r8a66597);
 static void irq_ep0_write(struct r8a66597_ep *ep, struct r8a66597_request *req);
 static void irq_packet_write(struct r8a66597_ep *ep,
@@ -104,6 +105,8 @@ __acquires(r8a66597->lock)
        spin_lock(&r8a66597->lock);
 
        disable_controller(r8a66597);
+       init_controller(r8a66597);
+       r8a66597_bset(r8a66597, VBSE, INTENB0);
        INIT_LIST_HEAD(&r8a66597->ep[0].queue);
 }