diff options
Diffstat (limited to 'drivers/media/video/uvc/uvcvideo.h')
-rw-r--r-- | drivers/media/video/uvc/uvcvideo.h | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index 9a6bc1aafb16..896b791ece15 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/videodev2.h> | 5 | #include <linux/videodev2.h> |
6 | 6 | ||
7 | |||
8 | /* | 7 | /* |
9 | * Dynamic controls | 8 | * Dynamic controls |
10 | */ | 9 | */ |
@@ -316,6 +315,7 @@ struct uvc_xu_control { | |||
316 | #define UVC_QUIRK_BUILTIN_ISIGHT 0x00000008 | 315 | #define UVC_QUIRK_BUILTIN_ISIGHT 0x00000008 |
317 | #define UVC_QUIRK_STREAM_NO_FID 0x00000010 | 316 | #define UVC_QUIRK_STREAM_NO_FID 0x00000010 |
318 | #define UVC_QUIRK_IGNORE_SELECTOR_UNIT 0x00000020 | 317 | #define UVC_QUIRK_IGNORE_SELECTOR_UNIT 0x00000020 |
318 | #define UVC_QUIRK_PRUNE_CONTROLS 0x00000040 | ||
319 | 319 | ||
320 | /* Format flags */ | 320 | /* Format flags */ |
321 | #define UVC_FMT_FLAG_COMPRESSED 0x00000001 | 321 | #define UVC_FMT_FLAG_COMPRESSED 0x00000001 |
@@ -383,6 +383,11 @@ struct uvc_control_mapping { | |||
383 | 383 | ||
384 | struct uvc_menu_info *menu_info; | 384 | struct uvc_menu_info *menu_info; |
385 | __u32 menu_count; | 385 | __u32 menu_count; |
386 | |||
387 | __s32 (*get) (struct uvc_control_mapping *mapping, __u8 query, | ||
388 | const __u8 *data); | ||
389 | void (*set) (struct uvc_control_mapping *mapping, __s32 value, | ||
390 | __u8 *data); | ||
386 | }; | 391 | }; |
387 | 392 | ||
388 | struct uvc_control { | 393 | struct uvc_control { |
@@ -523,6 +528,7 @@ struct uvc_streaming { | |||
523 | __u16 maxpsize; | 528 | __u16 maxpsize; |
524 | 529 | ||
525 | struct uvc_streaming_header header; | 530 | struct uvc_streaming_header header; |
531 | enum v4l2_buf_type type; | ||
526 | 532 | ||
527 | unsigned int nformats; | 533 | unsigned int nformats; |
528 | struct uvc_format *format; | 534 | struct uvc_format *format; |
@@ -558,12 +564,15 @@ struct uvc_buffer { | |||
558 | #define UVC_QUEUE_DROP_INCOMPLETE (1 << 2) | 564 | #define UVC_QUEUE_DROP_INCOMPLETE (1 << 2) |
559 | 565 | ||
560 | struct uvc_video_queue { | 566 | struct uvc_video_queue { |
567 | enum v4l2_buf_type type; | ||
568 | |||
561 | void *mem; | 569 | void *mem; |
562 | unsigned int flags; | 570 | unsigned int flags; |
563 | __u32 sequence; | 571 | __u32 sequence; |
564 | 572 | ||
565 | unsigned int count; | 573 | unsigned int count; |
566 | unsigned int buf_size; | 574 | unsigned int buf_size; |
575 | unsigned int buf_used; | ||
567 | struct uvc_buffer buffer[UVC_MAX_VIDEO_BUFFERS]; | 576 | struct uvc_buffer buffer[UVC_MAX_VIDEO_BUFFERS]; |
568 | struct mutex mutex; /* protects buffers and mainqueue */ | 577 | struct mutex mutex; /* protects buffers and mainqueue */ |
569 | spinlock_t irqlock; /* protects irqqueue */ | 578 | spinlock_t irqlock; /* protects irqqueue */ |
@@ -578,8 +587,9 @@ struct uvc_video_device { | |||
578 | atomic_t active; | 587 | atomic_t active; |
579 | unsigned int frozen : 1; | 588 | unsigned int frozen : 1; |
580 | 589 | ||
581 | struct list_head iterms; | 590 | struct list_head iterms; /* Input terminals */ |
582 | struct uvc_entity *oterm; | 591 | struct uvc_entity *oterm; /* Output terminal */ |
592 | struct uvc_entity *sterm; /* USB streaming terminal */ | ||
583 | struct uvc_entity *processing; | 593 | struct uvc_entity *processing; |
584 | struct uvc_entity *selector; | 594 | struct uvc_entity *selector; |
585 | struct list_head extensions; | 595 | struct list_head extensions; |
@@ -617,6 +627,7 @@ enum uvc_device_state { | |||
617 | struct uvc_device { | 627 | struct uvc_device { |
618 | struct usb_device *udev; | 628 | struct usb_device *udev; |
619 | struct usb_interface *intf; | 629 | struct usb_interface *intf; |
630 | unsigned long warnings; | ||
620 | __u32 quirks; | 631 | __u32 quirks; |
621 | int intfnum; | 632 | int intfnum; |
622 | char name[32]; | 633 | char name[32]; |
@@ -679,6 +690,10 @@ struct uvc_driver { | |||
679 | #define UVC_TRACE_SUSPEND (1 << 8) | 690 | #define UVC_TRACE_SUSPEND (1 << 8) |
680 | #define UVC_TRACE_STATUS (1 << 9) | 691 | #define UVC_TRACE_STATUS (1 << 9) |
681 | 692 | ||
693 | #define UVC_WARN_MINMAX 0 | ||
694 | #define UVC_WARN_PROBE_DEF 1 | ||
695 | |||
696 | extern unsigned int uvc_no_drop_param; | ||
682 | extern unsigned int uvc_trace_param; | 697 | extern unsigned int uvc_trace_param; |
683 | 698 | ||
684 | #define uvc_trace(flag, msg...) \ | 699 | #define uvc_trace(flag, msg...) \ |
@@ -687,6 +702,12 @@ extern unsigned int uvc_trace_param; | |||
687 | printk(KERN_DEBUG "uvcvideo: " msg); \ | 702 | printk(KERN_DEBUG "uvcvideo: " msg); \ |
688 | } while (0) | 703 | } while (0) |
689 | 704 | ||
705 | #define uvc_warn_once(dev, warn, msg...) \ | ||
706 | do { \ | ||
707 | if (!test_and_set_bit(warn, &dev->warnings)) \ | ||
708 | printk(KERN_INFO "uvcvideo: " msg); \ | ||
709 | } while (0) | ||
710 | |||
690 | #define uvc_printk(level, msg...) \ | 711 | #define uvc_printk(level, msg...) \ |
691 | printk(level "uvcvideo: " msg) | 712 | printk(level "uvcvideo: " msg) |
692 | 713 | ||
@@ -709,7 +730,8 @@ extern struct uvc_driver uvc_driver; | |||
709 | extern void uvc_delete(struct kref *kref); | 730 | extern void uvc_delete(struct kref *kref); |
710 | 731 | ||
711 | /* Video buffers queue management. */ | 732 | /* Video buffers queue management. */ |
712 | extern void uvc_queue_init(struct uvc_video_queue *queue); | 733 | extern void uvc_queue_init(struct uvc_video_queue *queue, |
734 | enum v4l2_buf_type type); | ||
713 | extern int uvc_alloc_buffers(struct uvc_video_queue *queue, | 735 | extern int uvc_alloc_buffers(struct uvc_video_queue *queue, |
714 | unsigned int nbuffers, unsigned int buflength); | 736 | unsigned int nbuffers, unsigned int buflength); |
715 | extern int uvc_free_buffers(struct uvc_video_queue *queue); | 737 | extern int uvc_free_buffers(struct uvc_video_queue *queue); |
@@ -740,10 +762,10 @@ extern int uvc_video_resume(struct uvc_video_device *video); | |||
740 | extern int uvc_video_enable(struct uvc_video_device *video, int enable); | 762 | extern int uvc_video_enable(struct uvc_video_device *video, int enable); |
741 | extern int uvc_probe_video(struct uvc_video_device *video, | 763 | extern int uvc_probe_video(struct uvc_video_device *video, |
742 | struct uvc_streaming_control *probe); | 764 | struct uvc_streaming_control *probe); |
765 | extern int uvc_commit_video(struct uvc_video_device *video, | ||
766 | struct uvc_streaming_control *ctrl); | ||
743 | extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit, | 767 | extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit, |
744 | __u8 intfnum, __u8 cs, void *data, __u16 size); | 768 | __u8 intfnum, __u8 cs, void *data, __u16 size); |
745 | extern int uvc_set_video_ctrl(struct uvc_video_device *video, | ||
746 | struct uvc_streaming_control *ctrl, int probe); | ||
747 | 769 | ||
748 | /* Status */ | 770 | /* Status */ |
749 | extern int uvc_status_init(struct uvc_device *dev); | 771 | extern int uvc_status_init(struct uvc_device *dev); |