]> err.no Git - linux-2.6/blobdiff - include/media/v4l2-dev.h
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6] / include / media / v4l2-dev.h
index c2f54d2c9a4c946fb19b7358e43df0ed3ed5cf28..810462f8a374b63ac3096414ada7b9aff6d5732d 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/compiler.h> /* need __user */
-#ifdef CONFIG_VIDEO_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
 #include <linux/videodev.h>
 #else
 #include <linux/videodev2.h>
@@ -40,8 +40,6 @@
 #define VFL_TYPE_RADIO         2
 #define VFL_TYPE_VTX           3
 
-       const struct file_operations *fops;
-
 /*  Video standard functions  */
 extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
 extern int v4l2_video_std_construct(struct v4l2_standard *vs,
@@ -92,7 +90,7 @@ struct v4l2_tvnorm {
 struct video_device
 {
        /* device ops */
-       struct file_operations *fops;
+       const struct file_operations *fops;
 
        /* device info */
        struct device *dev;
@@ -196,7 +194,7 @@ struct video_device
 
 
        int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
                        /* buffer type is struct vidio_mbuf * */
        int (*vidiocgmbuf)  (struct file *file, void *fh, struct video_mbuf *p);
 #endif
@@ -234,6 +232,12 @@ struct video_device
                                        struct v4l2_control *a);
        int (*vidioc_s_ctrl)           (struct file *file, void *fh,
                                        struct v4l2_control *a);
+       int (*vidioc_g_ext_ctrls)      (struct file *file, void *fh,
+                                       struct v4l2_ext_controls *a);
+       int (*vidioc_s_ext_ctrls)      (struct file *file, void *fh,
+                                       struct v4l2_ext_controls *a);
+       int (*vidioc_try_ext_ctrls)    (struct file *file, void *fh,
+                                       struct v4l2_ext_controls *a);
        int (*vidioc_querymenu)        (struct file *file, void *fh,
                                        struct v4l2_querymenu *a);
 
@@ -297,7 +301,7 @@ struct video_device
        int (*vidioc_log_status)       (struct file *file, void *fh);
 
 
-#if OBSOLETE_OWNER /* to be removed soon */
+#ifdef OBSOLETE_OWNER /* to be removed soon */
 /* obsolete -- fops->owner is used instead */
 struct module *owner;
 /* dev->driver_data will be used instead some day.
@@ -310,7 +314,6 @@ void *priv;
        /* for videodev.c intenal usage -- please don't touch */
        int users;                     /* video_exclusive_{open|close} ... */
        struct mutex lock;             /* ... helper function uses these   */
-       char devfs_name[64];           /* devfs */
        struct class_device class_dev; /* sysfs */
 };
 
@@ -332,17 +335,20 @@ extern int video_usercopy(struct inode *inode, struct file *file,
                                      unsigned int cmd, void *arg));
 
 
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
 #include <linux/mm.h>
 
 extern struct video_device* video_devdata(struct file*);
 
 #define to_video_device(cd) container_of(cd, struct video_device, class_dev)
-static inline void
+static inline int
 video_device_create_file(struct video_device *vfd,
                         struct class_device_attribute *attr)
 {
-       class_device_create_file(&vfd->class_dev, attr);
+       int ret = class_device_create_file(&vfd->class_dev, attr);
+       if (ret < 0)
+               printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
+       return ret;
 }
 static inline void
 video_device_remove_file(struct video_device *vfd,
@@ -351,7 +357,9 @@ video_device_remove_file(struct video_device *vfd,
        class_device_remove_file(&vfd->class_dev, attr);
 }
 
-#if OBSOLETE_OWNER /* to be removed soon */
+#endif /* CONFIG_VIDEO_V4L1_COMPAT */
+
+#ifdef OBSOLETE_OWNER /* to be removed soon */
 /* helper functions to access driver private data. */
 static inline void *video_get_drvdata(struct video_device *dev)
 {
@@ -366,6 +374,5 @@ static inline void video_set_drvdata(struct video_device *dev, void *data)
 
 extern int video_exclusive_open(struct inode *inode, struct file *file);
 extern int video_exclusive_release(struct inode *inode, struct file *file);
-#endif /* HAVE_V4L1 */
 
 #endif /* _V4L2_DEV_H */