]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/dwc3/gadget.c
Merge branch 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / drivers / usb / dwc3 / gadget.c
index 02e44fcaf205e3eaf4a69e706c41d6e081c6c1e5..2da0a5a2803aab36b4842fe8804c4700ddd30683 100644 (file)
@@ -1650,7 +1650,7 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc,
                dev_vdbg(dwc->dev, "initializing %s\n", dep->name);
 
                if (epnum == 0 || epnum == 1) {
-                       dep->endpoint.maxpacket = 512;
+                       usb_ep_set_maxpacket_limit(&dep->endpoint, 512);
                        dep->endpoint.maxburst = 1;
                        dep->endpoint.ops = &dwc3_gadget_ep0_ops;
                        if (!epnum)
@@ -1658,7 +1658,7 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc,
                } else {
                        int             ret;
 
-                       dep->endpoint.maxpacket = 1024;
+                       usb_ep_set_maxpacket_limit(&dep->endpoint, 1024);
                        dep->endpoint.max_streams = 15;
                        dep->endpoint.ops = &dwc3_gadget_ep_ops;
                        list_add_tail(&dep->endpoint.ep_list,
@@ -2596,6 +2596,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
        dwc->gadget.sg_supported        = true;
        dwc->gadget.name                = "dwc3-gadget";
 
+       /*
+        * Per databook, DWC3 needs buffer size to be aligned to MaxPacketSize
+        * on ep out.
+        */
+       dwc->gadget.quirk_ep_out_aligned_size = true;
+
        /*
         * REVISIT: Here we should clear all pending IRQs to be
         * sure we're starting from a well known location.