summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/g_dnl.c
diff options
context:
space:
mode:
authorLukasz Majewski <l.majewski@samsung.com>2013-10-08 14:30:43 +0200
committerMarek Vasut <marex@denx.de>2013-10-20 23:42:41 +0200
commitb958fb916512d3d9859195f48625b82932591a1d (patch)
tree8889792ec69f18d0db78a691c40261b1e1ab40d6 /drivers/usb/gadget/g_dnl.c
parentc527937796cd18966e6c0bfcf0fa0483feada87d (diff)
downloadu-boot-b958fb916512d3d9859195f48625b82932591a1d.tar.gz
u-boot-b958fb916512d3d9859195f48625b82932591a1d.tar.bz2
u-boot-b958fb916512d3d9859195f48625b82932591a1d.zip
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: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/usb/gadget/g_dnl.c')
-rw-r--r--drivers/usb/gadget/g_dnl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 98560b8abd..43f413aabf 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -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;