RT-AC66 3.0.0.4.374.130 core
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / drivers / media / video / uvc / uvcvideo.h
blobb8a49a6950a33845ce5cf14e5c66ac2e90d5a5dc
1 #ifndef _USB_VIDEO_H_
2 #define _USB_VIDEO_H_
4 #include <linux/kernel.h>
5 #include <linux/videodev2.h>
7 /*
8 * Dynamic controls
9 */
11 /* Data types for UVC control data */
12 #define UVC_CTRL_DATA_TYPE_RAW 0
13 #define UVC_CTRL_DATA_TYPE_SIGNED 1
14 #define UVC_CTRL_DATA_TYPE_UNSIGNED 2
15 #define UVC_CTRL_DATA_TYPE_BOOLEAN 3
16 #define UVC_CTRL_DATA_TYPE_ENUM 4
17 #define UVC_CTRL_DATA_TYPE_BITMASK 5
19 /* Control flags */
20 #define UVC_CONTROL_SET_CUR (1 << 0)
21 #define UVC_CONTROL_GET_CUR (1 << 1)
22 #define UVC_CONTROL_GET_MIN (1 << 2)
23 #define UVC_CONTROL_GET_MAX (1 << 3)
24 #define UVC_CONTROL_GET_RES (1 << 4)
25 #define UVC_CONTROL_GET_DEF (1 << 5)
26 /* Control should be saved at suspend and restored at resume. */
27 #define UVC_CONTROL_RESTORE (1 << 6)
28 /* Control can be updated by the camera. */
29 #define UVC_CONTROL_AUTO_UPDATE (1 << 7)
30 /* Control is an extension unit control. */
31 #define UVC_CONTROL_EXTENSION (1 << 8)
33 #define UVC_CONTROL_GET_RANGE (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \
34 UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \
35 UVC_CONTROL_GET_DEF)
37 struct uvc_xu_control_info {
38 __u8 entity[16];
39 __u8 index;
40 __u8 selector;
41 __u16 size;
42 __u32 flags;
45 struct uvc_menu_info {
46 __u32 value;
47 __u8 name[32];
50 struct uvc_xu_control_mapping_old {
51 __u8 reserved[64];
54 struct uvc_xu_control_mapping {
55 __u32 id;
56 __u8 name[32];
57 __u8 entity[16];
58 __u8 selector;
60 __u8 size;
61 __u8 offset;
62 enum v4l2_ctrl_type v4l2_type;
63 __u32 data_type;
65 struct uvc_menu_info __user *menu_info;
66 __u32 menu_count;
68 __u32 reserved[4];
71 struct uvc_xu_control {
72 __u8 unit;
73 __u8 selector;
74 __u16 size;
75 __u8 __user *data;
78 #define UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info)
79 #define UVCIOC_CTRL_MAP_OLD _IOWR('U', 2, struct uvc_xu_control_mapping_old)
80 #define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping)
81 #define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control)
82 #define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control)
84 #ifdef __KERNEL__
86 #include <linux/poll.h>
87 #include <linux/usb/video.h>
89 /* --------------------------------------------------------------------------
90 * UVC constants
93 #define UVC_TERM_INPUT 0x0000
94 #define UVC_TERM_OUTPUT 0x8000
95 #define UVC_TERM_DIRECTION(term) ((term)->type & 0x8000)
97 #define UVC_ENTITY_TYPE(entity) ((entity)->type & 0x7fff)
98 #define UVC_ENTITY_IS_UNIT(entity) (((entity)->type & 0xff00) == 0)
99 #define UVC_ENTITY_IS_TERM(entity) (((entity)->type & 0xff00) != 0)
100 #define UVC_ENTITY_IS_ITERM(entity) \
101 (UVC_ENTITY_IS_TERM(entity) && \
102 ((entity)->type & 0x8000) == UVC_TERM_INPUT)
103 #define UVC_ENTITY_IS_OTERM(entity) \
104 (UVC_ENTITY_IS_TERM(entity) && \
105 ((entity)->type & 0x8000) == UVC_TERM_OUTPUT)
108 /* ------------------------------------------------------------------------
109 * GUIDs
111 #define UVC_GUID_UVC_CAMERA \
112 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
113 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
114 #define UVC_GUID_UVC_OUTPUT \
115 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
116 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}
117 #define UVC_GUID_UVC_MEDIA_TRANSPORT_INPUT \
118 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
119 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}
120 #define UVC_GUID_UVC_PROCESSING \
121 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
122 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01}
123 #define UVC_GUID_UVC_SELECTOR \
124 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
125 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02}
127 #define UVC_GUID_FORMAT_MJPEG \
128 { 'M', 'J', 'P', 'G', 0x00, 0x00, 0x10, 0x00, \
129 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
130 #define UVC_GUID_FORMAT_YUY2 \
131 { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \
132 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
133 #define UVC_GUID_FORMAT_YUY2_ISIGHT \
134 { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \
135 0x80, 0x00, 0x00, 0x00, 0x00, 0x38, 0x9b, 0x71}
136 #define UVC_GUID_FORMAT_NV12 \
137 { 'N', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \
138 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
139 #define UVC_GUID_FORMAT_YV12 \
140 { 'Y', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \
141 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
142 #define UVC_GUID_FORMAT_I420 \
143 { 'I', '4', '2', '0', 0x00, 0x00, 0x10, 0x00, \
144 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
145 #define UVC_GUID_FORMAT_UYVY \
146 { 'U', 'Y', 'V', 'Y', 0x00, 0x00, 0x10, 0x00, \
147 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
148 #define UVC_GUID_FORMAT_Y800 \
149 { 'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, \
150 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
151 #define UVC_GUID_FORMAT_Y16 \
152 { 'Y', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \
153 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
154 #define UVC_GUID_FORMAT_BY8 \
155 { 'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, \
156 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
157 #define UVC_GUID_FORMAT_RGBP \
158 { 'R', 'G', 'B', 'P', 0x00, 0x00, 0x10, 0x00, \
159 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
161 /* ------------------------------------------------------------------------
162 * Driver specific constants.
165 #define DRIVER_VERSION_NUMBER KERNEL_VERSION(0, 1, 0)
167 /* Number of isochronous URBs. */
168 #define UVC_URBS 5
169 /* Maximum number of packets per URB. */
170 #define UVC_MAX_PACKETS 32
171 /* Maximum number of video buffers. */
172 #define UVC_MAX_VIDEO_BUFFERS 32
173 /* Maximum status buffer size in bytes of interrupt URB. */
174 #define UVC_MAX_STATUS_SIZE 16
176 #define UVC_CTRL_CONTROL_TIMEOUT 300
177 #define UVC_CTRL_STREAMING_TIMEOUT 5000
179 /* Devices quirks */
180 #define UVC_QUIRK_STATUS_INTERVAL 0x00000001
181 #define UVC_QUIRK_PROBE_MINMAX 0x00000002
182 #define UVC_QUIRK_PROBE_EXTRAFIELDS 0x00000004
183 #define UVC_QUIRK_BUILTIN_ISIGHT 0x00000008
184 #define UVC_QUIRK_STREAM_NO_FID 0x00000010
185 #define UVC_QUIRK_IGNORE_SELECTOR_UNIT 0x00000020
186 #define UVC_QUIRK_FIX_BANDWIDTH 0x00000080
187 #define UVC_QUIRK_PROBE_DEF 0x00000100
189 /* Format flags */
190 #define UVC_FMT_FLAG_COMPRESSED 0x00000001
191 #define UVC_FMT_FLAG_STREAM 0x00000002
193 /* ------------------------------------------------------------------------
194 * Structures.
197 struct uvc_device;
199 /* TODO: Put the most frequently accessed fields at the beginning of
200 * structures to maximize cache efficiency.
202 struct uvc_control_info {
203 struct list_head list;
204 struct list_head mappings;
206 __u8 entity[16];
207 __u8 index;
208 __u8 selector;
210 __u16 size;
211 __u32 flags;
214 struct uvc_control_mapping {
215 struct list_head list;
217 struct uvc_control_info *ctrl;
219 __u32 id;
220 __u8 name[32];
221 __u8 entity[16];
222 __u8 selector;
224 __u8 size;
225 __u8 offset;
226 enum v4l2_ctrl_type v4l2_type;
227 __u32 data_type;
229 struct uvc_menu_info *menu_info;
230 __u32 menu_count;
232 __s32 (*get) (struct uvc_control_mapping *mapping, __u8 query,
233 const __u8 *data);
234 void (*set) (struct uvc_control_mapping *mapping, __s32 value,
235 __u8 *data);
238 struct uvc_control {
239 struct uvc_entity *entity;
240 struct uvc_control_info *info;
242 __u8 index; /* Used to match the uvc_control entry with a
243 uvc_control_info. */
244 __u8 dirty : 1,
245 loaded : 1,
246 modified : 1,
247 cached : 1;
249 __u8 *uvc_data;
250 __u8 *uvc_info;
253 struct uvc_format_desc {
254 char *name;
255 __u8 guid[16];
256 __u32 fcc;
259 /* The term 'entity' refers to both UVC units and UVC terminals.
261 * The type field is either the terminal type (wTerminalType in the terminal
262 * descriptor), or the unit type (bDescriptorSubtype in the unit descriptor).
263 * As the bDescriptorSubtype field is one byte long, the type value will
264 * always have a null MSB for units. All terminal types defined by the UVC
265 * specification have a non-null MSB, so it is safe to use the MSB to
266 * differentiate between units and terminals as long as the descriptor parsing
267 * code makes sure terminal types have a non-null MSB.
269 * For terminals, the type's most significant bit stores the terminal
270 * direction (either UVC_TERM_INPUT or UVC_TERM_OUTPUT). The type field should
271 * always be accessed with the UVC_ENTITY_* macros and never directly.
274 struct uvc_entity {
275 struct list_head list; /* Entity as part of a UVC device. */
276 struct list_head chain; /* Entity as part of a video device
277 * chain. */
278 __u8 id;
279 __u16 type;
280 char name[64];
282 union {
283 struct {
284 __u16 wObjectiveFocalLengthMin;
285 __u16 wObjectiveFocalLengthMax;
286 __u16 wOcularFocalLength;
287 __u8 bControlSize;
288 __u8 *bmControls;
289 } camera;
291 struct {
292 __u8 bControlSize;
293 __u8 *bmControls;
294 __u8 bTransportModeSize;
295 __u8 *bmTransportModes;
296 } media;
298 struct {
299 } output;
301 struct {
302 __u16 wMaxMultiplier;
303 __u8 bControlSize;
304 __u8 *bmControls;
305 __u8 bmVideoStandards;
306 } processing;
308 struct {
309 } selector;
311 struct {
312 __u8 guidExtensionCode[16];
313 __u8 bNumControls;
314 __u8 bControlSize;
315 __u8 *bmControls;
316 __u8 *bmControlsType;
317 } extension;
320 __u8 bNrInPins;
321 __u8 *baSourceID;
323 unsigned int ncontrols;
324 struct uvc_control *controls;
327 struct uvc_frame {
328 __u8 bFrameIndex;
329 __u8 bmCapabilities;
330 __u16 wWidth;
331 __u16 wHeight;
332 __u32 dwMinBitRate;
333 __u32 dwMaxBitRate;
334 __u32 dwMaxVideoFrameBufferSize;
335 __u8 bFrameIntervalType;
336 __u32 dwDefaultFrameInterval;
337 __u32 *dwFrameInterval;
340 struct uvc_format {
341 __u8 type;
342 __u8 index;
343 __u8 bpp;
344 __u8 colorspace;
345 __u32 fcc;
346 __u32 flags;
348 char name[32];
350 unsigned int nframes;
351 struct uvc_frame *frame;
354 struct uvc_streaming_header {
355 __u8 bNumFormats;
356 __u8 bEndpointAddress;
357 __u8 bTerminalLink;
358 __u8 bControlSize;
359 __u8 *bmaControls;
360 /* The following fields are used by input headers only. */
361 __u8 bmInfo;
362 __u8 bStillCaptureMethod;
363 __u8 bTriggerSupport;
364 __u8 bTriggerUsage;
367 enum uvc_buffer_state {
368 UVC_BUF_STATE_IDLE = 0,
369 UVC_BUF_STATE_QUEUED = 1,
370 UVC_BUF_STATE_ACTIVE = 2,
371 UVC_BUF_STATE_READY = 3,
372 UVC_BUF_STATE_DONE = 4,
373 UVC_BUF_STATE_ERROR = 5,
376 struct uvc_buffer {
377 unsigned long vma_use_count;
378 struct list_head stream;
380 /* Touched by interrupt handler. */
381 struct v4l2_buffer buf;
382 struct list_head queue;
383 wait_queue_head_t wait;
384 enum uvc_buffer_state state;
385 unsigned int error;
388 #define UVC_QUEUE_STREAMING (1 << 0)
389 #define UVC_QUEUE_DISCONNECTED (1 << 1)
390 #define UVC_QUEUE_DROP_CORRUPTED (1 << 2)
392 struct uvc_video_queue {
393 enum v4l2_buf_type type;
395 void *mem;
396 unsigned int flags;
397 __u32 sequence;
399 unsigned int count;
400 unsigned int buf_size;
401 unsigned int buf_used;
402 struct uvc_buffer buffer[UVC_MAX_VIDEO_BUFFERS];
403 struct mutex mutex; /* protects buffers and mainqueue */
404 spinlock_t irqlock; /* protects irqqueue */
406 struct list_head mainqueue;
407 struct list_head irqqueue;
410 struct uvc_video_chain {
411 struct uvc_device *dev;
412 struct list_head list;
414 struct list_head entities; /* All entities */
415 struct uvc_entity *processing; /* Processing unit */
416 struct uvc_entity *selector; /* Selector unit */
418 struct mutex ctrl_mutex;
421 struct uvc_streaming {
422 struct list_head list;
423 struct uvc_device *dev;
424 struct video_device *vdev;
425 struct uvc_video_chain *chain;
426 atomic_t active;
428 struct usb_interface *intf;
429 int intfnum;
430 __u16 maxpsize;
432 struct uvc_streaming_header header;
433 enum v4l2_buf_type type;
435 unsigned int nformats;
436 struct uvc_format *format;
438 struct uvc_streaming_control ctrl;
439 struct uvc_format *cur_format;
440 struct uvc_frame *cur_frame;
442 struct mutex mutex;
444 unsigned int frozen : 1;
445 struct uvc_video_queue queue;
446 void (*decode) (struct urb *urb, struct uvc_streaming *video,
447 struct uvc_buffer *buf);
449 /* Context data used by the bulk completion handler. */
450 struct {
451 __u8 header[256];
452 unsigned int header_size;
453 int skip_payload;
454 __u32 payload_size;
455 __u32 max_payload_size;
456 } bulk;
458 struct urb *urb[UVC_URBS];
459 char *urb_buffer[UVC_URBS];
460 dma_addr_t urb_dma[UVC_URBS];
461 unsigned int urb_size;
463 __u8 last_fid;
466 enum uvc_device_state {
467 UVC_DEV_DISCONNECTED = 1,
470 struct uvc_device {
471 struct usb_device *udev;
472 struct usb_interface *intf;
473 unsigned long warnings;
474 __u32 quirks;
475 int intfnum;
476 char name[32];
478 enum uvc_device_state state;
479 struct list_head list;
480 atomic_t users;
482 /* Video control interface */
483 __u16 uvc_version;
484 __u32 clock_frequency;
486 struct list_head entities;
487 struct list_head chains;
489 /* Video Streaming interfaces */
490 struct list_head streams;
491 atomic_t nstreams;
493 /* Status Interrupt Endpoint */
494 struct usb_host_endpoint *int_ep;
495 struct urb *int_urb;
496 __u8 *status;
497 struct input_dev *input;
498 char input_phys[64];
501 enum uvc_handle_state {
502 UVC_HANDLE_PASSIVE = 0,
503 UVC_HANDLE_ACTIVE = 1,
506 struct uvc_fh {
507 struct uvc_video_chain *chain;
508 struct uvc_streaming *stream;
509 enum uvc_handle_state state;
512 struct uvc_driver {
513 struct usb_driver driver;
515 struct list_head devices; /* struct uvc_device list */
516 struct list_head controls; /* struct uvc_control_info list */
517 struct mutex ctrl_mutex; /* protects controls and devices
518 lists */
521 /* ------------------------------------------------------------------------
522 * Debugging, printing and logging
525 #define UVC_TRACE_PROBE (1 << 0)
526 #define UVC_TRACE_DESCR (1 << 1)
527 #define UVC_TRACE_CONTROL (1 << 2)
528 #define UVC_TRACE_FORMAT (1 << 3)
529 #define UVC_TRACE_CAPTURE (1 << 4)
530 #define UVC_TRACE_CALLS (1 << 5)
531 #define UVC_TRACE_IOCTL (1 << 6)
532 #define UVC_TRACE_FRAME (1 << 7)
533 #define UVC_TRACE_SUSPEND (1 << 8)
534 #define UVC_TRACE_STATUS (1 << 9)
535 #define UVC_TRACE_VIDEO (1 << 10)
537 #define UVC_WARN_MINMAX 0
538 #define UVC_WARN_PROBE_DEF 1
540 extern unsigned int uvc_clock_param;
541 extern unsigned int uvc_no_drop_param;
542 extern unsigned int uvc_trace_param;
543 extern unsigned int uvc_timeout_param;
545 #define uvc_trace(flag, msg...) \
546 do { \
547 if (uvc_trace_param & flag) \
548 printk(KERN_DEBUG "uvcvideo: " msg); \
549 } while (0)
551 #define uvc_warn_once(dev, warn, msg...) \
552 do { \
553 if (!test_and_set_bit(warn, &dev->warnings)) \
554 printk(KERN_INFO "uvcvideo: " msg); \
555 } while (0)
557 #define uvc_printk(level, msg...) \
558 printk(level "uvcvideo: " msg)
560 /* --------------------------------------------------------------------------
561 * Internal functions.
564 /* Core driver */
565 extern struct uvc_driver uvc_driver;
567 /* Video buffers queue management. */
568 extern void uvc_queue_init(struct uvc_video_queue *queue,
569 enum v4l2_buf_type type, int drop_corrupted);
570 extern int uvc_alloc_buffers(struct uvc_video_queue *queue,
571 unsigned int nbuffers, unsigned int buflength);
572 extern int uvc_free_buffers(struct uvc_video_queue *queue);
573 extern int uvc_query_buffer(struct uvc_video_queue *queue,
574 struct v4l2_buffer *v4l2_buf);
575 extern int uvc_queue_buffer(struct uvc_video_queue *queue,
576 struct v4l2_buffer *v4l2_buf);
577 extern int uvc_dequeue_buffer(struct uvc_video_queue *queue,
578 struct v4l2_buffer *v4l2_buf, int nonblocking);
579 extern int uvc_queue_enable(struct uvc_video_queue *queue, int enable);
580 extern void uvc_queue_cancel(struct uvc_video_queue *queue, int disconnect);
581 extern struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue,
582 struct uvc_buffer *buf);
583 extern unsigned int uvc_queue_poll(struct uvc_video_queue *queue,
584 struct file *file, poll_table *wait);
585 extern int uvc_queue_allocated(struct uvc_video_queue *queue);
586 static inline int uvc_queue_streaming(struct uvc_video_queue *queue)
588 return queue->flags & UVC_QUEUE_STREAMING;
591 /* V4L2 interface */
592 extern const struct v4l2_file_operations uvc_fops;
594 /* Video */
595 extern int uvc_video_init(struct uvc_streaming *stream);
596 extern int uvc_video_suspend(struct uvc_streaming *stream);
597 extern int uvc_video_resume(struct uvc_streaming *stream);
598 extern int uvc_video_enable(struct uvc_streaming *stream, int enable);
599 extern int uvc_probe_video(struct uvc_streaming *stream,
600 struct uvc_streaming_control *probe);
601 extern int uvc_commit_video(struct uvc_streaming *stream,
602 struct uvc_streaming_control *ctrl);
603 extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit,
604 __u8 intfnum, __u8 cs, void *data, __u16 size);
606 /* Status */
607 extern int uvc_status_init(struct uvc_device *dev);
608 extern void uvc_status_cleanup(struct uvc_device *dev);
609 extern int uvc_status_start(struct uvc_device *dev);
610 extern void uvc_status_stop(struct uvc_device *dev);
611 extern int uvc_status_suspend(struct uvc_device *dev);
612 extern int uvc_status_resume(struct uvc_device *dev);
614 /* Controls */
615 extern struct uvc_control *uvc_find_control(struct uvc_video_chain *chain,
616 __u32 v4l2_id, struct uvc_control_mapping **mapping);
617 extern int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
618 struct v4l2_queryctrl *v4l2_ctrl);
620 extern int uvc_ctrl_add_info(struct uvc_control_info *info);
621 extern int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping);
622 extern int uvc_ctrl_init_device(struct uvc_device *dev);
623 extern void uvc_ctrl_cleanup_device(struct uvc_device *dev);
624 extern int uvc_ctrl_resume_device(struct uvc_device *dev);
625 extern void uvc_ctrl_init(void);
626 extern void uvc_ctrl_cleanup(void);
628 extern int uvc_ctrl_begin(struct uvc_video_chain *chain);
629 extern int __uvc_ctrl_commit(struct uvc_video_chain *chain, int rollback);
630 static inline int uvc_ctrl_commit(struct uvc_video_chain *chain)
632 return __uvc_ctrl_commit(chain, 0);
634 static inline int uvc_ctrl_rollback(struct uvc_video_chain *chain)
636 return __uvc_ctrl_commit(chain, 1);
639 extern int uvc_ctrl_get(struct uvc_video_chain *chain,
640 struct v4l2_ext_control *xctrl);
641 extern int uvc_ctrl_set(struct uvc_video_chain *chain,
642 struct v4l2_ext_control *xctrl);
644 extern int uvc_xu_ctrl_query(struct uvc_video_chain *chain,
645 struct uvc_xu_control *ctrl, int set);
647 /* Utility functions */
648 extern void uvc_simplify_fraction(uint32_t *numerator, uint32_t *denominator,
649 unsigned int n_terms, unsigned int threshold);
650 extern uint32_t uvc_fraction_to_interval(uint32_t numerator,
651 uint32_t denominator);
652 extern struct usb_host_endpoint *uvc_find_endpoint(
653 struct usb_host_interface *alts, __u8 epaddr);
655 /* Quirks support */
656 void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream,
657 struct uvc_buffer *buf);
659 #endif /* __KERNEL__ */
661 #endif