diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-10 11:01:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-10 12:45:55 -0400 |
commit | 8a905162e038367503bac732bf1e3e01c19158b9 (patch) | |
tree | bf72a91df67baf47560812ceb756d1a19eb289c7 | |
parent | c663155c3db58d1fff43a105eb5a0e9147ec2a6b (diff) |
V4L/DVB (4605): Fixes an issue with V4L1 and make headers-install
V4L1 support should be disabled when no CONFIG_VIDEO_V4L1_COMPAT is defined,
to allow checking for broken V4L2 ports. This is very important during the
migration phase for V4L2 API.
However, userspace apps should be capable of using both APIs, since they need
to test at runtime, via VIDIOCGCAP ioctl, if V4L1 is supported. So, when
__KERNEL__ is not defined, those ioctls and corresponding structs should be
visible.
This patch also removes the obsolete defines HAVE_V4L1 and HAVE_V4L2, that
where causing some confusion, and were replaced by CONFIG_VIDEO_V4L1_COMPAT
and CONFIG_VIDEO_V4L2.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/video/zoran.h | 2 | ||||
-rw-r--r-- | drivers/media/video/zoran_driver.c | 22 | ||||
-rw-r--r-- | include/linux/videodev.h | 3 | ||||
-rw-r--r-- | include/linux/videodev2.h | 2 | ||||
-rw-r--r-- | include/media/v4l2-dev.h | 7 |
6 files changed, 18 insertions, 20 deletions
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig index ef52e6da01ed..ed4aa4e7912c 100644 --- a/drivers/media/Kconfig +++ b/drivers/media/Kconfig | |||
@@ -53,7 +53,7 @@ config VIDEO_V4L1_COMPAT | |||
53 | If you are unsure as to whether this is required, answer Y. | 53 | If you are unsure as to whether this is required, answer Y. |
54 | 54 | ||
55 | config VIDEO_V4L2 | 55 | config VIDEO_V4L2 |
56 | tristate | 56 | bool |
57 | default y | 57 | default y |
58 | 58 | ||
59 | source "drivers/media/video/Kconfig" | 59 | source "drivers/media/video/Kconfig" |
diff --git a/drivers/media/video/zoran.h b/drivers/media/video/zoran.h index ffcda95ed9d4..8fb4a3414e0a 100644 --- a/drivers/media/video/zoran.h +++ b/drivers/media/video/zoran.h | |||
@@ -267,7 +267,7 @@ struct zoran_v4l_settings { | |||
267 | }; | 267 | }; |
268 | 268 | ||
269 | /* whoops, this one is undeclared if !v4l2 */ | 269 | /* whoops, this one is undeclared if !v4l2 */ |
270 | #ifndef HAVE_V4L2 | 270 | #ifndef CONFIG_VIDEO_V4L2 |
271 | struct v4l2_jpegcompression { | 271 | struct v4l2_jpegcompression { |
272 | int quality; | 272 | int quality; |
273 | int APPn; | 273 | int APPn; |
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c index d9a5876eb386..5f90db27892b 100644 --- a/drivers/media/video/zoran_driver.c +++ b/drivers/media/video/zoran_driver.c | |||
@@ -86,7 +86,7 @@ | |||
86 | #include "zoran_device.h" | 86 | #include "zoran_device.h" |
87 | #include "zoran_card.h" | 87 | #include "zoran_card.h" |
88 | 88 | ||
89 | #ifdef HAVE_V4L2 | 89 | #ifdef CONFIG_VIDEO_V4L2 |
90 | /* we declare some card type definitions here, they mean | 90 | /* we declare some card type definitions here, they mean |
91 | * the same as the v4l1 ZORAN_VID_TYPE above, except it's v4l2 */ | 91 | * the same as the v4l1 ZORAN_VID_TYPE above, except it's v4l2 */ |
92 | #define ZORAN_V4L2_VID_FLAGS ( \ | 92 | #define ZORAN_V4L2_VID_FLAGS ( \ |
@@ -103,7 +103,7 @@ const struct zoran_format zoran_formats[] = { | |||
103 | { | 103 | { |
104 | .name = "15-bit RGB", | 104 | .name = "15-bit RGB", |
105 | .palette = VIDEO_PALETTE_RGB555, | 105 | .palette = VIDEO_PALETTE_RGB555, |
106 | #ifdef HAVE_V4L2 | 106 | #ifdef CONFIG_VIDEO_V4L2 |
107 | #ifdef __LITTLE_ENDIAN | 107 | #ifdef __LITTLE_ENDIAN |
108 | .fourcc = V4L2_PIX_FMT_RGB555, | 108 | .fourcc = V4L2_PIX_FMT_RGB555, |
109 | #else | 109 | #else |
@@ -117,7 +117,7 @@ const struct zoran_format zoran_formats[] = { | |||
117 | }, { | 117 | }, { |
118 | .name = "16-bit RGB", | 118 | .name = "16-bit RGB", |
119 | .palette = VIDEO_PALETTE_RGB565, | 119 | .palette = VIDEO_PALETTE_RGB565, |
120 | #ifdef HAVE_V4L2 | 120 | #ifdef CONFIG_VIDEO_V4L2 |
121 | #ifdef __LITTLE_ENDIAN | 121 | #ifdef __LITTLE_ENDIAN |
122 | .fourcc = V4L2_PIX_FMT_RGB565, | 122 | .fourcc = V4L2_PIX_FMT_RGB565, |
123 | #else | 123 | #else |
@@ -131,7 +131,7 @@ const struct zoran_format zoran_formats[] = { | |||
131 | }, { | 131 | }, { |
132 | .name = "24-bit RGB", | 132 | .name = "24-bit RGB", |
133 | .palette = VIDEO_PALETTE_RGB24, | 133 | .palette = VIDEO_PALETTE_RGB24, |
134 | #ifdef HAVE_V4L2 | 134 | #ifdef CONFIG_VIDEO_V4L2 |
135 | #ifdef __LITTLE_ENDIAN | 135 | #ifdef __LITTLE_ENDIAN |
136 | .fourcc = V4L2_PIX_FMT_BGR24, | 136 | .fourcc = V4L2_PIX_FMT_BGR24, |
137 | #else | 137 | #else |
@@ -145,7 +145,7 @@ const struct zoran_format zoran_formats[] = { | |||
145 | }, { | 145 | }, { |
146 | .name = "32-bit RGB", | 146 | .name = "32-bit RGB", |
147 | .palette = VIDEO_PALETTE_RGB32, | 147 | .palette = VIDEO_PALETTE_RGB32, |
148 | #ifdef HAVE_V4L2 | 148 | #ifdef CONFIG_VIDEO_V4L2 |
149 | #ifdef __LITTLE_ENDIAN | 149 | #ifdef __LITTLE_ENDIAN |
150 | .fourcc = V4L2_PIX_FMT_BGR32, | 150 | .fourcc = V4L2_PIX_FMT_BGR32, |
151 | #else | 151 | #else |
@@ -159,7 +159,7 @@ const struct zoran_format zoran_formats[] = { | |||
159 | }, { | 159 | }, { |
160 | .name = "4:2:2, packed, YUYV", | 160 | .name = "4:2:2, packed, YUYV", |
161 | .palette = VIDEO_PALETTE_YUV422, | 161 | .palette = VIDEO_PALETTE_YUV422, |
162 | #ifdef HAVE_V4L2 | 162 | #ifdef CONFIG_VIDEO_V4L2 |
163 | .fourcc = V4L2_PIX_FMT_YUYV, | 163 | .fourcc = V4L2_PIX_FMT_YUYV, |
164 | .colorspace = V4L2_COLORSPACE_SMPTE170M, | 164 | .colorspace = V4L2_COLORSPACE_SMPTE170M, |
165 | #endif | 165 | #endif |
@@ -169,7 +169,7 @@ const struct zoran_format zoran_formats[] = { | |||
169 | }, { | 169 | }, { |
170 | .name = "Hardware-encoded Motion-JPEG", | 170 | .name = "Hardware-encoded Motion-JPEG", |
171 | .palette = -1, | 171 | .palette = -1, |
172 | #ifdef HAVE_V4L2 | 172 | #ifdef CONFIG_VIDEO_V4L2 |
173 | .fourcc = V4L2_PIX_FMT_MJPEG, | 173 | .fourcc = V4L2_PIX_FMT_MJPEG, |
174 | .colorspace = V4L2_COLORSPACE_SMPTE170M, | 174 | .colorspace = V4L2_COLORSPACE_SMPTE170M, |
175 | #endif | 175 | #endif |
@@ -210,7 +210,7 @@ static int lock_norm = 0; /* 1=Don't change TV standard (norm) */ | |||
210 | module_param(lock_norm, int, 0); | 210 | module_param(lock_norm, int, 0); |
211 | MODULE_PARM_DESC(lock_norm, "Users can't change norm"); | 211 | MODULE_PARM_DESC(lock_norm, "Users can't change norm"); |
212 | 212 | ||
213 | #ifdef HAVE_V4L2 | 213 | #ifdef CONFIG_VIDEO_V4L2 |
214 | /* small helper function for calculating buffersizes for v4l2 | 214 | /* small helper function for calculating buffersizes for v4l2 |
215 | * we calculate the nearest higher power-of-two, which | 215 | * we calculate the nearest higher power-of-two, which |
216 | * will be the recommended buffersize */ | 216 | * will be the recommended buffersize */ |
@@ -1761,7 +1761,7 @@ setup_overlay (struct file *file, | |||
1761 | return wait_grab_pending(zr); | 1761 | return wait_grab_pending(zr); |
1762 | } | 1762 | } |
1763 | 1763 | ||
1764 | #ifdef HAVE_V4L2 | 1764 | #ifdef CONFIG_VIDEO_V4L2 |
1765 | /* get the status of a buffer in the clients buffer queue */ | 1765 | /* get the status of a buffer in the clients buffer queue */ |
1766 | static int | 1766 | static int |
1767 | zoran_v4l2_buffer_status (struct file *file, | 1767 | zoran_v4l2_buffer_status (struct file *file, |
@@ -2676,7 +2676,7 @@ zoran_do_ioctl (struct inode *inode, | |||
2676 | } | 2676 | } |
2677 | break; | 2677 | break; |
2678 | 2678 | ||
2679 | #ifdef HAVE_V4L2 | 2679 | #ifdef CONFIG_VIDEO_V4L2 |
2680 | 2680 | ||
2681 | /* The new video4linux2 capture interface - much nicer than video4linux1, since | 2681 | /* The new video4linux2 capture interface - much nicer than video4linux1, since |
2682 | * it allows for integrating the JPEG capturing calls inside standard v4l2 | 2682 | * it allows for integrating the JPEG capturing calls inside standard v4l2 |
@@ -4689,7 +4689,7 @@ static struct file_operations zoran_fops = { | |||
4689 | struct video_device zoran_template __devinitdata = { | 4689 | struct video_device zoran_template __devinitdata = { |
4690 | .name = ZORAN_NAME, | 4690 | .name = ZORAN_NAME, |
4691 | .type = ZORAN_VID_TYPE, | 4691 | .type = ZORAN_VID_TYPE, |
4692 | #ifdef HAVE_V4L2 | 4692 | #ifdef CONFIG_VIDEO_V4L2 |
4693 | .type2 = ZORAN_V4L2_VID_FLAGS, | 4693 | .type2 = ZORAN_V4L2_VID_FLAGS, |
4694 | #endif | 4694 | #endif |
4695 | .hardware = ZORAN_HARDWARE, | 4695 | .hardware = ZORAN_HARDWARE, |
diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 518c7a32175e..8dba97a291f6 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h | |||
@@ -14,8 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/videodev2.h> | 15 | #include <linux/videodev2.h> |
16 | 16 | ||
17 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 17 | #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) |
18 | #define HAVE_V4L1 1 | ||
19 | 18 | ||
20 | struct video_capability | 19 | struct video_capability |
21 | { | 20 | { |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index b7146956a929..e3715d774197 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -22,8 +22,6 @@ | |||
22 | #endif | 22 | #endif |
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | 24 | ||
25 | #define HAVE_V4L2 1 | ||
26 | |||
27 | /* | 25 | /* |
28 | * Common stuff for both V4L1 and V4L2 | 26 | * Common stuff for both V4L1 and V4L2 |
29 | * Moved from videodev.h | 27 | * Moved from videodev.h |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 600d61d7d2ab..810462f8a374 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -194,7 +194,7 @@ struct video_device | |||
194 | 194 | ||
195 | 195 | ||
196 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); | 196 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); |
197 | #ifdef HAVE_V4L1 | 197 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
198 | /* buffer type is struct vidio_mbuf * */ | 198 | /* buffer type is struct vidio_mbuf * */ |
199 | int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); | 199 | int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); |
200 | #endif | 200 | #endif |
@@ -335,7 +335,7 @@ extern int video_usercopy(struct inode *inode, struct file *file, | |||
335 | unsigned int cmd, void *arg)); | 335 | unsigned int cmd, void *arg)); |
336 | 336 | ||
337 | 337 | ||
338 | #ifdef HAVE_V4L1 | 338 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
339 | #include <linux/mm.h> | 339 | #include <linux/mm.h> |
340 | 340 | ||
341 | extern struct video_device* video_devdata(struct file*); | 341 | extern struct video_device* video_devdata(struct file*); |
@@ -357,6 +357,8 @@ video_device_remove_file(struct video_device *vfd, | |||
357 | class_device_remove_file(&vfd->class_dev, attr); | 357 | class_device_remove_file(&vfd->class_dev, attr); |
358 | } | 358 | } |
359 | 359 | ||
360 | #endif /* CONFIG_VIDEO_V4L1_COMPAT */ | ||
361 | |||
360 | #ifdef OBSOLETE_OWNER /* to be removed soon */ | 362 | #ifdef OBSOLETE_OWNER /* to be removed soon */ |
361 | /* helper functions to access driver private data. */ | 363 | /* helper functions to access driver private data. */ |
362 | static inline void *video_get_drvdata(struct video_device *dev) | 364 | static inline void *video_get_drvdata(struct video_device *dev) |
@@ -372,6 +374,5 @@ static inline void video_set_drvdata(struct video_device *dev, void *data) | |||
372 | 374 | ||
373 | extern int video_exclusive_open(struct inode *inode, struct file *file); | 375 | extern int video_exclusive_open(struct inode *inode, struct file *file); |
374 | extern int video_exclusive_release(struct inode *inode, struct file *file); | 376 | extern int video_exclusive_release(struct inode *inode, struct file *file); |
375 | #endif /* HAVE_V4L1 */ | ||
376 | 377 | ||
377 | #endif /* _V4L2_DEV_H */ | 378 | #endif /* _V4L2_DEV_H */ |