Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[safe/jmp/linux-2.6] / include / linux / videodev.h
index 22e6e4b..b19eab1 100644 (file)
@@ -1,96 +1,39 @@
+/*
+ *     Video for Linux version 1 - OBSOLETE
+ *
+ *     Header file for v4l1 drivers and applications, for
+ *     Linux kernels 2.2.x or 2.4.x.
+ *
+ *     Provides header for legacy drivers and applications
+ *
+ *     See http://linuxtv.org for more info
+ *
+ */
 #ifndef __LINUX_VIDEODEV_H
 #define __LINUX_VIDEODEV_H
 
-#include <linux/compiler.h>
 #include <linux/types.h>
-
-#define HAVE_V4L2 1
+#include <linux/ioctl.h>
 #include <linux/videodev2.h>
 
-#ifdef __KERNEL__
+#if defined(__MIN_V4L1) && defined (__KERNEL__)
 
-#include <linux/poll.h>
-#include <linux/mm.h>
-#include <linux/device.h>
+/*
+ * Used by those V4L2 core functions that need a minimum V4L1 support,
+ * in order to allow V4L1 Compatibilty code compilation.
+ */
 
-struct video_device
+struct video_mbuf
 {
-       /* device info */
-       struct device *dev;
-       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);
-
-
-       /* 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;
-
-       /* for videodev.c intenal usage -- please don't touch */
-       int users;                     /* video_exclusive_{open|close} ... */
-       struct semaphore lock;         /* ... helper function uses these   */
-       char devfs_name[64];           /* devfs */
-       struct class_device class_dev; /* sysfs */
+       int     size;           /* Total memory to map */
+       int     frames;         /* Frames */
+       int     offsets[VIDEO_MAX_FRAME];
 };
 
-#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*);
-
-#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
-static inline void
-video_device_create_file(struct video_device *vfd,
-                        struct class_device_attribute *attr)
-{
-       class_device_create_file(&vfd->class_dev, attr);
-}
-static inline void
-video_device_remove_file(struct video_device *vfd,
-                        struct class_device_attribute *attr)
-{
-       class_device_remove_file(&vfd->class_dev, attr);
-}
-
-/* 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);
-
-/* helper functions to access driver private data. */
-static inline void *video_get_drvdata(struct video_device *dev)
-{
-       return dev->priv;
-}
-
-static inline void video_set_drvdata(struct video_device *dev, void *data)
-{
-       dev->priv = data;
-}
+#define VIDIOCGMBUF            _IOR('v',20, struct video_mbuf)         /* Memory map buffer info */
 
-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__ */
+#else
+#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
 
 #define VID_TYPE_CAPTURE       1       /* Can capture */
 #define VID_TYPE_TUNER         2       /* Can tune */
@@ -260,9 +203,6 @@ struct video_key
        __u32   flags;
 };
 
-
-#define VIDEO_MAX_FRAME                32
-
 struct video_mbuf
 {
        int     size;           /* Total memory to map */
@@ -270,10 +210,8 @@ struct video_mbuf
        int     offsets[VIDEO_MAX_FRAME];
 };
 
-
 #define        VIDEO_NO_UNIT   (-1)
 
-
 struct video_unit
 {
        int     video;          /* Video minor */
@@ -390,47 +328,9 @@ struct video_code
 #define VID_PLAY_RESET                 13
 #define VID_PLAY_END_MARK              14
 
+#endif /* CONFIG_VIDEO_V4L1_COMPAT */
+#endif /* __MIN_V4L1 */
 
-
-#define VID_HARDWARE_BT848     1
-#define VID_HARDWARE_QCAM_BW   2
-#define VID_HARDWARE_PMS       3
-#define VID_HARDWARE_QCAM_C    4
-#define VID_HARDWARE_PSEUDO    5
-#define VID_HARDWARE_SAA5249   6
-#define VID_HARDWARE_AZTECH    7
-#define VID_HARDWARE_SF16MI    8
-#define VID_HARDWARE_RTRACK    9
-#define VID_HARDWARE_ZOLTRIX   10
-#define VID_HARDWARE_SAA7146    11
-#define VID_HARDWARE_VIDEUM    12      /* Reserved for Winnov videum */
-#define VID_HARDWARE_RTRACK2   13
-#define VID_HARDWARE_PERMEDIA2 14      /* Reserved for Permedia2 */
-#define VID_HARDWARE_RIVA128   15      /* Reserved for RIVA 128 */
-#define VID_HARDWARE_PLANB     16      /* PowerMac motherboard video-in */
-#define VID_HARDWARE_BROADWAY  17      /* Broadway project */
-#define VID_HARDWARE_GEMTEK    18
-#define VID_HARDWARE_TYPHOON   19
-#define VID_HARDWARE_VINO      20      /* SGI Indy Vino */
-#define VID_HARDWARE_CADET     21      /* Cadet radio */
-#define VID_HARDWARE_TRUST     22      /* Trust FM Radio */
-#define VID_HARDWARE_TERRATEC  23      /* TerraTec ActiveRadio */
-#define VID_HARDWARE_CPIA      24
-#define VID_HARDWARE_ZR36120   25      /* Zoran ZR36120/ZR36125 */
-#define VID_HARDWARE_ZR36067   26      /* Zoran ZR36067/36060 */
-#define VID_HARDWARE_OV511     27
-#define VID_HARDWARE_ZR356700  28      /* Zoran 36700 series */
-#define VID_HARDWARE_W9966     29
-#define VID_HARDWARE_SE401     30      /* SE401 USB webcams */
-#define VID_HARDWARE_PWC       31      /* Philips webcams */
-#define VID_HARDWARE_MEYE      32      /* Sony Vaio MotionEye cameras */
-#define VID_HARDWARE_CPIA2     33
-#define VID_HARDWARE_VICAM      34
-#define VID_HARDWARE_SF16FMR2  35
-#define VID_HARDWARE_W9968CF   36
-#define VID_HARDWARE_SAA7114H   37
-#define VID_HARDWARE_SN9C102   38
-#define VID_HARDWARE_ARV       39
 #endif /* __LINUX_VIDEODEV_H */
 
 /*