summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-10-17 21:18:42 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-10-17 21:18:42 +0000
commit6571d469892fabdf7854dc0e6780900640263c7a (patch)
tree3c02433bd4c153b2e76e57fac13b99dae6739e0c
parent1b00938af1b3c6702a96ecbf1d6770558d6b1a33 (diff)
downloadmediapointer-dvb-s2-6571d469892fabdf7854dc0e6780900640263c7a.tar.gz
mediapointer-dvb-s2-6571d469892fabdf7854dc0e6780900640263c7a.tar.bz2
- 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>
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c13
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-video.c10
-rw-r--r--linux/drivers/media/video/saa7134/saa7134.h4
-rw-r--r--linux/include/linux/videodev.h102
-rw-r--r--linux/include/linux/videodev2.h102
-rw-r--r--linux/include/media/video-buf.h4
-rw-r--r--v4l/ChangeLog21
7 files changed, 149 insertions, 107 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index 23ac5967e..2a7630ec5 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-video.c,v 1.97 2005/10/16 12:13:58 mchehab Exp $
+ * $Id: cx88-video.c,v 1.98 2005/10/17 21:18:42 mchehab Exp $
*
* device driver for Conexant 2388x based TV cards
* video4linux video interface
@@ -38,6 +38,11 @@
#include "cx88.h"
+#if 1
+/* Include V4L1 specific functions. Should be removed soon */
+#include <linux/videodev.h>
+#endif
+
MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards");
MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
MODULE_LICENSE("GPL");
@@ -1444,7 +1449,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
struct v4l2_format *f = arg;
return cx8800_try_fmt(dev,fh,f);
}
-
+#ifdef HAVE_V4L1
/* --- streaming capture ------------------------------------- */
case VIDIOCGMBUF:
{
@@ -1470,6 +1475,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
}
return 0;
}
+#endif
case VIDIOC_REQBUFS:
return videobuf_reqbufs(get_queue(fh), arg);
@@ -1501,7 +1507,6 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
res_free(dev,fh,res);
return 0;
}
-
default:
return cx88_do_ioctl( inode, file, fh->radio, core, cmd, arg, video_do_ioctl );
}
@@ -1824,6 +1829,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
*id = 0;
return 0;
}
+#ifdef HAVE_V4L1
case VIDIOCSTUNER:
{
struct video_tuner *v = arg;
@@ -1834,6 +1840,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
cx88_call_i2c_clients(core,VIDIOCSTUNER,v);
return 0;
}
+#endif
case VIDIOC_S_TUNER:
{
struct v4l2_tuner *t = arg;
diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c
index 6c272a621..bca77d02b 100644
--- a/linux/drivers/media/video/saa7134/saa7134-video.c
+++ b/linux/drivers/media/video/saa7134/saa7134-video.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-video.c,v 1.44 2005/10/16 12:34:29 mchehab Exp $
+ * $Id: saa7134-video.c,v 1.45 2005/10/17 21:18:42 mchehab Exp $
*
* device driver for philips saa7134 based TV cards
* video4linux video interface
@@ -32,6 +32,11 @@
#include "saa7134-reg.h"
#include "saa7134.h"
+#if 1
+/* Include V4L1 specific functions. Should be removed soon */
+#include <linux/videodev.h>
+#endif
+
/* ------------------------------------------------------------------ */
static unsigned int video_debug = 0;
@@ -2069,7 +2074,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
struct v4l2_format *f = arg;
return saa7134_try_fmt(dev,fh,f);
}
-
+#ifdef HAVE_V4L1
case VIDIOCGMBUF:
{
struct video_mbuf *mbuf = arg;
@@ -2094,6 +2099,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
}
return 0;
}
+#endif
case VIDIOC_REQBUFS:
return videobuf_reqbufs(saa7134_queue(fh),arg);
diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h
index 88f91a6a2..805bffc37 100644
--- a/linux/drivers/media/video/saa7134/saa7134.h
+++ b/linux/drivers/media/video/saa7134/saa7134.h
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134.h,v 1.67 2005/10/16 12:13:58 mchehab Exp $
+ * $Id: saa7134.h,v 1.68 2005/10/17 21:18:42 mchehab Exp $
*
* v4l2 device driver for philips saa7134 based TV cards
*
@@ -25,7 +25,7 @@
#include <linux/pci.h>
#include <linux/i2c.h>
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
#include <linux/kdev_t.h>
#include <linux/input.h>
#include <linux/notifier.h>
diff --git a/linux/include/linux/videodev.h b/linux/include/linux/videodev.h
index b060da77d..2f2bb1c84 100644
--- a/linux/include/linux/videodev.h
+++ b/linux/include/linux/videodev.h
@@ -1,83 +1,16 @@
#ifndef __LINUX_VIDEODEV_H
#define __LINUX_VIDEODEV_H
-#include <linux/compiler.h>
#include <linux/types.h>
-#define HAVE_V4L2 1
+#define HAVE_V4L1 1
+
#include <linux/videodev2.h>
#ifdef __KERNEL__
-#include <linux/poll.h>
#include <linux/mm.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
-#include <linux/devfs_fs_kernel.h>
-#endif
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
-#include <linux/device.h>
-#endif
-
-struct video_device
-{
- /* device info */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- struct device *dev;
-#endif
- char name[32];
- int type; /* v4l1 */
- int type2; /* v4l2 */
- int hardware;
- int minor;
-
- /* device ops + callbacks */
- struct file_operations *fops;
- void (*release)(struct video_device *vfd);
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
- /* old, obsolete interface -- dropped in 2.5.x, don't use it */
- int (*open)(struct video_device *, int mode);
- void (*close)(struct video_device *);
- long (*read)(struct video_device *, char *, unsigned long, int noblock);
- long (*write)(struct video_device *, const char *, unsigned long, int noblock);
- unsigned int (*poll)(struct video_device *, struct file *, poll_table *);
- int (*ioctl)(struct video_device *, unsigned int , void *);
- int (*mmap)(struct video_device *, const char *, unsigned long);
- int (*initialize)(struct video_device *);
-#endif
-
-#if 1 /* to be removed in 2.7.x */
- /* obsolete -- fops->owner is used instead */
- struct module *owner;
- /* dev->driver_data will be used instead some day.
- * Use the video_{get|set}_drvdata() helper functions,
- * so the switch over will be transparent for you.
- * Or use {pci|usb}_{get|set}_drvdata() directly. */
- void *priv;
-#endif
-
- /* for videodev.c intenal usage -- please don't touch */
- int users; /* video_exclusive_{open|close} ... */
- struct semaphore lock; /* ... helper function uses these */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
- devfs_handle_t devfs_handle; /* devfs */
-#else
- char devfs_name[64]; /* devfs */
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- struct class_device class_dev; /* sysfs */
-#endif
-};
-
-#define VIDEO_MAJOR 81
-#define VFL_TYPE_GRABBER 0
-#define VFL_TYPE_VBI 1
-#define VFL_TYPE_RADIO 2
-#define VFL_TYPE_VTX 3
-
-extern int video_register_device(struct video_device *, int type, int nr);
-extern void video_unregister_device(struct video_device *);
extern struct video_device* video_devdata(struct file*);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
@@ -96,11 +29,7 @@ video_device_remove_file(struct video_device *vfd,
}
#endif
-/* helper functions to alloc / release struct video_device, the
- later can be used for video_device->release() */
-struct video_device *video_device_alloc(void);
-void video_device_release(struct video_device *vfd);
-
+#if 1 /* to be removed in 2.7.x */
/* helper functions to access driver private data. */
static inline void *video_get_drvdata(struct video_device *dev)
{
@@ -111,30 +40,12 @@ static inline void video_set_drvdata(struct video_device *dev, void *data)
{
dev->priv = data;
}
+#endif
extern int video_exclusive_open(struct inode *inode, struct file *file);
extern int video_exclusive_release(struct inode *inode, struct file *file);
-extern int video_usercopy(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg,
- int (*func)(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg));
#endif /* __KERNEL__ */
-#define VID_TYPE_CAPTURE 1 /* Can capture */
-#define VID_TYPE_TUNER 2 /* Can tune */
-#define VID_TYPE_TELETEXT 4 /* Does teletext */
-#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
-#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
-#define VID_TYPE_CLIPPING 32 /* Can clip */
-#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
-#define VID_TYPE_SCALES 128 /* Scalable */
-#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
-#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
-#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
-#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
-#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
-#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
-
struct video_capability
{
char name[32];
@@ -288,9 +199,6 @@ struct video_key
__u32 flags;
};
-
-#define VIDEO_MAX_FRAME 32
-
struct video_mbuf
{
int size; /* Total memory to map */
@@ -298,10 +206,8 @@ struct video_mbuf
int offsets[VIDEO_MAX_FRAME];
};
-
#define VIDEO_NO_UNIT (-1)
-
struct video_unit
{
int video; /* Video minor */
diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index b622cc226..24a4978bc 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -18,6 +18,108 @@
#endif
#include <linux/compiler.h> /* need __user */
+#include <linux/poll.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
+#include <linux/devfs_fs_kernel.h>
+#endif
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
+#include <linux/device.h>
+#endif
+
+#define HAVE_V4L2 1
+
+/*
+ * Common stuff for both V4L1 and V4L2
+ * Moved from videodev.h
+ */
+
+#define VIDEO_MAX_FRAME 32
+
+#define VFL_TYPE_GRABBER 0
+#define VFL_TYPE_VBI 1
+#define VFL_TYPE_RADIO 2
+#define VFL_TYPE_VTX 3
+
+struct video_device
+{
+ /* device info */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct device *dev;
+#endif
+ char name[32];
+ int type; /* v4l1 */
+ int type2; /* v4l2 */
+ int hardware;
+ int minor;
+
+ /* device ops + callbacks */
+ struct file_operations *fops;
+ void (*release)(struct video_device *vfd);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+ /* old, obsolete interface -- dropped in 2.5.x, don't use it */
+ int (*open)(struct video_device *, int mode);
+ void (*close)(struct video_device *);
+ long (*read)(struct video_device *, char *, unsigned long, int noblock);
+ long (*write)(struct video_device *, const char *, unsigned long, int noblock);
+ unsigned int (*poll)(struct video_device *, struct file *, poll_table *);
+ int (*ioctl)(struct video_device *, unsigned int , void *);
+ int (*mmap)(struct video_device *, const char *, unsigned long);
+ int (*initialize)(struct video_device *);
+#endif
+
+#if 1 /* to be removed in 2.7.x */
+ /* obsolete -- fops->owner is used instead */
+ struct module *owner;
+ /* dev->driver_data will be used instead some day.
+ * Use the video_{get|set}_drvdata() helper functions,
+ * so the switch over will be transparent for you.
+ * Or use {pci|usb}_{get|set}_drvdata() directly. */
+ void *priv;
+#endif
+
+ /* for videodev.c intenal usage -- please don't touch */
+ int users; /* video_exclusive_{open|close} ... */
+ struct semaphore lock; /* ... helper function uses these */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
+ devfs_handle_t devfs_handle; /* devfs */
+#else
+ char devfs_name[64]; /* devfs */
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct class_device class_dev; /* sysfs */
+#endif
+};
+
+#define VIDEO_MAJOR 81
+
+#define VID_TYPE_CAPTURE 1 /* Can capture */
+#define VID_TYPE_TUNER 2 /* Can tune */
+#define VID_TYPE_TELETEXT 4 /* Does teletext */
+#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
+#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
+#define VID_TYPE_CLIPPING 32 /* Can clip */
+#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
+#define VID_TYPE_SCALES 128 /* Scalable */
+#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
+#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
+#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
+#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
+#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
+#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
+
+extern int video_register_device(struct video_device *, int type, int nr);
+extern void video_unregister_device(struct video_device *);
+extern int video_usercopy(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg,
+ int (*func)(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg));
+
+/* helper functions to alloc / release struct video_device, the
+ later can be used for video_device->release() */
+struct video_device *video_device_alloc(void);
+void video_device_release(struct video_device *vfd);
+
/*
* M I S C E L L A N E O U S
*/
diff --git a/linux/include/media/video-buf.h b/linux/include/media/video-buf.h
index d5297072d..6c1dc2777 100644
--- a/linux/include/media/video-buf.h
+++ b/linux/include/media/video-buf.h
@@ -1,5 +1,5 @@
/*
- * $Id: video-buf.h,v 1.10 2005/10/16 12:13:58 mchehab Exp $
+ * $Id: video-buf.h,v 1.11 2005/10/17 21:18:42 mchehab Exp $
*
* generic helper functions for video4linux capture buffers, to handle
* memory management and PCI DMA. Right now bttv + saa7134 use it.
@@ -18,7 +18,7 @@
* (at your option) any later version.
*/
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
#define UNSET (-1U)
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index 193857bc0..6c55568e4 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,3 +1,24 @@
+2005-10-17 21:12 mchehab
+ * ../linux/include/linux/videodev.h:
+ * ../linux/include/linux/videodev2.h:
+ - Common stuff moved to videodev2.h.
+ - HAVE_V4L1 is defined on videodev.h
+ - HAVE_V4L2 moved to videodev2.h
+
+ * ../linux/include/media/video-buf.h:
+ - includes videodev2.h instead of videodev.h
+
+ * ../linux/drivers/media/video/cx88/cx88-video.c: (video_do_ioctl),
+ (radio_do_ioctl):
+ * ../linux/drivers/media/video/saa7134/saa7134-video.c:
+ (video_do_ioctl):
+ - if HAVE_V4L1, then V4L1 specific code is included.
+
+ * ../linux/drivers/media/video/saa7134/saa7134.h:
+ - includes videodev2.h instead of videodev.h
+
+ Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
+
2005-10-17 23:00 hhackmann
* ../linux/drivers/media/video/tda8290.c
../linux/drivers/media/video/tuner-core.c