aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvcvideo.h
diff options
context:
space:
mode:
authorMartin Rubli <martin_rubli@logitech.com>2010-10-02 18:10:16 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 08:30:26 -0400
commitfe78d187fe792fac5d190b19a2806c23df28891e (patch)
treedafe6b4217b6a731b8f107df9694c2dcc58071fe /drivers/media/video/uvc/uvcvideo.h
parent837d50b5648347b1a011f42e474eeb5f671cc259 (diff)
[media] uvcvideo: Add UVCIOC_CTRL_QUERY ioctl
This ioctl extends UVCIOC_CTRL_GET/SET by not only allowing to get/set XU controls but to also send arbitrary UVC commands to XU controls, namely GET_CUR, SET_CUR, GET_MIN, GET_MAX, GET_RES, GET_LEN, GET_INFO and GET_DEF. This is required for applications to work with XU controls, so that they can properly query the size and allocate the necessary buffers. Signed-off-by: Martin Rubli <martin_rubli@logitech.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvcvideo.h')
-rw-r--r--drivers/media/video/uvc/uvcvideo.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index 45f01e7e13d2..a3f4d308358a 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -57,7 +57,7 @@ struct uvc_xu_control_mapping {
57 57
58 __u8 size; 58 __u8 size;
59 __u8 offset; 59 __u8 offset;
60 enum v4l2_ctrl_type v4l2_type; 60 __u32 v4l2_type;
61 __u32 data_type; 61 __u32 data_type;
62 62
63 struct uvc_menu_info __user *menu_info; 63 struct uvc_menu_info __user *menu_info;
@@ -73,11 +73,20 @@ struct uvc_xu_control {
73 __u8 __user *data; 73 __u8 __user *data;
74}; 74};
75 75
76struct uvc_xu_control_query {
77 __u8 unit;
78 __u8 selector;
79 __u8 query;
80 __u16 size;
81 __u8 __user *data;
82};
83
76#define UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info) 84#define UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info)
77#define UVCIOC_CTRL_MAP_OLD _IOWR('U', 2, struct uvc_xu_control_mapping_old) 85#define UVCIOC_CTRL_MAP_OLD _IOWR('U', 2, struct uvc_xu_control_mapping_old)
78#define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping) 86#define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping)
79#define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control) 87#define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control)
80#define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control) 88#define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control)
89#define UVCIOC_CTRL_QUERY _IOWR('U', 5, struct uvc_xu_control_query)
81 90
82#ifdef __KERNEL__ 91#ifdef __KERNEL__
83 92
@@ -638,7 +647,7 @@ extern int uvc_ctrl_set(struct uvc_video_chain *chain,
638 struct v4l2_ext_control *xctrl); 647 struct v4l2_ext_control *xctrl);
639 648
640extern int uvc_xu_ctrl_query(struct uvc_video_chain *chain, 649extern int uvc_xu_ctrl_query(struct uvc_video_chain *chain,
641 struct uvc_xu_control *ctrl, int set); 650 struct uvc_xu_control_query *xqry);
642 651
643/* Utility functions */ 652/* Utility functions */
644extern void uvc_simplify_fraction(uint32_t *numerator, uint32_t *denominator, 653extern void uvc_simplify_fraction(uint32_t *numerator, uint32_t *denominator,