xref: /openbsd/sys/dev/usb/uvideo.h (revision 5af055cd)
1 /*	$OpenBSD: uvideo.h,v 1.57 2015/07/09 14:58:32 mpi Exp $ */
2 
3 /*
4  * Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
5  * Copyright (c) 2008 Marcus Glocker <mglocker@openbsd.org>
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #include <sys/queue.h>
21 #include <sys/videoio.h>
22 
23 /*
24  * USB Video Class
25  */
26 /* Table A-7: Video Class-Specific Endpoint Descriptor Subtypes */
27 #define	EP_UNDEFINED					0x00
28 #define EP_GENERAL					0x01
29 #define EP_ENDPOINT					0x02
30 #define EP_INTERRUPT					0x03
31 
32 /* Table A-5: Video Class-Specific VC Interface Descriptor Subtypes */
33 #define	UDESCSUB_VC_DESCRIPTOR_UNDEFINED		0x00
34 #define UDESCSUB_VC_HEADER				0x01
35 #define UDESCSUB_VC_INPUT_TERMINAL			0x02
36 #define UDESCSUB_VC_OUTPUT_TERMINAL			0x03
37 #define UDESCSUB_VC_SELECTOR_UNIT			0x04
38 #define UDESCSUB_VC_PROCESSING_UNIT			0x05
39 #define UDESCSUB_VC_EXTENSION_UNIT			0x06
40 
41 /* Table A-6: Video Class-Specific VS Interface Descriptor Subtypes */
42 #define	UDESCSUB_VS_UNDEFINED				0x00
43 #define UDESCSUB_VS_INPUT_HEADER			0x01
44 #define UDESCSUB_VS_OUTPUT_HEADER			0x02
45 #define UDESCSUB_VS_STILL_IMAGE_FRAME			0x03
46 #define UDESCSUB_VS_FORMAT_UNCOMPRESSED			0x04
47 #define UDESCSUB_VS_FRAME_UNCOMPRESSED			0x05
48 #define UDESCSUB_VS_FORMAT_MJPEG			0x06
49 #define UDESCSUB_VS_FRAME_MJPEG				0x07
50 #define UDESCSUB_VS_FORMAT_MPEG2TS			0x0a
51 #define UDESCSUB_VS_FORMAT_DV				0x0c
52 #define UDESCSUB_VS_COLORFORMAT				0x0d
53 #define UDESCSUB_VS_FORMAT_FRAME_BASED			0x10
54 #define UDESCSUB_VS_FRAME_FRAME_BASED			0x11
55 #define UDESCSUB_VS_FORMAT_STREAM_BASED			0x12
56 
57 /* Table A-8: Video Class-Specific Request Codes */
58 #define RC_UNDEFINED					0x00
59 #define SET_CUR						0x01
60 #define GET_CUR						0x81
61 #define GET_MIN						0x82
62 #define GET_MAX						0x83
63 #define GET_RES						0x84
64 #define GET_LEN						0x85
65 #define GET_INFO					0x86
66 #define GET_DEF						0x87
67 
68 /* Table A-9: Video Control Interface Control Selectors */
69 #define VC_CONTROL_UNDEFINED				0x00
70 #define VC_VIDEO_POWER_MODE_CONTROL			0x01
71 #define VC_REQUEST_ERROR_CODE_CONTROL			0x02
72 
73 /* Table A-11: Selector Unit Control Selectors */
74 #define	SU_CONTROL_UNDEFINED				0x00
75 #define	SU_INPUT_SELECT_CONTROL				0x01
76 
77 /* Table A-12: Camera Terminal Control Selectors */
78 #define	CT_CONTROL_UNDEFINED				0x00
79 #define	CT_SCANNING_MODE_CONTROL			0x01
80 #define	CT_AE_MODE_CONTROL				0x02
81 #define	CT_AE_PRIORITY_CONTROL				0x03
82 #define	CT_EXPOSURE_TIME_ABSOLUTE_CONTROL		0x04
83 #define	CT_EXPOSURE_TIME_RELATIVE_CONTROL		0x05
84 #define	CT_FOCUS_ABSOLUTE_CONTROL			0x06
85 #define	CT_FOCUS_RELATIVE_CONTROL			0x07
86 #define	CT_FOCUS_AUTO_CONTROL				0x08
87 #define	CT_IRIS_ABSOLUTE_CONTROL			0x09
88 #define	CT_IRIS_RELATIVE_CONTROL			0x0a
89 #define	CT_ZOOM_ABSOLUTE_CONTROL			0x0b
90 #define	CT_ZOOM_RELATIVE_CONTROL			0x0c
91 #define	CT_PANTILT_ABSOLUTE_CONTROL			0x0d
92 #define	CT_PANTILT_RELATIVE_CONTROL			0x0e
93 #define	CT_ROLL_ABSOLUTE_CONTROL			0x0f
94 #define	CT_ROLL_RELATIVE_CONTROL			0x10
95 #define	CT_PRIVACY_CONTROL				0x11
96 
97 /* Table A-13: Processing Unit Control Selectors */
98 #define	PU_CONTROL_UNDEFINED				0x00
99 #define	PU_BACKLIGHT_COMPENSATION_CONTROL		0x01
100 #define	PU_BRIGHTNESS_CONTROL				0x02
101 #define	PU_CONTRAST_CONTROL				0x03
102 #define	PU_GAIN_CONTROL					0x04
103 #define	PU_POWER_LINE_FREQUENCY_CONTROL			0x05
104 #define	PU_HUE_CONTROL					0x06
105 #define	PU_SATURATION_CONTROL				0x07
106 #define	PU_SHARPNESS_CONTROL				0x08
107 #define	PU_GAMMA_CONTROL				0x09
108 #define	PU_WHITE_BALANCE_TEMPERATURE_CONTROL		0x0a
109 #define	PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL	0x0b
110 #define	PU_WHITE_BALANCE_COMPONENT_CONTROL		0x0c
111 #define	PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL		0x0d
112 #define	PU_DIGITAL_MULTIPLIER_CONTROL			0x0e
113 #define	PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL		0x0f
114 #define	PU_HUE_AUTO_CONTROL				0x10
115 #define	PU_ANALOG_VIDEO_STANDARD_CONTROL		0x11
116 #define	PU_ANALOG_LOCK_STATUS_CONTROL			0x12
117 
118 /* Table A-15: VideoStreaming Interface Control Selectors */
119 #define	VS_CONTROL_UNDEFINED				0x00
120 #define	VS_PROBE_CONTROL				0x01
121 #define	VS_COMMIT_CONTROL				0x02
122 #define	VS_STILL_PROBE_CONTROL				0x03
123 #define	VS_STILL_COMMIT_CONTROL				0x04
124 #define	VS_STILL_IMAGE_TRIGGER_CONTROL			0x05
125 #define	VS_STREAM_ERROR_CODE_CONTROL			0x06
126 #define	VS_GENERATE_KEY_FRAME_CONTROL			0x07
127 #define	VS_UPDATE_FRAME_SEGMENT_CONTROL			0x08
128 #define	VS_SYNC_DELAY_CONTROL				0x09
129 
130 /* probe commit bmRequests */
131 #define	UVIDEO_SET_IF					0x21
132 #define	UVIDEO_GET_IF					0xa1
133 #define	UVIDEO_SET_EP					0x22
134 #define	UVIDEO_GET_EP					0xa2
135 
136 /* Table B-1: USB Terminal Types */
137 #define	TT_VENDOR_SPECIFIC				0x0100
138 #define	TT_STREAMING					0x0101
139 
140 /* Table B-2: Input Terminal Types */
141 #define	ITT_VENDOR_SPECIFIC				0x0200
142 #define	ITT_CAMERA					0x0201
143 #define	ITT_MEDIA_TRANSPORT_INPUT			0x0202
144 
145 /* Table B-3: Output Terminal Types */
146 #define	OTT_VENDOR_SPECIFIC				0x0300
147 #define	OTT_DISPLAY					0x0301
148 #define	OTT_MEDIA_TRANSPORT_OUTPUT			0x0302
149 
150 /* Table B-4: External Terminal Types */
151 #define	EXTERNAL_VENDOR_SPECIFIC			0x0400
152 #define	COMPOSITE_CONNECTOR				0x0401
153 #define	SVIDEO_CONNECTOR				0x0402
154 #define	COMPONENT_CONNECTOR				0x0403
155 
156 /* Table 3-3: VC Interface Header Descriptor */
157 struct usb_video_header_desc {
158 	uByte	bLength;
159 	uByte	bDescriptorType;
160 	uByte	bDescriptorSubtype;
161 	uWord	bcdUVC;
162 	uWord	wTotalLength;
163 	uDWord	dwClockFrequency;
164 	uByte	bInCollection;
165 } __packed;
166 
167 struct usb_video_header_desc_all {
168 	struct usb_video_header_desc	*fix;
169 	uByte				*baInterfaceNr;
170 };
171 
172 /* Table 3-4: Input Terminal Descriptor */
173 struct usb_video_input_terminal_desc {
174 	uByte	bLength;
175 	uByte	bDescriptorType;
176 	uByte	bDescriptorSubtype;
177 	uByte	bTerminalID;
178 	uWord	wTerminalType;
179 	uByte	bAssocTerminal;
180 	uByte	iTerminal;
181 } __packed;
182 
183 /* Table 3-5: Output Terminal Descriptor */
184 struct usb_video_output_terminal_desc {
185 	uByte	bLength;
186 	uByte	bDescriptorType;
187 	uByte	bDescriptorSubtype;
188 	uByte	bTerminalID;
189 	uWord	wTerminalType;
190 	uByte	bAssocTerminal;
191 	uByte	bSourceID;
192 	uByte	iTerminal;
193 } __packed;
194 
195 /* Table 3-6: Camera Terminal Descriptor */
196 struct usb_video_camera_terminal_desc {
197 	uByte	bLength;
198 	uByte	bDescriptorType;
199 	uByte	bDescriptorSubtype;
200 	uByte	bTerminalID;
201 	uWord	wTerminalType;
202 	uByte	bAssocTerminal;
203 	uByte	iTerminal;
204 	uWord	wObjectiveFocalLengthMin;
205 	uWord	wObjectiveFocalLengthMax;
206 	uWord	wOcularFocalLength;
207 	uByte	bControlSize;
208 	uByte	*bmControls;
209 } __packed;
210 
211 /* Table 3-8: VC Processing Unit Descriptor */
212 struct usb_video_vc_processing_desc {
213 	uByte	bLength;
214 	uByte	bDescriptorType;
215 	uByte	bDescriptorSubtype;
216 	uByte	bUnitID;
217 	uByte	bSourceID;
218 	uWord	wMaxMultiplier;
219 	uByte	bControlSize;
220 	uByte	bmControls[255]; /* [bControlSize] */
221 	/* uByte iProcessing; */
222 	/* uByte bmVideoStandards; */
223 } __packed;
224 
225 /* Table 3-9: VC Extension Unit Descriptor */
226 struct usb_video_vc_extension_desc {
227 	uByte	bLength;
228 	uByte	bDescriptorType;
229 	uByte	bDescriptorSubtype;
230 	uByte	bUnitID;
231 	uByte	guidExtensionCode[16];
232 	uByte	bNumControls;
233 	uByte	bNrInPins;
234 } __packed;
235 
236 /* Table 3-11: VC Endpoint Descriptor */
237 struct usb_video_vc_endpoint_desc {
238 	uByte	bLength;
239 	uByte	bDescriptorType;
240 	uByte	bDescriptorSubtype;
241 	uWord	wMaxTransferSize;
242 } __packed;
243 
244 /* Table 3-13: Interface Input Header Descriptor */
245 struct usb_video_input_header_desc {
246 	uByte	bLength;
247 	uByte	bDescriptorType;
248 	uByte	bDescriptorSubtype;
249 	uByte	bNumFormats;
250 	uWord	wTotalLength;
251 	uByte	bEndpointAddress;
252 	uByte	bmInfo;
253 	uByte	bTerminalLink;
254 	uByte	bStillCaptureMethod;
255 	uByte	bTriggerSupport;
256 	uByte	bTriggerUsage;
257 	uByte	bControlSize;
258 } __packed;
259 
260 struct usb_video_input_header_desc_all {
261 	struct usb_video_input_header_desc	*fix;
262 	uByte					*bmaControls;
263 };
264 
265 /* Table 3-18: Color Matching Descriptor */
266 struct usb_video_color_matching_descr {
267 	uByte	bLength;
268 	uByte	bDescriptorType;
269 	uByte	bDescriptorSubtype;
270 	uByte	bColorPrimaries;
271 	uByte	bTransferCharacteristics;
272 	uByte	bMatrixCoefficients;
273 } __packed;
274 
275 /* Table 4-47: Video Probe and Commit Controls */
276 struct usb_video_probe_commit {
277 	uWord	bmHint;
278 	uByte	bFormatIndex;
279 	uByte	bFrameIndex;
280 	uDWord	dwFrameInterval;
281 	uWord	wKeyFrameRate;
282 	uWord	wPFrameRate;
283 	uWord	wCompQuality;
284 	uWord	wCompWindowSize;
285 	uWord	wDelay;
286 	uDWord	dwMaxVideoFrameSize;
287 	uDWord	dwMaxPayloadTransferSize;
288 	uDWord	dwClockFrequency;
289 	uByte	bmFramingInfo;
290 	uByte	bPreferedVersion;
291 	uByte	bMinVersion;
292 	uByte	bMaxVersion;
293 } __packed;
294 
295 /*
296  * USB Video Payload Uncompressed
297  */
298 /* Table 2-1: Compression Formats */
299 #define	UVIDEO_FORMAT_GUID_YUY2	{			\
300     0x59, 0x55, 0x59, 0x32, 0x00, 0x00, 0x10, 0x00,	\
301     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }
302 
303 #define	UVIDEO_FORMAT_GUID_NV12	{			\
304     0x4e, 0x56, 0x31, 0x32, 0x00, 0x00, 0x10, 0x00,	\
305     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38,	0x9b, 0x71 }
306 
307 #define	UVIDEO_FORMAT_GUID_UYVY	{			\
308     0x55, 0x59, 0x56, 0x59, 0x00, 0x00, 0x10, 0x00,	\
309     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38,	0x9b, 0x71 }
310 
311 /*
312  * USB Video Payload MJPEG
313  */
314 /* Table 2-1: Stream Header Format for the Motion-JPEG */
315 #define UVIDEO_SH_MAX_LEN	12
316 #define UVIDEO_SH_MIN_LEN	2
317 struct usb_video_stream_header {
318 	uByte	bLength;
319 	uByte	bFlags;
320 #define	UVIDEO_SH_FLAG_FID	(1 << 0)
321 #define	UVIDEO_SH_FLAG_EOF	(1 << 1)
322 #define	UVIDEO_SH_FLAG_PTS	(1 << 2)
323 #define	UVIDEO_SH_FLAG_SCR	(1 << 3)
324 #define	UVIDEO_SH_FLAG_RES	(1 << 4)
325 #define	UVIDEO_SH_FLAG_STI	(1 << 5)
326 #define	UVIDEO_SH_FLAG_ERR	(1 << 6)
327 #define	UVIDEO_SH_FLAG_EOH	(1 << 7)
328 	/* TODO complete struct */
329 } __packed;
330 
331 /* Table 3-1: Motion-JPEG Video Format Descriptor */
332 struct usb_video_format_mjpeg_desc {
333 	uByte	bLength;
334 	uByte	bDescriptorType;
335 	uByte	bDescriptorSubtype;
336 	uByte	bFormatIndex;
337 	uByte	bNumFrameDescriptors;
338 	uByte	bmFlags;
339 	uByte	bDefaultFrameIndex;
340 	uByte	bAspectRatioX;
341 	uByte	bAspectRatioY;
342 	uByte	bmInterlaceFlags;
343 	uByte	bCopyProtect;
344 } __packed;
345 
346 /* Table 3-2: Video Frame Descriptor (same for mjpeg and uncompressed)*/
347 struct usb_video_frame_desc {
348 	uByte	bLength;
349 	uByte	bDescriptorType;
350 	uByte	bDescriptorSubtype;
351 	uByte	bFrameIndex;
352 	uByte	bmCapabilities;
353 	uWord	wWidth;
354 	uWord	wHeight;
355 	uDWord	dwMinBitRate;
356 	uDWord	dwMaxBitRate;
357 	uDWord	dwMaxVideoFrameBufferSize;
358 	uDWord	dwDefaultFrameInterval;
359 	uByte	bFrameIntervalType;
360 	/* uDWord ivals[]; frame intervals, length varies */
361 } __packed;
362 
363 /*
364  * USB Video Payload Uncompressed
365  */
366 /* Table 3-1: Uncompressed Video Format Descriptor */
367 struct usb_video_format_uncompressed_desc {
368 	uByte	bLength;
369 	uByte	bDescriptorType;
370 	uByte	bDescriptorSubtype;
371 	uByte	bFormatIndex;
372 	uByte	bNumFrameDescriptors;
373 	uByte	guidFormat[16];
374 	uByte	bBitsPerPixel;
375 	uByte	bDefaultFrameIndex;
376 	uByte	bAspectRatioX;
377 	uByte	bAspectRatioY;
378 	uByte	bmInterlaceFlags;
379 	uByte	bCopyProtect;
380 } __packed;
381 
382 /*
383  * Driver specific private definitions.
384  */
385 struct uvideo_format_desc {
386 	uByte	bLength;
387 	uByte	bDescriptorType;
388 	uByte	bDescriptorSubtype;
389 	uByte	bFormatIndex;
390 	uByte	bNumFrameDescriptors;
391 	union {
392 		/* mjpeg */
393 		struct {
394 			uByte	bmFlags;
395 			uByte	bDefaultFrameIndex;
396 			uByte	bAspectRatioX;
397 			uByte	bAspectRatioY;
398 			uByte	bmInterlaceFlags;
399 			uByte	bCopyProtect;
400 		} mjpeg;
401 
402 		/* uncompressed */
403 		struct {
404 			uByte	guidFormat[16];
405 			uByte	bBitsPerPixel;
406 			uByte	bDefaultFrameIndex;
407 			uByte	bAspectRatioX;
408 			uByte	bAspectRatioY;
409 			uByte	bmInterlaceFlags;
410 			uByte	bCopyProtect;
411 		} uc;
412 	} u;
413 } __packed;
414 
415 #define UVIDEO_NFRAMES_MAX	40
416 struct uvideo_isoc_xfer {
417 	struct uvideo_softc	*sc;
418 	struct usbd_xfer	*xfer;
419 	void			*buf;
420 	uint16_t		 size[UVIDEO_NFRAMES_MAX];
421 };
422 
423 struct uvideo_bulk_xfer {
424 	struct uvideo_softc	*sc;
425 	struct usbd_xfer	*xfer;
426 	void			*buf;
427 	uint16_t		 size;
428 };
429 
430 #define UVIDEO_IXFERS		3
431 struct uvideo_vs_iface {
432 	struct usbd_interface	*ifaceh;
433 	struct usbd_pipe	*pipeh;
434 	int			 iface;
435 	int			 numalts;
436 	int			 curalt;
437 	int			 endpoint;
438 	uint32_t		 psize;
439 	int			 bulk_endpoint;
440 	int			 bulk_running;
441 	struct uvideo_isoc_xfer	 ixfer[UVIDEO_IXFERS];
442 	struct uvideo_bulk_xfer	 bxfer;
443 };
444 
445 struct uvideo_frame_buffer {
446 	int		 sample;
447 	uint8_t		 fid;
448 	int		 offset;
449 	int		 buf_size;
450 	uint8_t		*buf;
451 	uint32_t	 fmt_flags;
452 };
453 
454 #define UVIDEO_MAX_BUFFERS	32
455 struct uvideo_mmap {
456 	SIMPLEQ_ENTRY(uvideo_mmap)	q_frames;
457 	uint8_t				*buf;
458 	struct v4l2_buffer		 v4l2_buf;
459 };
460 typedef SIMPLEQ_HEAD(, uvideo_mmap) q_mmap;
461 
462 struct uvideo_format_group {
463 	uint32_t				 pixelformat;
464 	uint8_t					 format_dfidx;
465 	struct uvideo_format_desc		*format;
466 	/* frame descriptors for mjpeg and uncompressed are identical */
467 #define UVIDEO_MAX_FRAME			 32
468 	struct usb_video_frame_desc		*frame_cur;
469 	struct usb_video_frame_desc		*frame[UVIDEO_MAX_FRAME];
470 	int					 frame_num;
471 };
472 
473 struct uvideo_res {
474 	int width;
475 	int height;
476 	int fidx;
477 };
478 
479 struct uvideo_controls {
480 	int		cid;
481 	int		type;
482 	char		name[32];
483 	uint8_t         ctrl_bit;
484 	uint16_t	ctrl_selector;
485 	uint16_t	ctrl_len;
486 	int		sig;
487 } uvideo_ctrls[] = {
488         /*
489          * Processing Unit Controls
490          */
491 	{
492 	    V4L2_CID_BRIGHTNESS,
493 	    V4L2_CTRL_TYPE_INTEGER,
494 	    "Brightness",
495 	    0,
496 	    PU_BRIGHTNESS_CONTROL,
497 	    2,
498 	    1
499 	},
500 	{
501 	    V4L2_CID_CONTRAST,
502 	    V4L2_CTRL_TYPE_INTEGER,
503 	    "Contrast",
504 	    1,
505 	    PU_CONTRAST_CONTROL,
506 	    2,
507 	    0
508 	},
509 	{
510 	    V4L2_CID_HUE,
511 	    V4L2_CTRL_TYPE_INTEGER,
512 	    "Hue",
513 	    2,
514 	    PU_HUE_CONTROL,
515 	    2,
516 	    1
517 	},
518 	{
519 	    V4L2_CID_SATURATION,
520 	    V4L2_CTRL_TYPE_INTEGER,
521 	    "Saturation",
522 	    3,
523 	    PU_SATURATION_CONTROL,
524 	    2,
525 	    0
526 	},
527 	{
528 	    V4L2_CID_SHARPNESS,
529 	    V4L2_CTRL_TYPE_INTEGER,
530 	    "Sharpness",
531 	    4,
532 	    PU_SHARPNESS_CONTROL,
533 	    2,
534 	    0
535 	},
536 	{
537 	    V4L2_CID_GAMMA,
538 	    V4L2_CTRL_TYPE_INTEGER,
539 	    "Gamma",
540 	    5,
541 	    PU_GAMMA_CONTROL,
542 	    2,
543 	    0
544 	},
545 	{
546 	    V4L2_CID_WHITE_BALANCE_TEMPERATURE,
547 	    V4L2_CTRL_TYPE_INTEGER,
548 	    "White Balance Temperature",
549 	    6,
550 	    PU_WHITE_BALANCE_TEMPERATURE_CONTROL,
551 	    2,
552 	    0
553 	},
554 #if 0
555         /* XXX Two V4L2 ids mapping one UVC control */
556 	{
557 	    V4L2_CID_RED_BALANCE, /* V4L2_CID_BLUE_BALANCE */
558 	    V4L2_CTRL_TYPE_INTEGER,
559 	    "White Balance Red Component", /* Blue Component */
560 	    7,
561 	    PU_WHITE_BALANCE_COMPONENT_CONTROL,
562 	    4,
563 	    0
564 	},
565 #endif
566         {
567             V4L2_CID_BACKLIGHT_COMPENSATION,
568             V4L2_CTRL_TYPE_INTEGER,
569             "Backlight Compensation",
570             8,
571             PU_BACKLIGHT_COMPENSATION_CONTROL,
572             2,
573 	    0
574         },
575 	{
576 	    V4L2_CID_GAIN,
577 	    V4L2_CTRL_TYPE_INTEGER,
578 	    "Gain",
579 	    9,
580 	    PU_GAIN_CONTROL,
581 	    2,
582 	    0
583 	},
584         {
585             V4L2_CID_POWER_LINE_FREQUENCY,
586             V4L2_CTRL_TYPE_MENU,
587             "Power Line Frequency",
588             10,
589             PU_POWER_LINE_FREQUENCY_CONTROL,
590             2,
591 	    0
592         },
593         {
594             V4L2_CID_HUE_AUTO,
595             V4L2_CTRL_TYPE_BOOLEAN,
596             "Hue Auto",
597             11,
598             PU_HUE_AUTO_CONTROL,
599             1,
600 	    0
601         },
602         {
603             V4L2_CID_AUTO_WHITE_BALANCE,
604             V4L2_CTRL_TYPE_BOOLEAN,
605             "White Balance Temperature Auto",
606             12,
607             PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL,
608             1,
609 	    0
610         },
611         {
612             V4L2_CID_AUTO_WHITE_BALANCE,
613             V4L2_CTRL_TYPE_BOOLEAN,
614             "White Balance Component Auto",
615             13,
616             PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL,
617             1,
618 	    0
619         },
620 #if 0
621         /* XXX No V4L2 CID for these controls? */
622         {
623             V4L2_CID_XXX,
624             V4L2_CTRL_TYPE_INTEGER,
625             "Digital Multiplier",
626             14,
627             PU_DIGITAL_MULTIPLIER_CONTROL,
628             2,
629 	    0
630         },
631         {
632             V4L2_CID_XXX,
633             V4L2_CTRL_TYPE_INTEGER,
634             "Digital Multiplier Limit",
635             15,
636             PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL,
637             2,
638 	    0
639         },
640         {
641             V4L2_CID_XXX,
642             V4L2_CTRL_TYPE_INTEGER,
643             "Analog Video Standard",
644             16,
645             PU_ANALOG_VIDEO_STANDARD_CONTROL,
646             1,
647 	    0
648         },
649         {
650             V4L2_CID_XXX,
651             V4L2_CTRL_TYPE_INTEGER,
652             "Analog Lock Status",
653             17,
654             PU_ANALOG_LOCK_STATUS_CONTROL,
655             1,
656 	    0
657         },
658 #endif
659 	{ 0, 0, "", 0, 0, 0, 0 }
660 };
661