]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/gadget/g_dnl.c
usb: lthor: Specify correct parameter for sizeof type
[u-boot] / drivers / usb / gadget / g_dnl.c
index 25611acd607f21a39010a3c207ba70f39463c0c2..2fa6da4091e16b07ca5b2b3322e133b67550b934 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <mmc.h>
 #include <part.h>
+#include <usb.h>
 
 #include <g_dnl.h>
 #include <usb_mass_storage.h>
@@ -92,8 +93,6 @@ static int g_dnl_unbind(struct usb_composite_dev *cdev)
 {
        struct usb_gadget *gadget = cdev->gadget;
 
-       free(cdev->config);
-       cdev->config = NULL;
        debug("%s: calling usb_gadget_disconnect for "
                        "controller '%s'\n", __func__, gadget->name);
        usb_gadget_disconnect(gadget);
@@ -147,6 +146,18 @@ static int g_dnl_config_register(struct usb_composite_dev *cdev)
        return usb_add_config(cdev, config);
 }
 
+__weak
+int board_usb_init(int index, enum usb_init_type init)
+{
+       return 0;
+}
+
+__weak
+int board_usb_cleanup(int index, enum usb_init_type init)
+{
+       return 0;
+}
+
 __weak
 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 {
@@ -163,6 +174,23 @@ __weak int g_dnl_board_usb_cable_connected(void)
        return -EOPNOTSUPP;
 }
 
+static bool g_dnl_detach_request;
+
+bool g_dnl_detach(void)
+{
+       return g_dnl_detach_request;
+}
+
+void g_dnl_trigger_detach(void)
+{
+       g_dnl_detach_request = true;
+}
+
+void g_dnl_clear_detach(void)
+{
+       g_dnl_detach_request = false;
+}
+
 static int g_dnl_get_bcd_device_number(struct usb_composite_dev *cdev)
 {
        struct usb_gadget *gadget = cdev->gadget;