aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvcvideo.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-02-18 14:38:52 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 14:33:39 -0400
commit561474c2d2a1e212ea186e0b65cc69fb330e7bd5 (patch)
treeff01d7c41345625982ec594fe80b85dfb73b0942 /drivers/media/video/uvc/uvcvideo.h
parent3653639e5daf2ac5f4763e4f1b6cb57538184be9 (diff)
V4L/DVB: uvcvideo: Support menu controls in the control mapping API
The UVCIOC_CTRL_MAP ioctl doesn't support menu entries for menu controls. As the uvc_xu_control_mapping structure has no reserved fields, this can't be fixed while keeping ABI compatibility. Modify the UVCIOC_CTRL_MAP ioctl to add menu entries support, and define UVCIOC_CTRL_MAP_OLD that supports the old ABI without any ability to add menu controls. 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.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index d1f88406a5e7..14f77e42fd45 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -27,6 +27,8 @@
27#define UVC_CONTROL_RESTORE (1 << 6) 27#define UVC_CONTROL_RESTORE (1 << 6)
28/* Control can be updated by the camera. */ 28/* Control can be updated by the camera. */
29#define UVC_CONTROL_AUTO_UPDATE (1 << 7) 29#define UVC_CONTROL_AUTO_UPDATE (1 << 7)
30/* Control is an extension unit control. */
31#define UVC_CONTROL_EXTENSION (1 << 8)
30 32
31#define UVC_CONTROL_GET_RANGE (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \ 33#define UVC_CONTROL_GET_RANGE (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \
32 UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \ 34 UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \
@@ -40,6 +42,15 @@ struct uvc_xu_control_info {
40 __u32 flags; 42 __u32 flags;
41}; 43};
42 44
45struct uvc_menu_info {
46 __u32 value;
47 __u8 name[32];
48};
49
50struct uvc_xu_control_mapping_old {
51 __u8 reserved[64];
52};
53
43struct uvc_xu_control_mapping { 54struct uvc_xu_control_mapping {
44 __u32 id; 55 __u32 id;
45 __u8 name[32]; 56 __u8 name[32];
@@ -50,6 +61,11 @@ struct uvc_xu_control_mapping {
50 __u8 offset; 61 __u8 offset;
51 enum v4l2_ctrl_type v4l2_type; 62 enum v4l2_ctrl_type v4l2_type;
52 __u32 data_type; 63 __u32 data_type;
64
65 struct uvc_menu_info __user *menu_info;
66 __u32 menu_count;
67
68 __u32 reserved[4];
53}; 69};
54 70
55struct uvc_xu_control { 71struct uvc_xu_control {
@@ -60,6 +76,7 @@ struct uvc_xu_control {
60}; 76};
61 77
62#define UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info) 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)
63#define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping) 80#define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping)
64#define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control) 81#define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control)
65#define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control) 82#define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control)
@@ -198,11 +215,6 @@ struct uvc_streaming_control {
198 __u8 bMaxVersion; 215 __u8 bMaxVersion;
199}; 216};
200 217
201struct uvc_menu_info {
202 __u32 value;
203 __u8 name[32];
204};
205
206struct uvc_control_info { 218struct uvc_control_info {
207 struct list_head list; 219 struct list_head list;
208 struct list_head mappings; 220 struct list_head mappings;
@@ -625,6 +637,7 @@ extern int uvc_ctrl_init_device(struct uvc_device *dev);
625extern void uvc_ctrl_cleanup_device(struct uvc_device *dev); 637extern void uvc_ctrl_cleanup_device(struct uvc_device *dev);
626extern int uvc_ctrl_resume_device(struct uvc_device *dev); 638extern int uvc_ctrl_resume_device(struct uvc_device *dev);
627extern void uvc_ctrl_init(void); 639extern void uvc_ctrl_init(void);
640extern void uvc_ctrl_cleanup(void);
628 641
629extern int uvc_ctrl_begin(struct uvc_video_chain *chain); 642extern int uvc_ctrl_begin(struct uvc_video_chain *chain);
630extern int __uvc_ctrl_commit(struct uvc_video_chain *chain, int rollback); 643extern int __uvc_ctrl_commit(struct uvc_video_chain *chain, int rollback);