aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
Diffstat (limited to 'include/media')
-rw-r--r--include/media/saa7146_vv.h1
-rw-r--r--include/media/v4l2-common.h15
-rw-r--r--include/media/v4l2-dev.h45
-rw-r--r--include/media/v4l2-ioctl.h57
4 files changed, 73 insertions, 45 deletions
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
index 89c442eb8849..1d104096619c 100644
--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -2,6 +2,7 @@
2#define __SAA7146_VV__ 2#define __SAA7146_VV__
3 3
4#include <media/v4l2-common.h> 4#include <media/v4l2-common.h>
5#include <media/v4l2-ioctl.h>
5#include <media/saa7146.h> 6#include <media/saa7146.h>
6#include <media/videobuf-dma-sg.h> 7#include <media/videobuf-dma-sg.h>
7 8
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 020d05758bd8..8bbb526a5a24 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -79,6 +79,21 @@
79 79
80/* ------------------------------------------------------------------------- */ 80/* ------------------------------------------------------------------------- */
81 81
82/* Priority helper functions */
83
84struct v4l2_prio_state {
85 atomic_t prios[4];
86};
87int v4l2_prio_init(struct v4l2_prio_state *global);
88int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
89 enum v4l2_priority new);
90int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
91int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
92enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
93int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
94
95/* ------------------------------------------------------------------------- */
96
82/* Control helper functions */ 97/* Control helper functions */
83 98
84int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, 99int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 185372ffa270..ad62d322e178 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -39,43 +39,6 @@
39#define VFL_TYPE_RADIO 2 39#define VFL_TYPE_RADIO 2
40#define VFL_TYPE_VTX 3 40#define VFL_TYPE_VTX 3
41 41
42/* Video standard functions */
43extern const char *v4l2_norm_to_name(v4l2_std_id id);
44extern int v4l2_video_std_construct(struct v4l2_standard *vs,
45 int id, const char *name);
46/* Prints the ioctl in a human-readable format */
47extern void v4l_printk_ioctl(unsigned int cmd);
48
49/* prority handling */
50struct v4l2_prio_state {
51 atomic_t prios[4];
52};
53int v4l2_prio_init(struct v4l2_prio_state *global);
54int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
55 enum v4l2_priority new);
56int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
57int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
58enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
59int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
60
61/* names for fancy debug output */
62extern const char *v4l2_field_names[];
63extern const char *v4l2_type_names[];
64
65/* Compatibility layer interface -- v4l1-compat module */
66typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
67 unsigned int cmd, void *arg);
68#ifdef CONFIG_VIDEO_V4L1_COMPAT
69int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
70 int cmd, void *arg, v4l2_kioctl driver_ioctl);
71#else
72#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL
73#endif
74
75/* 32 Bits compatibility layer for 64 bits processors */
76extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
77 unsigned long arg);
78
79/* 42/*
80 * Newer version of video_device, handled by videodev2.c 43 * Newer version of video_device, handled by videodev2.c
81 * This version moves redundant code from video device code to 44 * This version moves redundant code from video device code to
@@ -352,20 +315,12 @@ extern int video_register_device(struct video_device *vfd, int type, int nr);
352int video_register_device_index(struct video_device *vfd, int type, int nr, 315int video_register_device_index(struct video_device *vfd, int type, int nr,
353 int index); 316 int index);
354void video_unregister_device(struct video_device *); 317void video_unregister_device(struct video_device *);
355extern int video_ioctl2(struct inode *inode, struct file *file,
356 unsigned int cmd, unsigned long arg);
357 318
358/* helper functions to alloc / release struct video_device, the 319/* helper functions to alloc / release struct video_device, the
359 later can be used for video_device->release() */ 320 later can be used for video_device->release() */
360struct video_device *video_device_alloc(void); 321struct video_device *video_device_alloc(void);
361void video_device_release(struct video_device *vfd); 322void video_device_release(struct video_device *vfd);
362 323
363/* Include support for obsoleted stuff */
364extern int video_usercopy(struct inode *inode, struct file *file,
365 unsigned int cmd, unsigned long arg,
366 int (*func)(struct inode *inode, struct file *file,
367 unsigned int cmd, void *arg));
368
369#ifdef CONFIG_VIDEO_V4L1_COMPAT 324#ifdef CONFIG_VIDEO_V4L1_COMPAT
370#include <linux/mm.h> 325#include <linux/mm.h>
371 326
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
new file mode 100644
index 000000000000..685b1b62a054
--- /dev/null
+++ b/include/media/v4l2-ioctl.h
@@ -0,0 +1,57 @@
1/*
2 *
3 * V 4 L 2 D R I V E R H E L P E R A P I
4 *
5 * Moved from videodev2.h
6 *
7 * Some commonly needed functions for drivers (v4l2-common.o module)
8 */
9#ifndef _V4L2_IOCTL_H
10#define _V4L2_IOCTL_H
11
12#include <linux/poll.h>
13#include <linux/fs.h>
14#include <linux/device.h>
15#include <linux/mutex.h>
16#include <linux/compiler.h> /* need __user */
17#ifdef CONFIG_VIDEO_V4L1_COMPAT
18#include <linux/videodev.h>
19#else
20#include <linux/videodev2.h>
21#endif
22
23/* Video standard functions */
24extern const char *v4l2_norm_to_name(v4l2_std_id id);
25extern int v4l2_video_std_construct(struct v4l2_standard *vs,
26 int id, const char *name);
27/* Prints the ioctl in a human-readable format */
28extern void v4l_printk_ioctl(unsigned int cmd);
29
30/* names for fancy debug output */
31extern const char *v4l2_field_names[];
32extern const char *v4l2_type_names[];
33
34/* Compatibility layer interface -- v4l1-compat module */
35typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
36 unsigned int cmd, void *arg);
37#ifdef CONFIG_VIDEO_V4L1_COMPAT
38int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
39 int cmd, void *arg, v4l2_kioctl driver_ioctl);
40#else
41#define v4l_compat_translate_ioctl(inode, file, cmd, arg, ioctl) (-EINVAL)
42#endif
43
44/* 32 Bits compatibility layer for 64 bits processors */
45extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
46 unsigned long arg);
47
48extern int video_ioctl2(struct inode *inode, struct file *file,
49 unsigned int cmd, unsigned long arg);
50
51/* Include support for obsoleted stuff */
52extern int video_usercopy(struct inode *inode, struct file *file,
53 unsigned int cmd, unsigned long arg,
54 int (*func)(struct inode *inode, struct file *file,
55 unsigned int cmd, void *arg));
56
57#endif /* _V4L2_IOCTL_H */