44#include <linux/kernel.h>
55#include <linux/videodev2.h>
66
7+ #ifndef __KERNEL__
8+ /*
9+ * This header provides binary compatibility with applications using the private
10+ * uvcvideo API. This API is deprecated and will be removed in 2.6.42.
11+ * Applications should be recompiled against the public linux/uvcvideo.h header.
12+ */
13+ #warn "The uvcvideo.h header is deprecated, use linux/uvcvideo.h instead."
14+
715/*
816 * Dynamic controls
917 */
1725#define UVC_CTRL_DATA_TYPE_BITMASK 5
1826
1927/* Control flags */
20- #define UVC_CTRL_FLAG_SET_CUR (1 << 0)
21- #define UVC_CTRL_FLAG_GET_CUR (1 << 1)
22- #define UVC_CTRL_FLAG_GET_MIN (1 << 2)
23- #define UVC_CTRL_FLAG_GET_MAX (1 << 3)
24- #define UVC_CTRL_FLAG_GET_RES (1 << 4)
25- #define UVC_CTRL_FLAG_GET_DEF (1 << 5)
26- /* Control should be saved at suspend and restored at resume. */
27- #define UVC_CTRL_FLAG_RESTORE (1 << 6)
28- /* Control can be updated by the camera. */
29- #define UVC_CTRL_FLAG_AUTO_UPDATE (1 << 7)
30-
31- #define UVC_CTRL_FLAG_GET_RANGE \
32- (UVC_CTRL_FLAG_GET_CUR | UVC_CTRL_FLAG_GET_MIN | \
33- UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \
34- UVC_CTRL_FLAG_GET_DEF)
35-
36- /* Old control flags, don't use */
3728#define UVC_CONTROL_SET_CUR (1 << 0)
3829#define UVC_CONTROL_GET_CUR (1 << 1)
3930#define UVC_CONTROL_GET_MIN (1 << 2)
4738 UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \
4839 UVC_CONTROL_GET_DEF)
4940
50- struct uvc_xu_control_info {
51- __u8 entity [16 ];
52- __u8 index ;
53- __u8 selector ;
54- __u16 size ;
55- __u32 flags ;
56- };
57-
5841struct uvc_menu_info {
5942 __u32 value ;
6043 __u8 name [32 ];
6144};
6245
63- struct uvc_xu_control_mapping_old {
64- __u8 reserved [64 ];
65- };
66-
6746struct uvc_xu_control_mapping {
6847 __u32 id ;
6948 __u8 name [32 ];
@@ -81,32 +60,46 @@ struct uvc_xu_control_mapping {
8160 __u32 reserved [4 ];
8261};
8362
84- struct uvc_xu_control {
85- __u8 unit ;
63+ #endif
64+
65+ struct uvc_xu_control_info {
66+ __u8 entity [16 ];
67+ __u8 index ;
8668 __u8 selector ;
8769 __u16 size ;
88- __u8 __user * data ;
70+ __u32 flags ;
8971};
9072
91- struct uvc_xu_control_query {
73+ struct uvc_xu_control_mapping_old {
74+ __u8 reserved [64 ];
75+ };
76+
77+ struct uvc_xu_control {
9278 __u8 unit ;
9379 __u8 selector ;
94- __u8 query ;
9580 __u16 size ;
9681 __u8 __user * data ;
9782};
9883
84+ #ifndef __KERNEL__
9985#define UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info)
10086#define UVCIOC_CTRL_MAP_OLD _IOWR('U', 2, struct uvc_xu_control_mapping_old)
10187#define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping)
10288#define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control)
10389#define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control)
104- #define UVCIOC_CTRL_QUERY _IOWR('U', 5, struct uvc_xu_control_query)
90+ #else
91+ #define __UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info)
92+ #define __UVCIOC_CTRL_MAP_OLD _IOWR('U', 2, struct uvc_xu_control_mapping_old)
93+ #define __UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping)
94+ #define __UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control)
95+ #define __UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control)
96+ #endif
10597
10698#ifdef __KERNEL__
10799
108100#include <linux/poll.h>
109101#include <linux/usb/video.h>
102+ #include <linux/uvcvideo.h>
110103
111104/* --------------------------------------------------------------------------
112105 * UVC constants
@@ -184,8 +177,8 @@ struct uvc_xu_control_query {
184177 * Driver specific constants.
185178 */
186179
187- #define DRIVER_VERSION_NUMBER KERNEL_VERSION(1, 0 , 0)
188- #define DRIVER_VERSION "v1.0 .0"
180+ #define DRIVER_VERSION_NUMBER KERNEL_VERSION(1, 1 , 0)
181+ #define DRIVER_VERSION "v1.1 .0"
189182
190183/* Number of isochronous URBs. */
191184#define UVC_URBS 5
@@ -682,4 +675,3 @@ void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream,
682675#endif /* __KERNEL__ */
683676
684677#endif
685-
0 commit comments