diff options
author | Martin Rubli <martin_rubli@logitech.com> | 2010-10-02 19:10:16 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 09:30:26 -0300 |
commit | fe78d187fe792fac5d190b19a2806c23df28891e (patch) | |
tree | dafe6b4217b6a731b8f107df9694c2dcc58071fe /drivers/media/video/uvc/uvcvideo.h | |
parent | 837d50b5648347b1a011f42e474eeb5f671cc259 (diff) | |
download | kernel_samsung_espresso10-fe78d187fe792fac5d190b19a2806c23df28891e.zip kernel_samsung_espresso10-fe78d187fe792fac5d190b19a2806c23df28891e.tar.gz kernel_samsung_espresso10-fe78d187fe792fac5d190b19a2806c23df28891e.tar.bz2 |
[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.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index 45f01e7..a3f4d30 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h @@ -57,7 +57,7 @@ struct uvc_xu_control_mapping { __u8 size; __u8 offset; - enum v4l2_ctrl_type v4l2_type; + __u32 v4l2_type; __u32 data_type; struct uvc_menu_info __user *menu_info; @@ -73,11 +73,20 @@ struct uvc_xu_control { __u8 __user *data; }; +struct uvc_xu_control_query { + __u8 unit; + __u8 selector; + __u8 query; + __u16 size; + __u8 __user *data; +}; + #define UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info) #define UVCIOC_CTRL_MAP_OLD _IOWR('U', 2, struct uvc_xu_control_mapping_old) #define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping) #define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control) #define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control) +#define UVCIOC_CTRL_QUERY _IOWR('U', 5, struct uvc_xu_control_query) #ifdef __KERNEL__ @@ -638,7 +647,7 @@ extern int uvc_ctrl_set(struct uvc_video_chain *chain, struct v4l2_ext_control *xctrl); extern int uvc_xu_ctrl_query(struct uvc_video_chain *chain, - struct uvc_xu_control *ctrl, int set); + struct uvc_xu_control_query *xqry); /* Utility functions */ extern void uvc_simplify_fraction(uint32_t *numerator, uint32_t *denominator, |