summaryrefslogtreecommitdiff
path: root/linux/include/media/v4l2-dev.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-07-26 05:47:42 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-26 05:47:42 -0300
commitd1c3ce25c000fa72c7bfb3b42d88bfbe4f5e37fa (patch)
tree551d1ce9ed77fcb5b2763cd8f606b46a043de386 /linux/include/media/v4l2-dev.h
parent6324f3b71dfb070913efba2306010ae2e0a1df11 (diff)
parente768886b19cdc2ba666bd52faa7797ff4151ced7 (diff)
downloadmediapointer-dvb-s2-d1c3ce25c000fa72c7bfb3b42d88bfbe4f5e37fa.tar.gz
mediapointer-dvb-s2-d1c3ce25c000fa72c7bfb3b42d88bfbe4f5e37fa.tar.bz2
merge: http://linuxtv.org/hg/~mkrufky/sms1xxx
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/include/media/v4l2-dev.h')
-rw-r--r--linux/include/media/v4l2-dev.h89
1 files changed, 31 insertions, 58 deletions
diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h
index aa0fd8c94..46a671e32 100644
--- a/linux/include/media/v4l2-dev.h
+++ b/linux/include/media/v4l2-dev.h
@@ -39,43 +39,6 @@
#define VFL_TYPE_RADIO 2
#define VFL_TYPE_VTX 3
-/* Video standard functions */
-extern const char *v4l2_norm_to_name(v4l2_std_id id);
-extern int v4l2_video_std_construct(struct v4l2_standard *vs,
- int id, const char *name);
-/* Prints the ioctl in a human-readable format */
-extern void v4l_printk_ioctl(unsigned int cmd);
-
-/* prority handling */
-struct v4l2_prio_state {
- atomic_t prios[4];
-};
-int v4l2_prio_init(struct v4l2_prio_state *global);
-int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
- enum v4l2_priority new);
-int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
-int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
-enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
-int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
-
-/* names for fancy debug output */
-extern const char *v4l2_field_names[];
-extern const char *v4l2_type_names[];
-
-/* Compatibility layer interface -- v4l1-compat module */
-typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg);
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
-int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
- int cmd, void *arg, v4l2_kioctl driver_ioctl);
-#else
-#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL
-#endif
-
-/* 32 Bits compatibility layer for 64 bits processors */
-extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
- unsigned long arg);
-
/*
* Newer version of video_device, handled by videodev2.c
* This version moves redundant code from video device code to
@@ -85,25 +48,25 @@ extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
struct video_device
{
/* device ops */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
const struct file_operations *fops;
-#else
- struct file_operations *fops;
-#endif
/* sysfs */
- struct device class_dev; /* v4l device */
- struct device *dev; /* device parent */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+ struct device dev; /* v4l device */
+#else
+ struct class_device dev;
+#endif
+ struct device *parent; /* device parent */
/* device info */
char name[32];
- int type; /* v4l1 */
- int type2; /* v4l2 */
+ int type; /* v4l1 */
+ int type2; /* v4l2 */
int minor;
/* attribute to diferentiate multiple indexs on one physical device */
int index;
- int debug; /* Activates debug level*/
+ int debug; /* Activates debug level*/
/* Video standard vars */
v4l2_std_id tvnorms; /* Supported tv norms */
@@ -359,45 +322,55 @@ void *priv;
};
/* Class-dev to video-device */
-#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
+#define to_video_device(cd) container_of(cd, struct video_device, dev)
/* Version 2 functions */
extern int video_register_device(struct video_device *vfd, int type, int nr);
int video_register_device_index(struct video_device *vfd, int type, int nr,
int index);
void video_unregister_device(struct video_device *);
-extern int video_ioctl2(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long 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);
-/* Include support for obsoleted stuff */
-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));
-
#ifdef CONFIG_VIDEO_V4L1_COMPAT
#include <linux/mm.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
+static inline int __must_check
+video_device_create_file(struct video_device *vfd,
+ struct class_device_attribute *attr)
+{
+ int ret = class_device_create_file(&vfd->dev, attr);
+ if (ret < 0)
+ printk(KERN_WARNING "%s error: %d\n", __func__, ret);
+ return ret;
+}
+static inline void
+video_device_remove_file(struct video_device *vfd,
+ struct class_device_attribute *attr)
+{
+ class_device_remove_file(&vfd->dev, attr);
+}
+#else
static inline int __must_check
video_device_create_file(struct video_device *vfd,
struct device_attribute *attr)
{
- int ret = device_create_file(&vfd->class_dev, attr);
+ int ret = device_create_file(&vfd->dev, attr);
if (ret < 0)
- printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
+ printk(KERN_WARNING "%s error: %d\n", __func__, ret);
return ret;
}
static inline void
video_device_remove_file(struct video_device *vfd,
struct device_attribute *attr)
{
- device_remove_file(&vfd->class_dev, attr);
+ device_remove_file(&vfd->dev, attr);
}
+#endif
#endif /* CONFIG_VIDEO_V4L1_COMPAT */