aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvcvideo.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-09-20 04:53:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:18:21 -0400
commitba2fa99668bb9bf03757a020f15bba295d5c0a3e (patch)
tree10fc8a0bc168ddb78ebfcd71402fe250372e1da5 /drivers/media/video/uvc/uvcvideo.h
parent650b95feee353305203724cb2e8b2bc50f6d130a (diff)
[media] uvcvideo: Hardcode the index/selector relationship for XU controls
Devices advertise XU controls using a bitmask, in which each bit corresponds to a control. The control selector, used to query the control, isn't available in the USB descriptors. All known UVC devices use control selectors equal to the control bit index plus one. Hardcode that relationship in the driver, making the UVCIOC_CTRL_ADD ioctl obsolete. All necessary information about XU controls can be obtained by the driver at enumeration time. The UVCIOC_CTRL_ADD ioctl is still supported for compatibility reasons, but now always returns -EEXIST. Finally, control mappings are now on a per-device basis and no longer global. As this changes the userspace interface, bump the driver version number to 1.0.0 (it was about time). 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.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index f8901333a3a0..34637fbbbd61 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -27,8 +27,6 @@
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)
32 30
33#define UVC_CONTROL_GET_RANGE (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \ 31#define UVC_CONTROL_GET_RANGE (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \
34 UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \ 32 UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \
@@ -159,7 +157,8 @@ struct uvc_xu_control {
159 * Driver specific constants. 157 * Driver specific constants.
160 */ 158 */
161 159
162#define DRIVER_VERSION_NUMBER KERNEL_VERSION(0, 1, 0) 160#define DRIVER_VERSION_NUMBER KERNEL_VERSION(1, 0, 0)
161#define DRIVER_VERSION "v1.0.0"
163 162
164/* Number of isochronous URBs. */ 163/* Number of isochronous URBs. */
165#define UVC_URBS 5 164#define UVC_URBS 5
@@ -198,11 +197,10 @@ struct uvc_device;
198 * structures to maximize cache efficiency. 197 * structures to maximize cache efficiency.
199 */ 198 */
200struct uvc_control_info { 199struct uvc_control_info {
201 struct list_head list;
202 struct list_head mappings; 200 struct list_head mappings;
203 201
204 __u8 entity[16]; 202 __u8 entity[16];
205 __u8 index; 203 __u8 index; /* Bit index in bmControls */
206 __u8 selector; 204 __u8 selector;
207 205
208 __u16 size; 206 __u16 size;
@@ -245,7 +243,6 @@ struct uvc_control {
245 cached : 1; 243 cached : 1;
246 244
247 __u8 *uvc_data; 245 __u8 *uvc_data;
248 __u8 *uvc_info;
249}; 246};
250 247
251struct uvc_format_desc { 248struct uvc_format_desc {
@@ -474,7 +471,6 @@ struct uvc_device {
474 char name[32]; 471 char name[32];
475 472
476 enum uvc_device_state state; 473 enum uvc_device_state state;
477 struct list_head list;
478 atomic_t users; 474 atomic_t users;
479 475
480 /* Video control interface */ 476 /* Video control interface */
@@ -509,11 +505,6 @@ struct uvc_fh {
509 505
510struct uvc_driver { 506struct uvc_driver {
511 struct usb_driver driver; 507 struct usb_driver driver;
512
513 struct list_head devices; /* struct uvc_device list */
514 struct list_head controls; /* struct uvc_control_info list */
515 struct mutex ctrl_mutex; /* protects controls and devices
516 lists */
517}; 508};
518 509
519/* ------------------------------------------------------------------------ 510/* ------------------------------------------------------------------------
@@ -615,13 +606,11 @@ extern struct uvc_control *uvc_find_control(struct uvc_video_chain *chain,
615extern int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain, 606extern int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
616 struct v4l2_queryctrl *v4l2_ctrl); 607 struct v4l2_queryctrl *v4l2_ctrl);
617 608
618extern int uvc_ctrl_add_info(struct uvc_control_info *info); 609extern int uvc_ctrl_add_mapping(struct uvc_video_chain *chain,
619extern int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping); 610 const struct uvc_control_mapping *mapping);
620extern int uvc_ctrl_init_device(struct uvc_device *dev); 611extern int uvc_ctrl_init_device(struct uvc_device *dev);
621extern void uvc_ctrl_cleanup_device(struct uvc_device *dev); 612extern void uvc_ctrl_cleanup_device(struct uvc_device *dev);
622extern int uvc_ctrl_resume_device(struct uvc_device *dev); 613extern int uvc_ctrl_resume_device(struct uvc_device *dev);
623extern void uvc_ctrl_init(void);
624extern void uvc_ctrl_cleanup(void);
625 614
626extern int uvc_ctrl_begin(struct uvc_video_chain *chain); 615extern int uvc_ctrl_begin(struct uvc_video_chain *chain);
627extern int __uvc_ctrl_commit(struct uvc_video_chain *chain, int rollback); 616extern int __uvc_ctrl_commit(struct uvc_video_chain *chain, int rollback);