summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/uvc_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/function/uvc_video.c')
-rw-r--r--drivers/usb/gadget/function/uvc_video.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c
index dd1c6b2ca7c6..b6ea600b0111 100644
--- a/drivers/usb/gadget/function/uvc_video.c
+++ b/drivers/usb/gadget/function/uvc_video.c
@@ -459,6 +459,9 @@ static void uvcg_video_pump(struct work_struct *work)
*/
int uvcg_video_enable(struct uvc_video *video, int enable)
{
+ struct uvc_device *uvc = video->uvc;
+ struct usb_composite_dev *cdev = uvc->func.config->cdev;
+ struct usb_gadget *gadget = cdev->gadget;
unsigned int i;
int ret;
@@ -490,9 +493,11 @@ int uvcg_video_enable(struct uvc_video *video, int enable)
if (video->max_payload_size) {
video->encode = uvc_video_encode_bulk;
video->payload_size = 0;
- } else
- video->encode = video->queue.use_sg ?
+ } else {
+ video->encode = (video->queue.use_sg &&
+ !(gadget->speed <= USB_SPEED_HIGH)) ?
uvc_video_encode_isoc_sg : uvc_video_encode_isoc;
+ }
video->req_int_count = 0;