aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_uvc.c16
-rw-r--r--drivers/usb/gadget/f_uvc.h352
-rw-r--r--drivers/usb/gadget/uvc.h36
-rw-r--r--drivers/usb/gadget/webcam.c24
4 files changed, 21 insertions, 407 deletions
diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
index dbe6db0184fd..be446b7e7eaa 100644
--- a/drivers/usb/gadget/f_uvc.c
+++ b/drivers/usb/gadget/f_uvc.c
@@ -61,12 +61,12 @@ static struct usb_gadget_strings *uvc_function_strings[] = {
61#define UVC_INTF_VIDEO_STREAMING 1 61#define UVC_INTF_VIDEO_STREAMING 1
62 62
63static struct usb_interface_assoc_descriptor uvc_iad __initdata = { 63static struct usb_interface_assoc_descriptor uvc_iad __initdata = {
64 .bLength = USB_DT_INTERFACE_ASSOCIATION_SIZE, 64 .bLength = sizeof(uvc_iad),
65 .bDescriptorType = USB_DT_INTERFACE_ASSOCIATION, 65 .bDescriptorType = USB_DT_INTERFACE_ASSOCIATION,
66 .bFirstInterface = 0, 66 .bFirstInterface = 0,
67 .bInterfaceCount = 2, 67 .bInterfaceCount = 2,
68 .bFunctionClass = USB_CLASS_VIDEO, 68 .bFunctionClass = USB_CLASS_VIDEO,
69 .bFunctionSubClass = 0x03, 69 .bFunctionSubClass = UVC_SC_VIDEO_INTERFACE_COLLECTION,
70 .bFunctionProtocol = 0x00, 70 .bFunctionProtocol = 0x00,
71 .iFunction = 0, 71 .iFunction = 0,
72}; 72};
@@ -78,7 +78,7 @@ static struct usb_interface_descriptor uvc_control_intf __initdata = {
78 .bAlternateSetting = 0, 78 .bAlternateSetting = 0,
79 .bNumEndpoints = 1, 79 .bNumEndpoints = 1,
80 .bInterfaceClass = USB_CLASS_VIDEO, 80 .bInterfaceClass = USB_CLASS_VIDEO,
81 .bInterfaceSubClass = 0x01, 81 .bInterfaceSubClass = UVC_SC_VIDEOCONTROL,
82 .bInterfaceProtocol = 0x00, 82 .bInterfaceProtocol = 0x00,
83 .iInterface = 0, 83 .iInterface = 0,
84}; 84};
@@ -106,7 +106,7 @@ static struct usb_interface_descriptor uvc_streaming_intf_alt0 __initdata = {
106 .bAlternateSetting = 0, 106 .bAlternateSetting = 0,
107 .bNumEndpoints = 0, 107 .bNumEndpoints = 0,
108 .bInterfaceClass = USB_CLASS_VIDEO, 108 .bInterfaceClass = USB_CLASS_VIDEO,
109 .bInterfaceSubClass = 0x02, 109 .bInterfaceSubClass = UVC_SC_VIDEOSTREAMING,
110 .bInterfaceProtocol = 0x00, 110 .bInterfaceProtocol = 0x00,
111 .iInterface = 0, 111 .iInterface = 0,
112}; 112};
@@ -118,7 +118,7 @@ static struct usb_interface_descriptor uvc_streaming_intf_alt1 __initdata = {
118 .bAlternateSetting = 1, 118 .bAlternateSetting = 1,
119 .bNumEndpoints = 1, 119 .bNumEndpoints = 1,
120 .bInterfaceClass = USB_CLASS_VIDEO, 120 .bInterfaceClass = USB_CLASS_VIDEO,
121 .bInterfaceSubClass = 0x02, 121 .bInterfaceSubClass = UVC_SC_VIDEOSTREAMING,
122 .bInterfaceProtocol = 0x00, 122 .bInterfaceProtocol = 0x00,
123 .iInterface = 0, 123 .iInterface = 0,
124}; 124};
@@ -603,15 +603,15 @@ uvc_bind_config(struct usb_configuration *c,
603 603
604 /* Validate the descriptors. */ 604 /* Validate the descriptors. */
605 if (control == NULL || control[0] == NULL || 605 if (control == NULL || control[0] == NULL ||
606 control[0]->bDescriptorSubType != UVC_DT_HEADER) 606 control[0]->bDescriptorSubType != UVC_VC_HEADER)
607 goto error; 607 goto error;
608 608
609 if (fs_streaming == NULL || fs_streaming[0] == NULL || 609 if (fs_streaming == NULL || fs_streaming[0] == NULL ||
610 fs_streaming[0]->bDescriptorSubType != UVC_DT_INPUT_HEADER) 610 fs_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
611 goto error; 611 goto error;
612 612
613 if (hs_streaming == NULL || hs_streaming[0] == NULL || 613 if (hs_streaming == NULL || hs_streaming[0] == NULL ||
614 hs_streaming[0]->bDescriptorSubType != UVC_DT_INPUT_HEADER) 614 hs_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
615 goto error; 615 goto error;
616 616
617 uvc->desc.control = control; 617 uvc->desc.control = control;
diff --git a/drivers/usb/gadget/f_uvc.h b/drivers/usb/gadget/f_uvc.h
index 8a5db7c4fe7c..e18a6636c283 100644
--- a/drivers/usb/gadget/f_uvc.h
+++ b/drivers/usb/gadget/f_uvc.h
@@ -15,357 +15,7 @@
15#define _F_UVC_H_ 15#define _F_UVC_H_
16 16
17#include <linux/usb/composite.h> 17#include <linux/usb/composite.h>
18 18#include <linux/usb/video.h>
19#define USB_CLASS_VIDEO_CONTROL 1
20#define USB_CLASS_VIDEO_STREAMING 2
21
22struct uvc_descriptor_header {
23 __u8 bLength;
24 __u8 bDescriptorType;
25 __u8 bDescriptorSubType;
26} __attribute__ ((packed));
27
28struct uvc_header_descriptor {
29 __u8 bLength;
30 __u8 bDescriptorType;
31 __u8 bDescriptorSubType;
32 __u16 bcdUVC;
33 __u16 wTotalLength;
34 __u32 dwClockFrequency;
35 __u8 bInCollection;
36 __u8 baInterfaceNr[];
37} __attribute__((__packed__));
38
39#define UVC_HEADER_DESCRIPTOR(n) uvc_header_descriptor_##n
40
41#define DECLARE_UVC_HEADER_DESCRIPTOR(n) \
42struct UVC_HEADER_DESCRIPTOR(n) { \
43 __u8 bLength; \
44 __u8 bDescriptorType; \
45 __u8 bDescriptorSubType; \
46 __u16 bcdUVC; \
47 __u16 wTotalLength; \
48 __u32 dwClockFrequency; \
49 __u8 bInCollection; \
50 __u8 baInterfaceNr[n]; \
51} __attribute__ ((packed))
52
53struct uvc_input_terminal_descriptor {
54 __u8 bLength;
55 __u8 bDescriptorType;
56 __u8 bDescriptorSubType;
57 __u8 bTerminalID;
58 __u16 wTerminalType;
59 __u8 bAssocTerminal;
60 __u8 iTerminal;
61} __attribute__((__packed__));
62
63struct uvc_output_terminal_descriptor {
64 __u8 bLength;
65 __u8 bDescriptorType;
66 __u8 bDescriptorSubType;
67 __u8 bTerminalID;
68 __u16 wTerminalType;
69 __u8 bAssocTerminal;
70 __u8 bSourceID;
71 __u8 iTerminal;
72} __attribute__((__packed__));
73
74struct uvc_camera_terminal_descriptor {
75 __u8 bLength;
76 __u8 bDescriptorType;
77 __u8 bDescriptorSubType;
78 __u8 bTerminalID;
79 __u16 wTerminalType;
80 __u8 bAssocTerminal;
81 __u8 iTerminal;
82 __u16 wObjectiveFocalLengthMin;
83 __u16 wObjectiveFocalLengthMax;
84 __u16 wOcularFocalLength;
85 __u8 bControlSize;
86 __u8 bmControls[3];
87} __attribute__((__packed__));
88
89struct uvc_selector_unit_descriptor {
90 __u8 bLength;
91 __u8 bDescriptorType;
92 __u8 bDescriptorSubType;
93 __u8 bUnitID;
94 __u8 bNrInPins;
95 __u8 baSourceID[0];
96 __u8 iSelector;
97} __attribute__((__packed__));
98
99#define UVC_SELECTOR_UNIT_DESCRIPTOR(n) \
100 uvc_selector_unit_descriptor_##n
101
102#define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n) \
103struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { \
104 __u8 bLength; \
105 __u8 bDescriptorType; \
106 __u8 bDescriptorSubType; \
107 __u8 bUnitID; \
108 __u8 bNrInPins; \
109 __u8 baSourceID[n]; \
110 __u8 iSelector; \
111} __attribute__ ((packed))
112
113struct uvc_processing_unit_descriptor {
114 __u8 bLength;
115 __u8 bDescriptorType;
116 __u8 bDescriptorSubType;
117 __u8 bUnitID;
118 __u8 bSourceID;
119 __u16 wMaxMultiplier;
120 __u8 bControlSize;
121 __u8 bmControls[2];
122 __u8 iProcessing;
123} __attribute__((__packed__));
124
125struct uvc_extension_unit_descriptor {
126 __u8 bLength;
127 __u8 bDescriptorType;
128 __u8 bDescriptorSubType;
129 __u8 bUnitID;
130 __u8 guidExtensionCode[16];
131 __u8 bNumControls;
132 __u8 bNrInPins;
133 __u8 baSourceID[0];
134 __u8 bControlSize;
135 __u8 bmControls[0];
136 __u8 iExtension;
137} __attribute__((__packed__));
138
139#define UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \
140 uvc_extension_unit_descriptor_##p_##n
141
142#define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \
143struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \
144 __u8 bLength; \
145 __u8 bDescriptorType; \
146 __u8 bDescriptorSubType; \
147 __u8 bUnitID; \
148 __u8 guidExtensionCode[16]; \
149 __u8 bNumControls; \
150 __u8 bNrInPins; \
151 __u8 baSourceID[p]; \
152 __u8 bControlSize; \
153 __u8 bmControls[n]; \
154 __u8 iExtension; \
155} __attribute__ ((packed))
156
157struct uvc_control_endpoint_descriptor {
158 __u8 bLength;
159 __u8 bDescriptorType;
160 __u8 bDescriptorSubType;
161 __u16 wMaxTransferSize;
162} __attribute__((__packed__));
163
164#define UVC_DT_HEADER 1
165#define UVC_DT_INPUT_TERMINAL 2
166#define UVC_DT_OUTPUT_TERMINAL 3
167#define UVC_DT_SELECTOR_UNIT 4
168#define UVC_DT_PROCESSING_UNIT 5
169#define UVC_DT_EXTENSION_UNIT 6
170
171#define UVC_DT_HEADER_SIZE(n) (12+(n))
172#define UVC_DT_INPUT_TERMINAL_SIZE 8
173#define UVC_DT_OUTPUT_TERMINAL_SIZE 9
174#define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n))
175#define UVC_DT_SELECTOR_UNIT_SIZE(n) (6+(n))
176#define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n))
177#define UVC_DT_EXTENSION_UNIT_SIZE(p,n) (24+(p)+(n))
178#define UVC_DT_CONTROL_ENDPOINT_SIZE 5
179
180struct uvc_input_header_descriptor {
181 __u8 bLength;
182 __u8 bDescriptorType;
183 __u8 bDescriptorSubType;
184 __u8 bNumFormats;
185 __u16 wTotalLength;
186 __u8 bEndpointAddress;
187 __u8 bmInfo;
188 __u8 bTerminalLink;
189 __u8 bStillCaptureMethod;
190 __u8 bTriggerSupport;
191 __u8 bTriggerUsage;
192 __u8 bControlSize;
193 __u8 bmaControls[];
194} __attribute__((__packed__));
195
196#define UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
197 uvc_input_header_descriptor_##n_##p
198
199#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
200struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \
201 __u8 bLength; \
202 __u8 bDescriptorType; \
203 __u8 bDescriptorSubType; \
204 __u8 bNumFormats; \
205 __u16 wTotalLength; \
206 __u8 bEndpointAddress; \
207 __u8 bmInfo; \
208 __u8 bTerminalLink; \
209 __u8 bStillCaptureMethod; \
210 __u8 bTriggerSupport; \
211 __u8 bTriggerUsage; \
212 __u8 bControlSize; \
213 __u8 bmaControls[p][n]; \
214} __attribute__ ((packed))
215
216struct uvc_output_header_descriptor {
217 __u8 bLength;
218 __u8 bDescriptorType;
219 __u8 bDescriptorSubType;
220 __u8 bNumFormats;
221 __u16 wTotalLength;
222 __u8 bEndpointAddress;
223 __u8 bTerminalLink;
224 __u8 bControlSize;
225 __u8 bmaControls[];
226} __attribute__((__packed__));
227
228#define UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
229 uvc_output_header_descriptor_##n_##p
230
231#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
232struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \
233 __u8 bLength; \
234 __u8 bDescriptorType; \
235 __u8 bDescriptorSubType; \
236 __u8 bNumFormats; \
237 __u16 wTotalLength; \
238 __u8 bEndpointAddress; \
239 __u8 bTerminalLink; \
240 __u8 bControlSize; \
241 __u8 bmaControls[p][n]; \
242} __attribute__ ((packed))
243
244struct uvc_format_uncompressed {
245 __u8 bLength;
246 __u8 bDescriptorType;
247 __u8 bDescriptorSubType;
248 __u8 bFormatIndex;
249 __u8 bNumFrameDescriptors;
250 __u8 guidFormat[16];
251 __u8 bBitsPerPixel;
252 __u8 bDefaultFrameIndex;
253 __u8 bAspectRatioX;
254 __u8 bAspectRatioY;
255 __u8 bmInterfaceFlags;
256 __u8 bCopyProtect;
257} __attribute__((__packed__));
258
259struct uvc_frame_uncompressed {
260 __u8 bLength;
261 __u8 bDescriptorType;
262 __u8 bDescriptorSubType;
263 __u8 bFrameIndex;
264 __u8 bmCapabilities;
265 __u16 wWidth;
266 __u16 wHeight;
267 __u32 dwMinBitRate;
268 __u32 dwMaxBitRate;
269 __u32 dwMaxVideoFrameBufferSize;
270 __u32 dwDefaultFrameInterval;
271 __u8 bFrameIntervalType;
272 __u32 dwFrameInterval[];
273} __attribute__((__packed__));
274
275#define UVC_FRAME_UNCOMPRESSED(n) \
276 uvc_frame_uncompressed_##n
277
278#define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \
279struct UVC_FRAME_UNCOMPRESSED(n) { \
280 __u8 bLength; \
281 __u8 bDescriptorType; \
282 __u8 bDescriptorSubType; \
283 __u8 bFrameIndex; \
284 __u8 bmCapabilities; \
285 __u16 wWidth; \
286 __u16 wHeight; \
287 __u32 dwMinBitRate; \
288 __u32 dwMaxBitRate; \
289 __u32 dwMaxVideoFrameBufferSize; \
290 __u32 dwDefaultFrameInterval; \
291 __u8 bFrameIntervalType; \
292 __u32 dwFrameInterval[n]; \
293} __attribute__ ((packed))
294
295struct uvc_format_mjpeg {
296 __u8 bLength;
297 __u8 bDescriptorType;
298 __u8 bDescriptorSubType;
299 __u8 bFormatIndex;
300 __u8 bNumFrameDescriptors;
301 __u8 bmFlags;
302 __u8 bDefaultFrameIndex;
303 __u8 bAspectRatioX;
304 __u8 bAspectRatioY;
305 __u8 bmInterfaceFlags;
306 __u8 bCopyProtect;
307} __attribute__((__packed__));
308
309struct uvc_frame_mjpeg {
310 __u8 bLength;
311 __u8 bDescriptorType;
312 __u8 bDescriptorSubType;
313 __u8 bFrameIndex;
314 __u8 bmCapabilities;
315 __u16 wWidth;
316 __u16 wHeight;
317 __u32 dwMinBitRate;
318 __u32 dwMaxBitRate;
319 __u32 dwMaxVideoFrameBufferSize;
320 __u32 dwDefaultFrameInterval;
321 __u8 bFrameIntervalType;
322 __u32 dwFrameInterval[];
323} __attribute__((__packed__));
324
325#define UVC_FRAME_MJPEG(n) \
326 uvc_frame_mjpeg_##n
327
328#define DECLARE_UVC_FRAME_MJPEG(n) \
329struct UVC_FRAME_MJPEG(n) { \
330 __u8 bLength; \
331 __u8 bDescriptorType; \
332 __u8 bDescriptorSubType; \
333 __u8 bFrameIndex; \
334 __u8 bmCapabilities; \
335 __u16 wWidth; \
336 __u16 wHeight; \
337 __u32 dwMinBitRate; \
338 __u32 dwMaxBitRate; \
339 __u32 dwMaxVideoFrameBufferSize; \
340 __u32 dwDefaultFrameInterval; \
341 __u8 bFrameIntervalType; \
342 __u32 dwFrameInterval[n]; \
343} __attribute__ ((packed))
344
345struct uvc_color_matching_descriptor {
346 __u8 bLength;
347 __u8 bDescriptorType;
348 __u8 bDescriptorSubType;
349 __u8 bColorPrimaries;
350 __u8 bTransferCharacteristics;
351 __u8 bMatrixCoefficients;
352} __attribute__((__packed__));
353
354#define UVC_DT_INPUT_HEADER 1
355#define UVC_DT_OUTPUT_HEADER 2
356#define UVC_DT_FORMAT_UNCOMPRESSED 4
357#define UVC_DT_FRAME_UNCOMPRESSED 5
358#define UVC_DT_FORMAT_MJPEG 6
359#define UVC_DT_FRAME_MJPEG 7
360#define UVC_DT_COLOR_MATCHING 13
361
362#define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p))
363#define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p))
364#define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27
365#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n))
366#define UVC_DT_FORMAT_MJPEG_SIZE 11
367#define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n))
368#define UVC_DT_COLOR_MATCHING_SIZE 6
369 19
370extern int uvc_bind_config(struct usb_configuration *c, 20extern int uvc_bind_config(struct usb_configuration *c,
371 const struct uvc_descriptor_header * const *control, 21 const struct uvc_descriptor_header * const *control,
diff --git a/drivers/usb/gadget/uvc.h b/drivers/usb/gadget/uvc.h
index e92454cddd7d..5b7919460fd2 100644
--- a/drivers/usb/gadget/uvc.h
+++ b/drivers/usb/gadget/uvc.h
@@ -48,39 +48,6 @@ struct uvc_event
48#define UVC_INTF_STREAMING 1 48#define UVC_INTF_STREAMING 1
49 49
50/* ------------------------------------------------------------------------ 50/* ------------------------------------------------------------------------
51 * UVC constants & structures
52 */
53
54/* Values for bmHeaderInfo (Video and Still Image Payload Headers, 2.4.3.3) */
55#define UVC_STREAM_EOH (1 << 7)
56#define UVC_STREAM_ERR (1 << 6)
57#define UVC_STREAM_STI (1 << 5)
58#define UVC_STREAM_RES (1 << 4)
59#define UVC_STREAM_SCR (1 << 3)
60#define UVC_STREAM_PTS (1 << 2)
61#define UVC_STREAM_EOF (1 << 1)
62#define UVC_STREAM_FID (1 << 0)
63
64struct uvc_streaming_control {
65 __u16 bmHint;
66 __u8 bFormatIndex;
67 __u8 bFrameIndex;
68 __u32 dwFrameInterval;
69 __u16 wKeyFrameRate;
70 __u16 wPFrameRate;
71 __u16 wCompQuality;
72 __u16 wCompWindowSize;
73 __u16 wDelay;
74 __u32 dwMaxVideoFrameSize;
75 __u32 dwMaxPayloadTransferSize;
76 __u32 dwClockFrequency;
77 __u8 bmFramingInfo;
78 __u8 bPreferedVersion;
79 __u8 bMinVersion;
80 __u8 bMaxVersion;
81} __attribute__((__packed__));
82
83/* ------------------------------------------------------------------------
84 * Debugging, printing and logging 51 * Debugging, printing and logging
85 */ 52 */
86 53
@@ -137,9 +104,6 @@ extern unsigned int uvc_gadget_trace_param;
137#define UVC_MAX_REQUEST_SIZE 64 104#define UVC_MAX_REQUEST_SIZE 64
138#define UVC_MAX_EVENTS 4 105#define UVC_MAX_EVENTS 4
139 106
140#define USB_DT_INTERFACE_ASSOCIATION_SIZE 8
141#define USB_CLASS_MISC 0xef
142
143/* ------------------------------------------------------------------------ 107/* ------------------------------------------------------------------------
144 * Structures 108 * Structures
145 */ 109 */
diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c
index f5f3030cc416..288d21155abe 100644
--- a/drivers/usb/gadget/webcam.c
+++ b/drivers/usb/gadget/webcam.c
@@ -90,7 +90,7 @@ DECLARE_UVC_HEADER_DESCRIPTOR(1);
90static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = { 90static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
91 .bLength = UVC_DT_HEADER_SIZE(1), 91 .bLength = UVC_DT_HEADER_SIZE(1),
92 .bDescriptorType = USB_DT_CS_INTERFACE, 92 .bDescriptorType = USB_DT_CS_INTERFACE,
93 .bDescriptorSubType = UVC_DT_HEADER, 93 .bDescriptorSubType = UVC_VC_HEADER,
94 .bcdUVC = cpu_to_le16(0x0100), 94 .bcdUVC = cpu_to_le16(0x0100),
95 .wTotalLength = 0, /* dynamic */ 95 .wTotalLength = 0, /* dynamic */
96 .dwClockFrequency = cpu_to_le32(48000000), 96 .dwClockFrequency = cpu_to_le32(48000000),
@@ -101,7 +101,7 @@ static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
101static const struct uvc_camera_terminal_descriptor uvc_camera_terminal = { 101static const struct uvc_camera_terminal_descriptor uvc_camera_terminal = {
102 .bLength = UVC_DT_CAMERA_TERMINAL_SIZE(3), 102 .bLength = UVC_DT_CAMERA_TERMINAL_SIZE(3),
103 .bDescriptorType = USB_DT_CS_INTERFACE, 103 .bDescriptorType = USB_DT_CS_INTERFACE,
104 .bDescriptorSubType = UVC_DT_INPUT_TERMINAL, 104 .bDescriptorSubType = UVC_VC_INPUT_TERMINAL,
105 .bTerminalID = 1, 105 .bTerminalID = 1,
106 .wTerminalType = cpu_to_le16(0x0201), 106 .wTerminalType = cpu_to_le16(0x0201),
107 .bAssocTerminal = 0, 107 .bAssocTerminal = 0,
@@ -118,7 +118,7 @@ static const struct uvc_camera_terminal_descriptor uvc_camera_terminal = {
118static const struct uvc_processing_unit_descriptor uvc_processing = { 118static const struct uvc_processing_unit_descriptor uvc_processing = {
119 .bLength = UVC_DT_PROCESSING_UNIT_SIZE(2), 119 .bLength = UVC_DT_PROCESSING_UNIT_SIZE(2),
120 .bDescriptorType = USB_DT_CS_INTERFACE, 120 .bDescriptorType = USB_DT_CS_INTERFACE,
121 .bDescriptorSubType = UVC_DT_PROCESSING_UNIT, 121 .bDescriptorSubType = UVC_VC_PROCESSING_UNIT,
122 .bUnitID = 2, 122 .bUnitID = 2,
123 .bSourceID = 1, 123 .bSourceID = 1,
124 .wMaxMultiplier = cpu_to_le16(16*1024), 124 .wMaxMultiplier = cpu_to_le16(16*1024),
@@ -131,7 +131,7 @@ static const struct uvc_processing_unit_descriptor uvc_processing = {
131static const struct uvc_output_terminal_descriptor uvc_output_terminal = { 131static const struct uvc_output_terminal_descriptor uvc_output_terminal = {
132 .bLength = UVC_DT_OUTPUT_TERMINAL_SIZE, 132 .bLength = UVC_DT_OUTPUT_TERMINAL_SIZE,
133 .bDescriptorType = USB_DT_CS_INTERFACE, 133 .bDescriptorType = USB_DT_CS_INTERFACE,
134 .bDescriptorSubType = UVC_DT_OUTPUT_TERMINAL, 134 .bDescriptorSubType = UVC_VC_OUTPUT_TERMINAL,
135 .bTerminalID = 3, 135 .bTerminalID = 3,
136 .wTerminalType = cpu_to_le16(0x0101), 136 .wTerminalType = cpu_to_le16(0x0101),
137 .bAssocTerminal = 0, 137 .bAssocTerminal = 0,
@@ -144,7 +144,7 @@ DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(1, 2);
144static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = { 144static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
145 .bLength = UVC_DT_INPUT_HEADER_SIZE(1, 2), 145 .bLength = UVC_DT_INPUT_HEADER_SIZE(1, 2),
146 .bDescriptorType = USB_DT_CS_INTERFACE, 146 .bDescriptorType = USB_DT_CS_INTERFACE,
147 .bDescriptorSubType = UVC_DT_INPUT_HEADER, 147 .bDescriptorSubType = UVC_VS_INPUT_HEADER,
148 .bNumFormats = 2, 148 .bNumFormats = 2,
149 .wTotalLength = 0, /* dynamic */ 149 .wTotalLength = 0, /* dynamic */
150 .bEndpointAddress = 0, /* dynamic */ 150 .bEndpointAddress = 0, /* dynamic */
@@ -161,7 +161,7 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
161static const struct uvc_format_uncompressed uvc_format_yuv = { 161static const struct uvc_format_uncompressed uvc_format_yuv = {
162 .bLength = UVC_DT_FORMAT_UNCOMPRESSED_SIZE, 162 .bLength = UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
163 .bDescriptorType = USB_DT_CS_INTERFACE, 163 .bDescriptorType = USB_DT_CS_INTERFACE,
164 .bDescriptorSubType = UVC_DT_FORMAT_UNCOMPRESSED, 164 .bDescriptorSubType = UVC_VS_FORMAT_UNCOMPRESSED,
165 .bFormatIndex = 1, 165 .bFormatIndex = 1,
166 .bNumFrameDescriptors = 2, 166 .bNumFrameDescriptors = 2,
167 .guidFormat = 167 .guidFormat =
@@ -181,7 +181,7 @@ DECLARE_UVC_FRAME_UNCOMPRESSED(3);
181static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = { 181static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
182 .bLength = UVC_DT_FRAME_UNCOMPRESSED_SIZE(3), 182 .bLength = UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
183 .bDescriptorType = USB_DT_CS_INTERFACE, 183 .bDescriptorType = USB_DT_CS_INTERFACE,
184 .bDescriptorSubType = UVC_DT_FRAME_UNCOMPRESSED, 184 .bDescriptorSubType = UVC_VS_FRAME_UNCOMPRESSED,
185 .bFrameIndex = 1, 185 .bFrameIndex = 1,
186 .bmCapabilities = 0, 186 .bmCapabilities = 0,
187 .wWidth = cpu_to_le16(640), 187 .wWidth = cpu_to_le16(640),
@@ -199,7 +199,7 @@ static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
199static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = { 199static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
200 .bLength = UVC_DT_FRAME_UNCOMPRESSED_SIZE(1), 200 .bLength = UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
201 .bDescriptorType = USB_DT_CS_INTERFACE, 201 .bDescriptorType = USB_DT_CS_INTERFACE,
202 .bDescriptorSubType = UVC_DT_FRAME_UNCOMPRESSED, 202 .bDescriptorSubType = UVC_VS_FRAME_UNCOMPRESSED,
203 .bFrameIndex = 2, 203 .bFrameIndex = 2,
204 .bmCapabilities = 0, 204 .bmCapabilities = 0,
205 .wWidth = cpu_to_le16(1280), 205 .wWidth = cpu_to_le16(1280),
@@ -215,7 +215,7 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
215static const struct uvc_format_mjpeg uvc_format_mjpg = { 215static const struct uvc_format_mjpeg uvc_format_mjpg = {
216 .bLength = UVC_DT_FORMAT_MJPEG_SIZE, 216 .bLength = UVC_DT_FORMAT_MJPEG_SIZE,
217 .bDescriptorType = USB_DT_CS_INTERFACE, 217 .bDescriptorType = USB_DT_CS_INTERFACE,
218 .bDescriptorSubType = UVC_DT_FORMAT_MJPEG, 218 .bDescriptorSubType = UVC_VS_FORMAT_MJPEG,
219 .bFormatIndex = 2, 219 .bFormatIndex = 2,
220 .bNumFrameDescriptors = 2, 220 .bNumFrameDescriptors = 2,
221 .bmFlags = 0, 221 .bmFlags = 0,
@@ -232,7 +232,7 @@ DECLARE_UVC_FRAME_MJPEG(3);
232static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = { 232static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
233 .bLength = UVC_DT_FRAME_MJPEG_SIZE(3), 233 .bLength = UVC_DT_FRAME_MJPEG_SIZE(3),
234 .bDescriptorType = USB_DT_CS_INTERFACE, 234 .bDescriptorType = USB_DT_CS_INTERFACE,
235 .bDescriptorSubType = UVC_DT_FRAME_MJPEG, 235 .bDescriptorSubType = UVC_VS_FRAME_MJPEG,
236 .bFrameIndex = 1, 236 .bFrameIndex = 1,
237 .bmCapabilities = 0, 237 .bmCapabilities = 0,
238 .wWidth = cpu_to_le16(640), 238 .wWidth = cpu_to_le16(640),
@@ -250,7 +250,7 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
250static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = { 250static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
251 .bLength = UVC_DT_FRAME_MJPEG_SIZE(1), 251 .bLength = UVC_DT_FRAME_MJPEG_SIZE(1),
252 .bDescriptorType = USB_DT_CS_INTERFACE, 252 .bDescriptorType = USB_DT_CS_INTERFACE,
253 .bDescriptorSubType = UVC_DT_FRAME_MJPEG, 253 .bDescriptorSubType = UVC_VS_FRAME_MJPEG,
254 .bFrameIndex = 2, 254 .bFrameIndex = 2,
255 .bmCapabilities = 0, 255 .bmCapabilities = 0,
256 .wWidth = cpu_to_le16(1280), 256 .wWidth = cpu_to_le16(1280),
@@ -266,7 +266,7 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
266static const struct uvc_color_matching_descriptor uvc_color_matching = { 266static const struct uvc_color_matching_descriptor uvc_color_matching = {
267 .bLength = UVC_DT_COLOR_MATCHING_SIZE, 267 .bLength = UVC_DT_COLOR_MATCHING_SIZE,
268 .bDescriptorType = USB_DT_CS_INTERFACE, 268 .bDescriptorType = USB_DT_CS_INTERFACE,
269 .bDescriptorSubType = UVC_DT_COLOR_MATCHING, 269 .bDescriptorSubType = UVC_VS_COLORFORMAT,
270 .bColorPrimaries = 1, 270 .bColorPrimaries = 1,
271 .bTransferCharacteristics = 1, 271 .bTransferCharacteristics = 1,
272 .bMatrixCoefficients = 4, 272 .bMatrixCoefficients = 4,