diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-11-09 00:37:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:21 -0500 |
commit | 79436633dbced18aa348f8669ef507109f851303 (patch) | |
tree | 46e90aa4e1ebdca2ec5e97bab09e90f06bee1b49 | |
parent | de48eebce8b63dbae7272ee80f4fe0eaddb61278 (diff) |
[PATCH] v4l: 809: some changes to allow compiling cx88 and saa7134
- Some changes to allow compiling cx88 and saa7134 without V4L1 support.
- This patch will help obsoleting V4L1 API.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 9 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 6 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 2 | ||||
-rw-r--r-- | include/linux/videodev.h | 74 | ||||
-rw-r--r-- | include/linux/videodev2.h | 76 | ||||
-rw-r--r-- | include/media/video-buf.h | 2 |
6 files changed, 92 insertions, 77 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index f22ccb65de1c..cedd1d79ac13 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -34,6 +34,9 @@ | |||
34 | 34 | ||
35 | #include "cx88.h" | 35 | #include "cx88.h" |
36 | 36 | ||
37 | /* Include V4L1 specific functions. Should be removed soon */ | ||
38 | #include <linux/videodev.h> | ||
39 | |||
37 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); | 40 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); |
38 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | 41 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
39 | MODULE_LICENSE("GPL"); | 42 | MODULE_LICENSE("GPL"); |
@@ -1187,7 +1190,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1187 | struct v4l2_format *f = arg; | 1190 | struct v4l2_format *f = arg; |
1188 | return cx8800_try_fmt(dev,fh,f); | 1191 | return cx8800_try_fmt(dev,fh,f); |
1189 | } | 1192 | } |
1190 | 1193 | #ifdef HAVE_V4L1 | |
1191 | /* --- streaming capture ------------------------------------- */ | 1194 | /* --- streaming capture ------------------------------------- */ |
1192 | case VIDIOCGMBUF: | 1195 | case VIDIOCGMBUF: |
1193 | { | 1196 | { |
@@ -1213,6 +1216,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1213 | } | 1216 | } |
1214 | return 0; | 1217 | return 0; |
1215 | } | 1218 | } |
1219 | #endif | ||
1216 | case VIDIOC_REQBUFS: | 1220 | case VIDIOC_REQBUFS: |
1217 | return videobuf_reqbufs(get_queue(fh), arg); | 1221 | return videobuf_reqbufs(get_queue(fh), arg); |
1218 | 1222 | ||
@@ -1244,7 +1248,6 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1244 | res_free(dev,fh,res); | 1248 | res_free(dev,fh,res); |
1245 | return 0; | 1249 | return 0; |
1246 | } | 1250 | } |
1247 | |||
1248 | default: | 1251 | default: |
1249 | return cx88_do_ioctl( inode, file, fh->radio, core, cmd, arg, video_do_ioctl ); | 1252 | return cx88_do_ioctl( inode, file, fh->radio, core, cmd, arg, video_do_ioctl ); |
1250 | } | 1253 | } |
@@ -1537,6 +1540,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
1537 | *id = 0; | 1540 | *id = 0; |
1538 | return 0; | 1541 | return 0; |
1539 | } | 1542 | } |
1543 | #ifdef HAVE_V4L1 | ||
1540 | case VIDIOCSTUNER: | 1544 | case VIDIOCSTUNER: |
1541 | { | 1545 | { |
1542 | struct video_tuner *v = arg; | 1546 | struct video_tuner *v = arg; |
@@ -1547,6 +1551,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
1547 | cx88_call_i2c_clients(core,VIDIOCSTUNER,v); | 1551 | cx88_call_i2c_clients(core,VIDIOCSTUNER,v); |
1548 | return 0; | 1552 | return 0; |
1549 | } | 1553 | } |
1554 | #endif | ||
1550 | case VIDIOC_S_TUNER: | 1555 | case VIDIOC_S_TUNER: |
1551 | { | 1556 | { |
1552 | struct v4l2_tuner *t = arg; | 1557 | struct v4l2_tuner *t = arg; |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index caeb47c68b8b..632ebe8724ec 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -30,6 +30,9 @@ | |||
30 | #include "saa7134-reg.h" | 30 | #include "saa7134-reg.h" |
31 | #include "saa7134.h" | 31 | #include "saa7134.h" |
32 | 32 | ||
33 | /* Include V4L1 specific functions. Should be removed soon */ | ||
34 | #include <linux/videodev.h> | ||
35 | |||
33 | /* ------------------------------------------------------------------ */ | 36 | /* ------------------------------------------------------------------ */ |
34 | 37 | ||
35 | static unsigned int video_debug = 0; | 38 | static unsigned int video_debug = 0; |
@@ -2060,7 +2063,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
2060 | struct v4l2_format *f = arg; | 2063 | struct v4l2_format *f = arg; |
2061 | return saa7134_try_fmt(dev,fh,f); | 2064 | return saa7134_try_fmt(dev,fh,f); |
2062 | } | 2065 | } |
2063 | 2066 | #ifdef HAVE_V4L1 | |
2064 | case VIDIOCGMBUF: | 2067 | case VIDIOCGMBUF: |
2065 | { | 2068 | { |
2066 | struct video_mbuf *mbuf = arg; | 2069 | struct video_mbuf *mbuf = arg; |
@@ -2085,6 +2088,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
2085 | } | 2088 | } |
2086 | return 0; | 2089 | return 0; |
2087 | } | 2090 | } |
2091 | #endif | ||
2088 | case VIDIOC_REQBUFS: | 2092 | case VIDIOC_REQBUFS: |
2089 | return videobuf_reqbufs(saa7134_queue(fh),arg); | 2093 | return videobuf_reqbufs(saa7134_queue(fh),arg); |
2090 | 2094 | ||
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 064c2f7a8c12..cd28a6a7b972 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include <linux/pci.h> | 25 | #include <linux/pci.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/videodev.h> | 27 | #include <linux/videodev2.h> |
28 | #include <linux/kdev_t.h> | 28 | #include <linux/kdev_t.h> |
29 | #include <linux/input.h> | 29 | #include <linux/input.h> |
30 | #include <linux/notifier.h> | 30 | #include <linux/notifier.h> |
diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 22e6e4bad7b8..23276cede540 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h | |||
@@ -1,57 +1,16 @@ | |||
1 | #ifndef __LINUX_VIDEODEV_H | 1 | #ifndef __LINUX_VIDEODEV_H |
2 | #define __LINUX_VIDEODEV_H | 2 | #define __LINUX_VIDEODEV_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | ||
5 | #include <linux/types.h> | 4 | #include <linux/types.h> |
6 | 5 | ||
7 | #define HAVE_V4L2 1 | 6 | #define HAVE_V4L1 1 |
7 | |||
8 | #include <linux/videodev2.h> | 8 | #include <linux/videodev2.h> |
9 | 9 | ||
10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
11 | 11 | ||
12 | #include <linux/poll.h> | ||
13 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
14 | #include <linux/device.h> | ||
15 | |||
16 | struct video_device | ||
17 | { | ||
18 | /* device info */ | ||
19 | struct device *dev; | ||
20 | char name[32]; | ||
21 | int type; /* v4l1 */ | ||
22 | int type2; /* v4l2 */ | ||
23 | int hardware; | ||
24 | int minor; | ||
25 | |||
26 | /* device ops + callbacks */ | ||
27 | struct file_operations *fops; | ||
28 | void (*release)(struct video_device *vfd); | ||
29 | |||
30 | |||
31 | /* obsolete -- fops->owner is used instead */ | ||
32 | struct module *owner; | ||
33 | /* dev->driver_data will be used instead some day. | ||
34 | * Use the video_{get|set}_drvdata() helper functions, | ||
35 | * so the switch over will be transparent for you. | ||
36 | * Or use {pci|usb}_{get|set}_drvdata() directly. */ | ||
37 | void *priv; | ||
38 | |||
39 | /* for videodev.c intenal usage -- please don't touch */ | ||
40 | int users; /* video_exclusive_{open|close} ... */ | ||
41 | struct semaphore lock; /* ... helper function uses these */ | ||
42 | char devfs_name[64]; /* devfs */ | ||
43 | struct class_device class_dev; /* sysfs */ | ||
44 | }; | ||
45 | |||
46 | #define VIDEO_MAJOR 81 | ||
47 | |||
48 | #define VFL_TYPE_GRABBER 0 | ||
49 | #define VFL_TYPE_VBI 1 | ||
50 | #define VFL_TYPE_RADIO 2 | ||
51 | #define VFL_TYPE_VTX 3 | ||
52 | 13 | ||
53 | extern int video_register_device(struct video_device *, int type, int nr); | ||
54 | extern void video_unregister_device(struct video_device *); | ||
55 | extern struct video_device* video_devdata(struct file*); | 14 | extern struct video_device* video_devdata(struct file*); |
56 | 15 | ||
57 | #define to_video_device(cd) container_of(cd, struct video_device, class_dev) | 16 | #define to_video_device(cd) container_of(cd, struct video_device, class_dev) |
@@ -68,11 +27,6 @@ video_device_remove_file(struct video_device *vfd, | |||
68 | class_device_remove_file(&vfd->class_dev, attr); | 27 | class_device_remove_file(&vfd->class_dev, attr); |
69 | } | 28 | } |
70 | 29 | ||
71 | /* helper functions to alloc / release struct video_device, the | ||
72 | later can be used for video_device->release() */ | ||
73 | struct video_device *video_device_alloc(void); | ||
74 | void video_device_release(struct video_device *vfd); | ||
75 | |||
76 | /* helper functions to access driver private data. */ | 30 | /* helper functions to access driver private data. */ |
77 | static inline void *video_get_drvdata(struct video_device *dev) | 31 | static inline void *video_get_drvdata(struct video_device *dev) |
78 | { | 32 | { |
@@ -86,27 +40,8 @@ static inline void video_set_drvdata(struct video_device *dev, void *data) | |||
86 | 40 | ||
87 | extern int video_exclusive_open(struct inode *inode, struct file *file); | 41 | extern int video_exclusive_open(struct inode *inode, struct file *file); |
88 | extern int video_exclusive_release(struct inode *inode, struct file *file); | 42 | extern int video_exclusive_release(struct inode *inode, struct file *file); |
89 | extern int video_usercopy(struct inode *inode, struct file *file, | ||
90 | unsigned int cmd, unsigned long arg, | ||
91 | int (*func)(struct inode *inode, struct file *file, | ||
92 | unsigned int cmd, void *arg)); | ||
93 | #endif /* __KERNEL__ */ | 43 | #endif /* __KERNEL__ */ |
94 | 44 | ||
95 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | ||
96 | #define VID_TYPE_TUNER 2 /* Can tune */ | ||
97 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | ||
98 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ | ||
99 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ | ||
100 | #define VID_TYPE_CLIPPING 32 /* Can clip */ | ||
101 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ | ||
102 | #define VID_TYPE_SCALES 128 /* Scalable */ | ||
103 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ | ||
104 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ | ||
105 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ | ||
106 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | ||
107 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | ||
108 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | ||
109 | |||
110 | struct video_capability | 45 | struct video_capability |
111 | { | 46 | { |
112 | char name[32]; | 47 | char name[32]; |
@@ -260,9 +195,6 @@ struct video_key | |||
260 | __u32 flags; | 195 | __u32 flags; |
261 | }; | 196 | }; |
262 | 197 | ||
263 | |||
264 | #define VIDEO_MAX_FRAME 32 | ||
265 | |||
266 | struct video_mbuf | 198 | struct video_mbuf |
267 | { | 199 | { |
268 | int size; /* Total memory to map */ | 200 | int size; /* Total memory to map */ |
@@ -270,10 +202,8 @@ struct video_mbuf | |||
270 | int offsets[VIDEO_MAX_FRAME]; | 202 | int offsets[VIDEO_MAX_FRAME]; |
271 | }; | 203 | }; |
272 | 204 | ||
273 | |||
274 | #define VIDEO_NO_UNIT (-1) | 205 | #define VIDEO_NO_UNIT (-1) |
275 | 206 | ||
276 | |||
277 | struct video_unit | 207 | struct video_unit |
278 | { | 208 | { |
279 | int video; /* Video minor */ | 209 | int video; /* Video minor */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 090091560c36..df0f9a24944a 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -18,6 +18,82 @@ | |||
18 | #endif | 18 | #endif |
19 | #include <linux/compiler.h> /* need __user */ | 19 | #include <linux/compiler.h> /* need __user */ |
20 | 20 | ||
21 | #include <linux/poll.h> | ||
22 | #include <linux/device.h> | ||
23 | |||
24 | #define HAVE_V4L2 1 | ||
25 | |||
26 | /* | ||
27 | * Common stuff for both V4L1 and V4L2 | ||
28 | * Moved from videodev.h | ||
29 | */ | ||
30 | |||
31 | #define VIDEO_MAX_FRAME 32 | ||
32 | |||
33 | #define VFL_TYPE_GRABBER 0 | ||
34 | #define VFL_TYPE_VBI 1 | ||
35 | #define VFL_TYPE_RADIO 2 | ||
36 | #define VFL_TYPE_VTX 3 | ||
37 | |||
38 | struct video_device | ||
39 | { | ||
40 | /* device info */ | ||
41 | struct device *dev; | ||
42 | char name[32]; | ||
43 | int type; /* v4l1 */ | ||
44 | int type2; /* v4l2 */ | ||
45 | int hardware; | ||
46 | int minor; | ||
47 | |||
48 | /* device ops + callbacks */ | ||
49 | struct file_operations *fops; | ||
50 | void (*release)(struct video_device *vfd); | ||
51 | |||
52 | |||
53 | /* obsolete -- fops->owner is used instead */ | ||
54 | struct module *owner; | ||
55 | /* dev->driver_data will be used instead some day. | ||
56 | * Use the video_{get|set}_drvdata() helper functions, | ||
57 | * so the switch over will be transparent for you. | ||
58 | * Or use {pci|usb}_{get|set}_drvdata() directly. */ | ||
59 | void *priv; | ||
60 | |||
61 | /* for videodev.c intenal usage -- please don't touch */ | ||
62 | int users; /* video_exclusive_{open|close} ... */ | ||
63 | struct semaphore lock; /* ... helper function uses these */ | ||
64 | char devfs_name[64]; /* devfs */ | ||
65 | struct class_device class_dev; /* sysfs */ | ||
66 | }; | ||
67 | |||
68 | #define VIDEO_MAJOR 81 | ||
69 | |||
70 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | ||
71 | #define VID_TYPE_TUNER 2 /* Can tune */ | ||
72 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | ||
73 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ | ||
74 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ | ||
75 | #define VID_TYPE_CLIPPING 32 /* Can clip */ | ||
76 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ | ||
77 | #define VID_TYPE_SCALES 128 /* Scalable */ | ||
78 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ | ||
79 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ | ||
80 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ | ||
81 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | ||
82 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | ||
83 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | ||
84 | |||
85 | extern int video_register_device(struct video_device *, int type, int nr); | ||
86 | extern void video_unregister_device(struct video_device *); | ||
87 | extern int video_usercopy(struct inode *inode, struct file *file, | ||
88 | unsigned int cmd, unsigned long arg, | ||
89 | int (*func)(struct inode *inode, struct file *file, | ||
90 | unsigned int cmd, void *arg)); | ||
91 | |||
92 | /* helper functions to alloc / release struct video_device, the | ||
93 | later can be used for video_device->release() */ | ||
94 | struct video_device *video_device_alloc(void); | ||
95 | void video_device_release(struct video_device *vfd); | ||
96 | |||
21 | /* | 97 | /* |
22 | * M I S C E L L A N E O U S | 98 | * M I S C E L L A N E O U S |
23 | */ | 99 | */ |
diff --git a/include/media/video-buf.h b/include/media/video-buf.h index ee8eb15c0ea6..8ecfd78e0027 100644 --- a/include/media/video-buf.h +++ b/include/media/video-buf.h | |||
@@ -17,7 +17,7 @@ | |||
17 | * (at your option) any later version. | 17 | * (at your option) any later version. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/videodev.h> | 20 | #include <linux/videodev2.h> |
21 | 21 | ||
22 | #define UNSET (-1U) | 22 | #define UNSET (-1U) |
23 | 23 | ||