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>

+18 -20
+1 -1
drivers/media/Kconfig
··· 53 53 If you are unsure as to whether this is required, answer Y. 54 54 55 55 config VIDEO_V4L2 56 - tristate 56 + bool 57 57 default y 58 58 59 59 source "drivers/media/video/Kconfig"
+1 -1
drivers/media/video/zoran.h
··· 267 267 }; 268 268 269 269 /* whoops, this one is undeclared if !v4l2 */ 270 - #ifndef HAVE_V4L2 270 + #ifndef CONFIG_VIDEO_V4L2 271 271 struct v4l2_jpegcompression { 272 272 int quality; 273 273 int APPn;
+11 -11
drivers/media/video/zoran_driver.c
··· 86 86 #include "zoran_device.h" 87 87 #include "zoran_card.h" 88 88 89 - #ifdef HAVE_V4L2 89 + #ifdef CONFIG_VIDEO_V4L2 90 90 /* we declare some card type definitions here, they mean 91 91 * the same as the v4l1 ZORAN_VID_TYPE above, except it's v4l2 */ 92 92 #define ZORAN_V4L2_VID_FLAGS ( \ ··· 103 103 { 104 104 .name = "15-bit RGB", 105 105 .palette = VIDEO_PALETTE_RGB555, 106 - #ifdef HAVE_V4L2 106 + #ifdef CONFIG_VIDEO_V4L2 107 107 #ifdef __LITTLE_ENDIAN 108 108 .fourcc = V4L2_PIX_FMT_RGB555, 109 109 #else ··· 117 117 }, { 118 118 .name = "16-bit RGB", 119 119 .palette = VIDEO_PALETTE_RGB565, 120 - #ifdef HAVE_V4L2 120 + #ifdef CONFIG_VIDEO_V4L2 121 121 #ifdef __LITTLE_ENDIAN 122 122 .fourcc = V4L2_PIX_FMT_RGB565, 123 123 #else ··· 131 131 }, { 132 132 .name = "24-bit RGB", 133 133 .palette = VIDEO_PALETTE_RGB24, 134 - #ifdef HAVE_V4L2 134 + #ifdef CONFIG_VIDEO_V4L2 135 135 #ifdef __LITTLE_ENDIAN 136 136 .fourcc = V4L2_PIX_FMT_BGR24, 137 137 #else ··· 145 145 }, { 146 146 .name = "32-bit RGB", 147 147 .palette = VIDEO_PALETTE_RGB32, 148 - #ifdef HAVE_V4L2 148 + #ifdef CONFIG_VIDEO_V4L2 149 149 #ifdef __LITTLE_ENDIAN 150 150 .fourcc = V4L2_PIX_FMT_BGR32, 151 151 #else ··· 159 159 }, { 160 160 .name = "4:2:2, packed, YUYV", 161 161 .palette = VIDEO_PALETTE_YUV422, 162 - #ifdef HAVE_V4L2 162 + #ifdef CONFIG_VIDEO_V4L2 163 163 .fourcc = V4L2_PIX_FMT_YUYV, 164 164 .colorspace = V4L2_COLORSPACE_SMPTE170M, 165 165 #endif ··· 169 169 }, { 170 170 .name = "Hardware-encoded Motion-JPEG", 171 171 .palette = -1, 172 - #ifdef HAVE_V4L2 172 + #ifdef CONFIG_VIDEO_V4L2 173 173 .fourcc = V4L2_PIX_FMT_MJPEG, 174 174 .colorspace = V4L2_COLORSPACE_SMPTE170M, 175 175 #endif ··· 210 210 module_param(lock_norm, int, 0); 211 211 MODULE_PARM_DESC(lock_norm, "Users can't change norm"); 212 212 213 - #ifdef HAVE_V4L2 213 + #ifdef CONFIG_VIDEO_V4L2 214 214 /* small helper function for calculating buffersizes for v4l2 215 215 * we calculate the nearest higher power-of-two, which 216 216 * will be the recommended buffersize */ ··· 1761 1761 return wait_grab_pending(zr); 1762 1762 } 1763 1763 1764 - #ifdef HAVE_V4L2 1764 + #ifdef CONFIG_VIDEO_V4L2 1765 1765 /* get the status of a buffer in the clients buffer queue */ 1766 1766 static int 1767 1767 zoran_v4l2_buffer_status (struct file *file, ··· 2676 2676 } 2677 2677 break; 2678 2678 2679 - #ifdef HAVE_V4L2 2679 + #ifdef CONFIG_VIDEO_V4L2 2680 2680 2681 2681 /* The new video4linux2 capture interface - much nicer than video4linux1, since 2682 2682 * it allows for integrating the JPEG capturing calls inside standard v4l2 ··· 4689 4689 struct video_device zoran_template __devinitdata = { 4690 4690 .name = ZORAN_NAME, 4691 4691 .type = ZORAN_VID_TYPE, 4692 - #ifdef HAVE_V4L2 4692 + #ifdef CONFIG_VIDEO_V4L2 4693 4693 .type2 = ZORAN_V4L2_VID_FLAGS, 4694 4694 #endif 4695 4695 .hardware = ZORAN_HARDWARE,
+1 -2
include/linux/videodev.h
··· 14 14 15 15 #include <linux/videodev2.h> 16 16 17 - #ifdef CONFIG_VIDEO_V4L1_COMPAT 18 - #define HAVE_V4L1 1 17 + #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) 19 18 20 19 struct video_capability 21 20 {
-2
include/linux/videodev2.h
··· 22 22 #endif 23 23 #include <linux/types.h> 24 24 25 - #define HAVE_V4L2 1 26 - 27 25 /* 28 26 * Common stuff for both V4L1 and V4L2 29 27 * Moved from videodev.h
+4 -3
include/media/v4l2-dev.h
··· 194 194 195 195 196 196 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); 197 - #ifdef HAVE_V4L1 197 + #ifdef CONFIG_VIDEO_V4L1_COMPAT 198 198 /* buffer type is struct vidio_mbuf * */ 199 199 int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); 200 200 #endif ··· 335 335 unsigned int cmd, void *arg)); 336 336 337 337 338 - #ifdef HAVE_V4L1 338 + #ifdef CONFIG_VIDEO_V4L1_COMPAT 339 339 #include <linux/mm.h> 340 340 341 341 extern struct video_device* video_devdata(struct file*); ··· 357 357 class_device_remove_file(&vfd->class_dev, attr); 358 358 } 359 359 360 + #endif /* CONFIG_VIDEO_V4L1_COMPAT */ 361 + 360 362 #ifdef OBSOLETE_OWNER /* to be removed soon */ 361 363 /* helper functions to access driver private data. */ 362 364 static inline void *video_get_drvdata(struct video_device *dev) ··· 374 372 375 373 extern int video_exclusive_open(struct inode *inode, struct file *file); 376 374 extern int video_exclusive_release(struct inode *inode, struct file *file); 377 - #endif /* HAVE_V4L1 */ 378 375 379 376 #endif /* _V4L2_DEV_H */