]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/gadget/f_thor.c
Merge branch 'master' of git://git.denx.de/u-boot-video
[u-boot] / drivers / usb / gadget / f_thor.c
index 6346370cd67a863ebf8222fc3380a5641cb3e6db..9ed0ce3d31328674f982e8b32a96643b8e77c361 100644 (file)
@@ -18,6 +18,7 @@
 #include <errno.h>
 #include <common.h>
 #include <malloc.h>
+#include <memalign.h>
 #include <version.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
@@ -123,6 +124,9 @@ static int process_rqt_cmd(const struct rqt_box *rqt)
                send_rsp(rsp);
                g_dnl_unregister();
                dfu_free_entities();
+#ifdef CONFIG_THOR_RESET_OFF
+               return RESET_DONE;
+#endif
                run_command("reset", 0);
                break;
        case RQT_CMD_POWEROFF:
@@ -565,7 +569,7 @@ static void thor_tx_data(unsigned char *data, int len)
 
        dev->in_req->length = len;
 
-       debug("%s: dev->in_req->length:%d to_cpy:%d\n", __func__,
+       debug("%s: dev->in_req->length:%d to_cpy:%zd\n", __func__,
              dev->in_req->length, sizeof(data));
 
        status = usb_ep_queue(dev->in_ep, dev->in_req, 0);
@@ -728,6 +732,10 @@ int thor_handle(void)
 
                if (ret > 0) {
                        ret = process_data();
+#ifdef CONFIG_THOR_RESET_OFF
+                       if (ret == RESET_DONE)
+                               break;
+#endif
                        if (ret < 0)
                                return ret;
                } else {
@@ -768,7 +776,7 @@ static int thor_func_bind(struct usb_configuration *c, struct usb_function *f)
                goto fail;
        }
        dev->req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE,
-                                gadget->ep0->maxpacket);
+                                THOR_PACKET_SIZE);
        if (!dev->req->buf) {
                status = -ENOMEM;
                goto fail;