usb:g_dnl: Support for TIZEN's THOR function in generic download code
authorLukasz Majewski <l.majewski@samsung.com>
Tue, 8 Oct 2013 12:30:43 +0000 (14:30 +0200)
committerChanho Park <chanho61.park@samsung.com>
Fri, 24 Jul 2015 07:29:51 +0000 (16:29 +0900)
Support of "thor" function in generic download code (g_dnl.c).

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
drivers/usb/gadget/g_dnl.c

index ccca79b126a8835cc4292072c8d4fb55e2cc594c..15239d98955b92c6521591a320ffcae202f61f23 100644 (file)
@@ -28,6 +28,7 @@
 #include <g_dnl.h>
 #include <usb_mass_storage.h>
 #include <dfu.h>
+#include <thor.h>
 
 #include "gadget_chips.h"
 #include "composite.c"
@@ -113,6 +114,8 @@ static int g_dnl_do_config(struct usb_configuration *c)
                ret = dfu_add(c);
        else if (!strcmp(s, "usb_dnl_ums"))
                ret = fsg_add(c);
+       else if (!strcmp(s, "usb_dnl_thor"))
+               ret = thor_add(c);
 
        return ret;
 }
@@ -203,8 +206,8 @@ static struct usb_composite_driver g_dnl_driver = {
 
 int g_dnl_register(const char *type)
 {
-       /* We only allow "dfu" atm, so 3 should be enough */
-       static char name[sizeof(shortname) + 3];
+       /* The largest function name is 4 */
+       static char name[sizeof(shortname) + 4];
        int ret;
 
        if (!strcmp(type, "dfu")) {
@@ -213,6 +216,9 @@ int g_dnl_register(const char *type)
        } else if (!strcmp(type, "ums")) {
                strcpy(name, shortname);
                strcat(name, type);
+       } else if (!strcmp(type, "thor")) {
+               strcpy(name, shortname);
+               strcat(name, type);
        } else {
                printf("%s: unknown command: %s\n", __func__, type);
                return -EINVAL;