提交 b958fb91 编写于 作者: L Lukasz Majewski 提交者: Marek Vasut

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: NLukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
上级 c5279377
......@@ -16,6 +16,7 @@
#include <g_dnl.h>
#include <usb_mass_storage.h>
#include <dfu.h>
#include <thor.h>
#include "gadget_chips.h"
#include "composite.c"
......@@ -101,6 +102,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;
}
......@@ -191,8 +194,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")) {
......@@ -201,6 +204,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册