Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5283b275 authored by Sriharsha Allenki's avatar Sriharsha Allenki Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: Fixes enumeration failure on Windows 10



Fixes USB Video function(UVC 1.5) enumeartion failure
on Windows 10 by updating the processing unit descriptor
of UVC class from 1.1 to 1.5. Changes the SAR width
and SAR height attributes of H.264 frame descriptors
to a non zero value as Windows 10 expects a non-zero
value without which the video function enumeration fails.

Change-Id: I5e1f0bd10e94b3a081d6607a1287f3cb4d3b5c41
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent be05b187
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -58,15 +58,16 @@ static const struct uvc_camera_terminal_descriptor uvc_camera_terminal = {
};

static const struct uvc_processing_unit_descriptor uvc_processing = {
	.bLength		= UVC_DT_PROCESSING_UNIT_SIZE(2),
	.bLength		= UVC_DT_PROCESSING_UNIT_SIZE(3),
	.bDescriptorType	= USB_DT_CS_INTERFACE,
	.bDescriptorSubType	= UVC_VC_PROCESSING_UNIT,
	.bUnitID		= 2,
	.bSourceID		= 1,
	.wMaxMultiplier		= cpu_to_le16(16*1024),
	.bControlSize		= 2,
	.bControlSize		= 3,
	.bmControls[0]		= 64,
	.bmControls[1]		= 16,
	.bmControls[2]		= 1,
	.iProcessing		= 0,
};

@@ -250,8 +251,8 @@ static const struct UVC_FRAME_H264(1) uvc_frame_h264_1920p = {
	.bFrameIndex		= 1,
	.wWidth			= cpu_to_le16(3840),
	.wHeight		= cpu_to_le16(1920),
	.wSARwidth		= 0,
	.wSARheight		= 0,
	.wSARwidth		= 1,
	.wSARheight		= 1,
	.wProfile		= 0x6400,
	.bLevelIDC		= 0x33,
	.bmSupportedUsages	= 0x70003,
@@ -273,8 +274,8 @@ static const struct UVC_FRAME_H264(1) uvc_frame_h264_960p = {
	.bFrameIndex		= 2,
	.wWidth			= cpu_to_le16(1920),
	.wHeight		= cpu_to_le16(960),
	.wSARwidth		= 0,
	.wSARheight		= 0,
	.wSARwidth		= 1,
	.wSARheight		= 1,
	.wProfile		= 0x6400,
	.bLevelIDC		= 0x28,
	.bmSupportedUsages	= 0x70003,
+3 −2
Original line number Diff line number Diff line
@@ -300,11 +300,12 @@ struct uvc_processing_unit_descriptor {
	__u8  bSourceID;
	__u16 wMaxMultiplier;
	__u8  bControlSize;
	__u8  bmControls[2];
	__u8  bmControls[3];
	__u8  iProcessing;
	__u8  bmVideoStandards;
} __attribute__((__packed__));

#define UVC_DT_PROCESSING_UNIT_SIZE(n)			(9+(n))
#define UVC_DT_PROCESSING_UNIT_SIZE(n)			(10+(n))

/* 3.7.2.6. Extension Unit Descriptor */
struct uvc_extension_unit_descriptor {