aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-07-30 15:19:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-23 19:06:51 -0400
commit227bd5b3539a50290ec48b90c42c40cc7ae27191 (patch)
treea23c603a7ec2b91842ad935d1d012f759cf3915f /drivers/media/video/uvc
parentfd3e9f2f9a4c46f5d67d384c78b2d364c99d3de6 (diff)
[media] uvcvideo: Remove deprecated UVCIOC ioctls
The UVCIOC_CTRL_ADD, UVCIOC_CTRL_MAP_OLD, UVCIOC_CTRL_GET and UVCIOC_CTRL_SET ioctls are deprecated and were scheduled for removal for v2.6.42. As v2.6.42 == v3.2, remove them. 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')
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c54
-rw-r--r--drivers/media/video/uvc/uvcvideo.h100
2 files changed, 6 insertions, 148 deletions
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index ea71d5f1f6db..dadf11f704dc 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -32,7 +32,7 @@
32 * UVC ioctls 32 * UVC ioctls
33 */ 33 */
34static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain, 34static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
35 struct uvc_xu_control_mapping *xmap, int old) 35 struct uvc_xu_control_mapping *xmap)
36{ 36{
37 struct uvc_control_mapping *map; 37 struct uvc_control_mapping *map;
38 unsigned int size; 38 unsigned int size;
@@ -58,13 +58,6 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
58 break; 58 break;
59 59
60 case V4L2_CTRL_TYPE_MENU: 60 case V4L2_CTRL_TYPE_MENU:
61 if (old) {
62 uvc_trace(UVC_TRACE_CONTROL, "V4L2_CTRL_TYPE_MENU not "
63 "supported for UVCIOC_CTRL_MAP_OLD.\n");
64 ret = -EINVAL;
65 goto done;
66 }
67
68 size = xmap->menu_count * sizeof(*map->menu_info); 61 size = xmap->menu_count * sizeof(*map->menu_info);
69 map->menu_info = kmalloc(size, GFP_KERNEL); 62 map->menu_info = kmalloc(size, GFP_KERNEL);
70 if (map->menu_info == NULL) { 63 if (map->menu_info == NULL) {
@@ -538,20 +531,6 @@ static int uvc_v4l2_release(struct file *file)
538 return 0; 531 return 0;
539} 532}
540 533
541static void uvc_v4l2_ioctl_warn(void)
542{
543 static int warned;
544
545 if (warned)
546 return;
547
548 uvc_printk(KERN_INFO, "Deprecated UVCIOC_CTRL_{ADD,MAP_OLD,GET,SET} "
549 "ioctls will be removed in 2.6.42.\n");
550 uvc_printk(KERN_INFO, "See http://www.ideasonboard.org/uvc/upgrade/ "
551 "for upgrade instructions.\n");
552 warned = 1;
553}
554
555static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 534static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
556{ 535{
557 struct video_device *vdev = video_devdata(file); 536 struct video_device *vdev = video_devdata(file);
@@ -1032,37 +1011,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1032 uvc_trace(UVC_TRACE_IOCTL, "Unsupported ioctl 0x%08x\n", cmd); 1011 uvc_trace(UVC_TRACE_IOCTL, "Unsupported ioctl 0x%08x\n", cmd);
1033 return -EINVAL; 1012 return -EINVAL;
1034 1013
1035 /* Dynamic controls. UVCIOC_CTRL_ADD, UVCIOC_CTRL_MAP_OLD,
1036 * UVCIOC_CTRL_GET and UVCIOC_CTRL_SET are deprecated and scheduled for
1037 * removal in 2.6.42.
1038 */
1039 case __UVCIOC_CTRL_ADD:
1040 uvc_v4l2_ioctl_warn();
1041 return -EEXIST;
1042
1043 case __UVCIOC_CTRL_MAP_OLD:
1044 uvc_v4l2_ioctl_warn();
1045 case __UVCIOC_CTRL_MAP:
1046 case UVCIOC_CTRL_MAP: 1014 case UVCIOC_CTRL_MAP:
1047 return uvc_ioctl_ctrl_map(chain, arg, 1015 return uvc_ioctl_ctrl_map(chain, arg);
1048 cmd == __UVCIOC_CTRL_MAP_OLD);
1049
1050 case __UVCIOC_CTRL_GET:
1051 case __UVCIOC_CTRL_SET:
1052 {
1053 struct uvc_xu_control *xctrl = arg;
1054 struct uvc_xu_control_query xqry = {
1055 .unit = xctrl->unit,
1056 .selector = xctrl->selector,
1057 .query = cmd == __UVCIOC_CTRL_GET
1058 ? UVC_GET_CUR : UVC_SET_CUR,
1059 .size = xctrl->size,
1060 .data = xctrl->data,
1061 };
1062
1063 uvc_v4l2_ioctl_warn();
1064 return uvc_xu_ctrl_query(chain, &xqry);
1065 }
1066 1016
1067 case UVCIOC_CTRL_QUERY: 1017 case UVCIOC_CTRL_QUERY:
1068 return uvc_xu_ctrl_query(chain, arg); 1018 return uvc_xu_ctrl_query(chain, arg);
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index cbdd49bf8b67..e3aec87eaa53 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -1,106 +1,16 @@
1#ifndef _USB_VIDEO_H_ 1#ifndef _USB_VIDEO_H_
2#define _USB_VIDEO_H_ 2#define _USB_VIDEO_H_
3 3
4#include <linux/kernel.h>
5#include <linux/videodev2.h>
6
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
15/*
16 * Dynamic controls
17 */
18
19/* Data types for UVC control data */
20#define UVC_CTRL_DATA_TYPE_RAW 0
21#define UVC_CTRL_DATA_TYPE_SIGNED 1
22#define UVC_CTRL_DATA_TYPE_UNSIGNED 2
23#define UVC_CTRL_DATA_TYPE_BOOLEAN 3
24#define UVC_CTRL_DATA_TYPE_ENUM 4
25#define UVC_CTRL_DATA_TYPE_BITMASK 5
26
27/* Control flags */
28#define UVC_CONTROL_SET_CUR (1 << 0)
29#define UVC_CONTROL_GET_CUR (1 << 1)
30#define UVC_CONTROL_GET_MIN (1 << 2)
31#define UVC_CONTROL_GET_MAX (1 << 3)
32#define UVC_CONTROL_GET_RES (1 << 4)
33#define UVC_CONTROL_GET_DEF (1 << 5)
34#define UVC_CONTROL_RESTORE (1 << 6)
35#define UVC_CONTROL_AUTO_UPDATE (1 << 7)
36
37#define UVC_CONTROL_GET_RANGE (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \
38 UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \
39 UVC_CONTROL_GET_DEF)
40
41struct uvc_menu_info {
42 __u32 value;
43 __u8 name[32];
44};
45
46struct uvc_xu_control_mapping {
47 __u32 id;
48 __u8 name[32];
49 __u8 entity[16];
50 __u8 selector;
51
52 __u8 size;
53 __u8 offset;
54 __u32 v4l2_type;
55 __u32 data_type;
56
57 struct uvc_menu_info __user *menu_info;
58 __u32 menu_count;
59
60 __u32 reserved[4];
61};
62
63#endif
64
65struct uvc_xu_control_info {
66 __u8 entity[16];
67 __u8 index;
68 __u8 selector;
69 __u16 size;
70 __u32 flags;
71};
72
73struct uvc_xu_control_mapping_old {
74 __u8 reserved[64];
75};
76
77struct uvc_xu_control {
78 __u8 unit;
79 __u8 selector;
80 __u16 size;
81 __u8 __user *data;
82};
83
84#ifndef __KERNEL__ 4#ifndef __KERNEL__
85#define UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info) 5#error "The uvcvideo.h header is deprecated, use linux/uvcvideo.h instead."
86#define UVCIOC_CTRL_MAP_OLD _IOWR('U', 2, struct uvc_xu_control_mapping_old) 6#endif /* __KERNEL__ */
87#define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping)
88#define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control)
89#define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control)
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
97
98#ifdef __KERNEL__
99 7
8#include <linux/kernel.h>
100#include <linux/poll.h> 9#include <linux/poll.h>
101#include <linux/usb.h> 10#include <linux/usb.h>
102#include <linux/usb/video.h> 11#include <linux/usb/video.h>
103#include <linux/uvcvideo.h> 12#include <linux/uvcvideo.h>
13#include <linux/videodev2.h>
104#include <media/media-device.h> 14#include <media/media-device.h>
105#include <media/v4l2-device.h> 15#include <media/v4l2-device.h>
106 16
@@ -698,6 +608,4 @@ extern struct usb_host_endpoint *uvc_find_endpoint(
698void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream, 608void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream,
699 struct uvc_buffer *buf); 609 struct uvc_buffer *buf);
700 610
701#endif /* __KERNEL__ */
702
703#endif 611#endif