CHROMIUM: usb: gadget: f_mtp: fix usb_ss_ep_comp_descriptor
authorMark Kuo <mkuo@nvidia.com>
Fri, 11 Sep 2015 08:12:59 +0000 (16:12 +0800)
committerAmit Pundir <amit.pundir@linaro.org>
Thu, 7 Apr 2016 11:20:00 +0000 (16:50 +0530)
wBytesPerInterval in SuperSpeed Endpoint Companion Descriptor needs
to be set large enough to reserve enough bus time for associated
periodic endpoint.

Originally, wBytesPerInterval for mtp's interrupt IN endpoint is set
to 2 and its single interrupt transfer will be split into many 2 bytes
interrupt transfers. So, we change wBytesPerInterval to INTR_BUFFER_SIZE
to ensure interrupt transfer will not be split.

BUG=none
TEST=Smaug works as a MTP device

Change-Id: I49c0df892b2d9e0193a684eef23f73664ced9f91
Signed-off-by: Henry Lin <henryl@nvidia.com>
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/299091
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
drivers/usb/gadget/function/f_mtp.c

index 148f8fcecc8071467f9527ec83a89b806e058c1f..7f5c390885feb7bba8cd90505cb92e4397fa0302 100644 (file)
@@ -205,7 +205,7 @@ static struct usb_endpoint_descriptor mtp_intr_desc = {
 static struct usb_ss_ep_comp_descriptor mtp_intr_ss_comp_desc = {
        .bLength                = sizeof(mtp_intr_ss_comp_desc),
        .bDescriptorType        = USB_DT_SS_ENDPOINT_COMP,
-       .wBytesPerInterval      = cpu_to_le16(2),
+       .wBytesPerInterval      = cpu_to_le16(INTR_BUFFER_SIZE),
 };
 
 static struct usb_descriptor_header *fs_mtp_descs[] = {