aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2017-03-08 09:05:43 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-30 03:41:23 -0400
commitd8ec35ad8b36eba708af614b54eda471ba125eed (patch)
tree54f2195d6a11843576a26490056f8dacde5dcbd7 /drivers/usb
parentff8d97a822c65e8ae6ceaa67369c0d56f6797c9b (diff)
usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval
commit 09424c50b7dff40cb30011c09114404a4656e023 upstream. The streaming_maxburst module parameter is 0 offset (0..15) so we must add 1 while using it for wBytesPerInterval calculation for the SuperSpeed companion descriptor. Without this host uvcvideo driver will always see the wrong wBytesPerInterval for SuperSpeed uvc gadget and may not find a suitable video interface endpoint. e.g. for streaming_maxburst = 0 case it will always fail as wBytePerInterval was evaluating to 0. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/function/f_uvc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 29b41b5dee04..c7689d05356c 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -625,7 +625,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
625 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; 625 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst;
626 uvc_ss_streaming_comp.wBytesPerInterval = 626 uvc_ss_streaming_comp.wBytesPerInterval =
627 cpu_to_le16(max_packet_size * max_packet_mult * 627 cpu_to_le16(max_packet_size * max_packet_mult *
628 opts->streaming_maxburst); 628 (opts->streaming_maxburst + 1));
629 629
630 /* Allocate endpoints. */ 630 /* Allocate endpoints. */
631 ep = usb_ep_autoconfig(cdev->gadget, &uvc_control_ep); 631 ep = usb_ep_autoconfig(cdev->gadget, &uvc_control_ep);