Skip to content
Snippets Groups Projects
Commit b958fb91 authored by Łukasz Majewski's avatar Łukasz Majewski Committed by Marek Vasut
Browse files

usb:g_dnl: Support for TIZEN's THOR function in generic download code


Support of "thor" function in generic download code (g_dnl.c).

Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
parent c5279377
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <g_dnl.h> #include <g_dnl.h>
#include <usb_mass_storage.h> #include <usb_mass_storage.h>
#include <dfu.h> #include <dfu.h>
#include <thor.h>
#include "gadget_chips.h" #include "gadget_chips.h"
#include "composite.c" #include "composite.c"
...@@ -101,6 +102,8 @@ static int g_dnl_do_config(struct usb_configuration *c) ...@@ -101,6 +102,8 @@ static int g_dnl_do_config(struct usb_configuration *c)
ret = dfu_add(c); ret = dfu_add(c);
else if (!strcmp(s, "usb_dnl_ums")) else if (!strcmp(s, "usb_dnl_ums"))
ret = fsg_add(c); ret = fsg_add(c);
else if (!strcmp(s, "usb_dnl_thor"))
ret = thor_add(c);
return ret; return ret;
} }
...@@ -191,8 +194,8 @@ static struct usb_composite_driver g_dnl_driver = { ...@@ -191,8 +194,8 @@ static struct usb_composite_driver g_dnl_driver = {
int g_dnl_register(const char *type) int g_dnl_register(const char *type)
{ {
/* We only allow "dfu" atm, so 3 should be enough */ /* The largest function name is 4 */
static char name[sizeof(shortname) + 3]; static char name[sizeof(shortname) + 4];
int ret; int ret;
if (!strcmp(type, "dfu")) { if (!strcmp(type, "dfu")) {
...@@ -201,6 +204,9 @@ int g_dnl_register(const char *type) ...@@ -201,6 +204,9 @@ int g_dnl_register(const char *type)
} else if (!strcmp(type, "ums")) { } else if (!strcmp(type, "ums")) {
strcpy(name, shortname); strcpy(name, shortname);
strcat(name, type); strcat(name, type);
} else if (!strcmp(type, "thor")) {
strcpy(name, shortname);
strcat(name, type);
} else { } else {
printf("%s: unknown command: %s\n", __func__, type); printf("%s: unknown command: %s\n", __func__, type);
return -EINVAL; return -EINVAL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment