uvc-gadget: Don't hardcode the maximum payload transfer size
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 25 May 2018 21:33:23 +0000 (00:33 +0300)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 1 Jun 2018 07:08:00 +0000 (10:08 +0300)
Use the streaming endpoint maximum packet size parsed from ConfigFS
instead of hardcoding an arbitrary value.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
uvc-gadget.c

index 5ec81fb..8ccfa07 100644 (file)
@@ -298,7 +298,7 @@ uvc_fill_streaming_control(struct uvc_device *dev,
                break;
        }
 
-       ctrl->dwMaxPayloadTransferSize = 512;   /* TODO this should be filled by the driver. */
+       ctrl->dwMaxPayloadTransferSize = dev->fc->streaming.ep.wMaxPacketSize;
        ctrl->bmFramingInfo = 3;
        ctrl->bPreferedVersion = 1;
        ctrl->bMaxVersion = 1;