]> git.sur5r.net Git - u-boot/commitdiff
g_dnl: Issue connect/disconnect as appropriate
authorPantelis Antoniou <panto@antoniou-consulting.com>
Fri, 30 Nov 2012 08:01:05 +0000 (08:01 +0000)
committerMarek Vasut <marex@denx.de>
Mon, 17 Dec 2012 14:38:15 +0000 (15:38 +0100)
Call usb_gadget_connect/usb_gadget_disconnect in g_dnl_bind/g_dnl_unbind.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
drivers/usb/gadget/g_dnl.c

index 7d87050df3d0740674e3d9c99ce0846d7341f1f5..25da73363ad5500037df0816d271b39f3312572c 100644 (file)
@@ -83,7 +83,12 @@ static struct usb_gadget_strings *g_dnl_composite_strings[] = {
 
 static int g_dnl_unbind(struct usb_composite_dev *cdev)
 {
-       debug("%s\n", __func__);
+       struct usb_gadget *gadget = cdev->gadget;
+
+       debug("%s: calling usb_gadget_disconnect for "
+                       "controller '%s'\n", shortname, gadget->name);
+       usb_gadget_disconnect(gadget);
+
        return 0;
 }
 
@@ -153,6 +158,10 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)
                device_desc.bcdDevice = __constant_cpu_to_le16(0x9999);
        }
 
+       debug("%s: calling usb_gadget_connect for "
+                       "controller '%s'\n", shortname, gadget->name);
+       usb_gadget_connect(gadget);
+
        return 0;
 
  error: