aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dvb/dmx.h26
-rw-r--r--include/linux/i2c-id.h3
-rw-r--r--include/linux/videodev.h51
-rw-r--r--include/linux/videodev2.h392
4 files changed, 262 insertions, 210 deletions
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
index 2787b8a22ff1..c6a2353c4e68 100644
--- a/include/linux/dvb/dmx.h
+++ b/include/linux/dvb/dmx.h
@@ -88,20 +88,6 @@ typedef enum
88#define DMX_PES_PCR DMX_PES_PCR0 88#define DMX_PES_PCR DMX_PES_PCR0
89 89
90 90
91typedef enum
92{
93 DMX_SCRAMBLING_EV,
94 DMX_FRONTEND_EV
95} dmx_event_t;
96
97
98typedef enum
99{
100 DMX_SCRAMBLING_OFF,
101 DMX_SCRAMBLING_ON
102} dmx_scrambling_status_t;
103
104
105typedef struct dmx_filter 91typedef struct dmx_filter
106{ 92{
107 __u8 filter[DMX_FILTER_SIZE]; 93 __u8 filter[DMX_FILTER_SIZE];
@@ -132,17 +118,6 @@ struct dmx_pes_filter_params
132 __u32 flags; 118 __u32 flags;
133}; 119};
134 120
135
136struct dmx_event
137{
138 dmx_event_t event;
139 time_t timeStamp;
140 union
141 {
142 dmx_scrambling_status_t scrambling;
143 } u;
144};
145
146typedef struct dmx_caps { 121typedef struct dmx_caps {
147 __u32 caps; 122 __u32 caps;
148 int num_decoders; 123 int num_decoders;
@@ -171,7 +146,6 @@ struct dmx_stc {
171#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) 146#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
172#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) 147#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
173#define DMX_SET_BUFFER_SIZE _IO('o', 45) 148#define DMX_SET_BUFFER_SIZE _IO('o', 45)
174#define DMX_GET_EVENT _IOR('o', 46, struct dmx_event)
175#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) 149#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
176#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) 150#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
177#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) 151#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index c8b81f419fd8..21338bb3441d 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -112,6 +112,9 @@
112#define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */ 112#define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */
113#define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */ 113#define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */
114#define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */ 114#define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */
115#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */
116#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
117#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
115 118
116#define I2C_DRIVERID_I2CDEV 900 119#define I2C_DRIVERID_I2CDEV 900
117#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 120#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 91140091ced2..41bc7e9603cd 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -1,49 +1,21 @@
1/*
2 * Video for Linux version 1 - OBSOLETE
3 *
4 * Header file for v4l1 drivers and applications, for
5 * Linux kernels 2.2.x or 2.4.x.
6 *
7 * Provides header for legacy drivers and applications
8 *
9 * See http://linuxtv.org for more info
10 *
11 */
1#ifndef __LINUX_VIDEODEV_H 12#ifndef __LINUX_VIDEODEV_H
2#define __LINUX_VIDEODEV_H 13#define __LINUX_VIDEODEV_H
3 14
4#include <linux/types.h>
5
6#define HAVE_V4L1 1 15#define HAVE_V4L1 1
7 16
8#include <linux/videodev2.h> 17#include <linux/videodev2.h>
9 18
10#ifdef __KERNEL__
11
12#include <linux/mm.h>
13
14extern struct video_device* video_devdata(struct file*);
15
16#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
17static inline void
18video_device_create_file(struct video_device *vfd,
19 struct class_device_attribute *attr)
20{
21 class_device_create_file(&vfd->class_dev, attr);
22}
23static inline void
24video_device_remove_file(struct video_device *vfd,
25 struct class_device_attribute *attr)
26{
27 class_device_remove_file(&vfd->class_dev, attr);
28}
29
30#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
31/* helper functions to access driver private data. */
32static inline void *video_get_drvdata(struct video_device *dev)
33{
34 return dev->priv;
35}
36
37static inline void video_set_drvdata(struct video_device *dev, void *data)
38{
39 dev->priv = data;
40}
41#endif
42
43extern int video_exclusive_open(struct inode *inode, struct file *file);
44extern int video_exclusive_release(struct inode *inode, struct file *file);
45#endif /* __KERNEL__ */
46
47struct video_capability 19struct video_capability
48{ 20{
49 char name[32]; 21 char name[32];
@@ -363,6 +335,7 @@ struct video_code
363#define VID_HARDWARE_SAA7114H 37 335#define VID_HARDWARE_SAA7114H 37
364#define VID_HARDWARE_SN9C102 38 336#define VID_HARDWARE_SN9C102 38
365#define VID_HARDWARE_ARV 39 337#define VID_HARDWARE_ARV 39
338
366#endif /* __LINUX_VIDEODEV_H */ 339#endif /* __LINUX_VIDEODEV_H */
367 340
368/* 341/*
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index ad7fa9c86c10..4f428547ec09 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1,35 +1,33 @@
1#ifndef __LINUX_VIDEODEV2_H
2#define __LINUX_VIDEODEV2_H
3/* 1/*
4 * Video for Linux Two 2 * Video for Linux Two
5 * 3 *
6 * Header file for v4l or V4L2 drivers and applications, for 4 * Header file for v4l or V4L2 drivers and applications
7 * Linux kernels 2.2.x or 2.4.x. 5 * with public API.
6 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
7 * no #if __KERNEL tests are allowed here
8 * 8 *
9 * See http://bytesex.org/v4l/ for API specs and other 9 * See http://linuxtv.org for more info
10 * v4l2 documentation.
11 * 10 *
12 * Author: Bill Dirks <bdirks@pacbell.net> 11 * Author: Bill Dirks <bdirks@pacbell.net>
13 * Justin Schoeman 12 * Justin Schoeman
14 * et al. 13 * et al.
15 */ 14 */
15#ifndef __LINUX_VIDEODEV2_H
16#define __LINUX_VIDEODEV2_H
16#ifdef __KERNEL__ 17#ifdef __KERNEL__
17#include <linux/time.h> /* need struct timeval */ 18#include <linux/time.h> /* need struct timeval */
18#include <linux/poll.h>
19#include <linux/device.h>
20#include <linux/mutex.h>
21#endif
22#include <linux/compiler.h> /* need __user */ 19#include <linux/compiler.h> /* need __user */
20#else
21#define __user
22#endif
23#include <linux/types.h>
23 24
24
25#define OBSOLETE_OWNER 1 /* It will be removed for 2.6.17 */
26#define HAVE_V4L2 1 25#define HAVE_V4L2 1
27 26
28/* 27/*
29 * Common stuff for both V4L1 and V4L2 28 * Common stuff for both V4L1 and V4L2
30 * Moved from videodev.h 29 * Moved from videodev.h
31 */ 30 */
32
33#define VIDEO_MAX_FRAME 32 31#define VIDEO_MAX_FRAME 32
34 32
35#define VID_TYPE_CAPTURE 1 /* Can capture */ 33#define VID_TYPE_CAPTURE 1 /* Can capture */
@@ -47,71 +45,6 @@
47#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ 45#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
48#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ 46#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
49 47
50#ifdef __KERNEL__
51
52/* Minor device allocation */
53#define MINOR_VFL_TYPE_GRABBER_MIN 0
54#define MINOR_VFL_TYPE_GRABBER_MAX 63
55#define MINOR_VFL_TYPE_RADIO_MIN 64
56#define MINOR_VFL_TYPE_RADIO_MAX 127
57#define MINOR_VFL_TYPE_VTX_MIN 192
58#define MINOR_VFL_TYPE_VTX_MAX 223
59#define MINOR_VFL_TYPE_VBI_MIN 224
60#define MINOR_VFL_TYPE_VBI_MAX 255
61
62#define VFL_TYPE_GRABBER 0
63#define VFL_TYPE_VBI 1
64#define VFL_TYPE_RADIO 2
65#define VFL_TYPE_VTX 3
66
67struct video_device
68{
69 /* device info */
70 struct device *dev;
71 char name[32];
72 int type; /* v4l1 */
73 int type2; /* v4l2 */
74 int hardware;
75 int minor;
76
77 /* device ops + callbacks */
78 const struct file_operations *fops;
79 void (*release)(struct video_device *vfd);
80
81
82#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
83 /* obsolete -- fops->owner is used instead */
84 struct module *owner;
85 /* dev->driver_data will be used instead some day.
86 * Use the video_{get|set}_drvdata() helper functions,
87 * so the switch over will be transparent for you.
88 * Or use {pci|usb}_{get|set}_drvdata() directly. */
89 void *priv;
90#endif
91
92 /* for videodev.c intenal usage -- please don't touch */
93 int users; /* video_exclusive_{open|close} ... */
94 struct mutex lock; /* ... helper function uses these */
95 char devfs_name[64]; /* devfs */
96 struct class_device class_dev; /* sysfs */
97};
98
99#define VIDEO_MAJOR 81
100
101extern int video_register_device(struct video_device *, int type, int nr);
102extern void video_unregister_device(struct video_device *);
103extern int video_usercopy(struct inode *inode, struct file *file,
104 unsigned int cmd, unsigned long arg,
105 int (*func)(struct inode *inode, struct file *file,
106 unsigned int cmd, void *arg));
107
108/* helper functions to alloc / release struct video_device, the
109 later can be used for video_device->release() */
110struct video_device *video_device_alloc(void);
111void video_device_release(struct video_device *vfd);
112
113#endif
114
115/* 48/*
116 * M I S C E L L A N E O U S 49 * M I S C E L L A N E O U S
117 */ 50 */
@@ -172,6 +105,8 @@ enum v4l2_ctrl_type {
172 V4L2_CTRL_TYPE_BOOLEAN = 2, 105 V4L2_CTRL_TYPE_BOOLEAN = 2,
173 V4L2_CTRL_TYPE_MENU = 3, 106 V4L2_CTRL_TYPE_MENU = 3,
174 V4L2_CTRL_TYPE_BUTTON = 4, 107 V4L2_CTRL_TYPE_BUTTON = 4,
108 V4L2_CTRL_TYPE_INTEGER64 = 5,
109 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
175}; 110};
176 111
177enum v4l2_tuner_type { 112enum v4l2_tuner_type {
@@ -270,7 +205,6 @@ struct v4l2_capability
270/* 205/*
271 * V I D E O I M A G E F O R M A T 206 * V I D E O I M A G E F O R M A T
272 */ 207 */
273
274struct v4l2_pix_format 208struct v4l2_pix_format
275{ 209{
276 __u32 width; 210 __u32 width;
@@ -283,7 +217,7 @@ struct v4l2_pix_format
283 __u32 priv; /* private data, depends on pixelformat */ 217 __u32 priv; /* private data, depends on pixelformat */
284}; 218};
285 219
286/* Pixel format FOURCC depth Description */ 220/* Pixel format FOURCC depth Description */
287#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ 221#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
288#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ 222#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
289#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ 223#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
@@ -319,7 +253,7 @@ struct v4l2_pix_format
319#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ 253#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
320#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ 254#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
321#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ 255#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */
322#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG */ 256#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */
323 257
324/* Vendor-specific formats */ 258/* Vendor-specific formats */
325#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ 259#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
@@ -343,7 +277,6 @@ struct v4l2_fmtdesc
343 277
344#define V4L2_FMT_FLAG_COMPRESSED 0x0001 278#define V4L2_FMT_FLAG_COMPRESSED 0x0001
345 279
346
347/* 280/*
348 * T I M E C O D E 281 * T I M E C O D E
349 */ 282 */
@@ -373,16 +306,15 @@ struct v4l2_timecode
373#define V4L2_TC_USERBITS_8BITCHARS 0x0008 306#define V4L2_TC_USERBITS_8BITCHARS 0x0008
374/* The above is based on SMPTE timecodes */ 307/* The above is based on SMPTE timecodes */
375 308
376 309#ifdef __KERNEL__
377/* 310/*
378 * M P E G C O M P R E S S I O N P A R A M E T E R S 311 * M P E G C O M P R E S S I O N P A R A M E T E R S
379 * 312 *
380 * ### WARNING: this is still work-in-progress right now, most likely 313 * ### WARNING: This experimental MPEG compression API is obsolete.
381 * ### there will be some incompatible changes. 314 * ### It is replaced by the MPEG controls API.
315 * ### This old API will disappear in the near future!
382 * 316 *
383 */ 317 */
384
385
386enum v4l2_bitrate_mode { 318enum v4l2_bitrate_mode {
387 V4L2_BITRATE_NONE = 0, /* not specified */ 319 V4L2_BITRATE_NONE = 0, /* not specified */
388 V4L2_BITRATE_CBR, /* constant bitrate */ 320 V4L2_BITRATE_CBR, /* constant bitrate */
@@ -460,6 +392,7 @@ struct v4l2_mpeg_compression {
460 /* I don't expect the above being perfect yet ;) */ 392 /* I don't expect the above being perfect yet ;) */
461 __u32 reserved_5[8]; 393 __u32 reserved_5[8];
462}; 394};
395#endif
463 396
464struct v4l2_jpegcompression 397struct v4l2_jpegcompression
465{ 398{
@@ -491,7 +424,6 @@ struct v4l2_jpegcompression
491 * allways use APP0 */ 424 * allways use APP0 */
492}; 425};
493 426
494
495/* 427/*
496 * M E M O R Y - M A P P I N G B U F F E R S 428 * M E M O R Y - M A P P I N G B U F F E R S
497 */ 429 */
@@ -573,7 +505,6 @@ struct v4l2_window
573 void __user *bitmap; 505 void __user *bitmap;
574}; 506};
575 507
576
577/* 508/*
578 * C A P T U R E P A R A M E T E R S 509 * C A P T U R E P A R A M E T E R S
579 */ 510 */
@@ -586,6 +517,7 @@ struct v4l2_captureparm
586 __u32 readbuffers; /* # of buffers for read */ 517 __u32 readbuffers; /* # of buffers for read */
587 __u32 reserved[4]; 518 __u32 reserved[4];
588}; 519};
520
589/* Flags for 'capability' and 'capturemode' fields */ 521/* Flags for 'capability' and 'capturemode' fields */
590#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ 522#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
591#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ 523#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
@@ -603,7 +535,6 @@ struct v4l2_outputparm
603/* 535/*
604 * I N P U T I M A G E C R O P P I N G 536 * I N P U T I M A G E C R O P P I N G
605 */ 537 */
606
607struct v4l2_cropcap { 538struct v4l2_cropcap {
608 enum v4l2_buf_type type; 539 enum v4l2_buf_type type;
609 struct v4l2_rect bounds; 540 struct v4l2_rect bounds;
@@ -710,7 +641,6 @@ struct v4l2_standard
710 __u32 reserved[4]; 641 __u32 reserved[4];
711}; 642};
712 643
713
714/* 644/*
715 * V I D E O I N P U T S 645 * V I D E O I N P U T S
716 */ 646 */
@@ -725,6 +655,7 @@ struct v4l2_input
725 __u32 status; 655 __u32 status;
726 __u32 reserved[4]; 656 __u32 reserved[4];
727}; 657};
658
728/* Values for the 'type' field */ 659/* Values for the 'type' field */
729#define V4L2_INPUT_TYPE_TUNER 1 660#define V4L2_INPUT_TYPE_TUNER 1
730#define V4L2_INPUT_TYPE_CAMERA 2 661#define V4L2_INPUT_TYPE_CAMERA 2
@@ -775,6 +706,34 @@ struct v4l2_control
775 __s32 value; 706 __s32 value;
776}; 707};
777 708
709struct v4l2_ext_control
710{
711 __u32 id;
712 __u32 reserved2[2];
713 union {
714 __s32 value;
715 __s64 value64;
716 void *reserved;
717 };
718};
719
720struct v4l2_ext_controls
721{
722 __u32 ctrl_class;
723 __u32 count;
724 __u32 error_idx;
725 __u32 reserved[2];
726 struct v4l2_ext_control *controls;
727};
728
729/* Values for ctrl_class field */
730#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
731#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
732
733#define V4L2_CTRL_ID_MASK (0x0fffffff)
734#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
735#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
736
778/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 737/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
779struct v4l2_queryctrl 738struct v4l2_queryctrl
780{ 739{
@@ -801,12 +760,21 @@ struct v4l2_querymenu
801/* Control flags */ 760/* Control flags */
802#define V4L2_CTRL_FLAG_DISABLED 0x0001 761#define V4L2_CTRL_FLAG_DISABLED 0x0001
803#define V4L2_CTRL_FLAG_GRABBED 0x0002 762#define V4L2_CTRL_FLAG_GRABBED 0x0002
763#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
764#define V4L2_CTRL_FLAG_UPDATE 0x0008
765#define V4L2_CTRL_FLAG_INACTIVE 0x0010
766#define V4L2_CTRL_FLAG_SLIDER 0x0020
767
768/* Query flag, to be ORed with the control ID */
769#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
804 770
805/* Control IDs defined by V4L2 */ 771/* User-class control IDs defined by V4L2 */
806#define V4L2_CID_BASE 0x00980900 772#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
773#define V4L2_CID_USER_BASE V4L2_CID_BASE
807/* IDs reserved for driver specific controls */ 774/* IDs reserved for driver specific controls */
808#define V4L2_CID_PRIVATE_BASE 0x08000000 775#define V4L2_CID_PRIVATE_BASE 0x08000000
809 776
777#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
810#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) 778#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
811#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) 779#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
812#define V4L2_CID_SATURATION (V4L2_CID_BASE+2) 780#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
@@ -833,6 +801,183 @@ struct v4l2_querymenu
833#define V4L2_CID_VCENTER (V4L2_CID_BASE+23) 801#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
834#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */ 802#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
835 803
804/* MPEG-class control IDs defined by V4L2 */
805#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
806#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
807
808/* MPEG streams */
809#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
810enum v4l2_mpeg_stream_type {
811 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
812 V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
813 V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
814 V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
815 V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
816 V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
817};
818#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
819#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
820#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
821#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
822#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
823#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
824
825/* MPEG audio */
826#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
827enum v4l2_mpeg_audio_sampling_freq {
828 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
829 V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
830 V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
831};
832#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
833enum v4l2_mpeg_audio_encoding {
834 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
835 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
836 V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
837};
838#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
839enum v4l2_mpeg_audio_l1_bitrate {
840 V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
841 V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
842 V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
843 V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
844 V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
845 V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
846 V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
847 V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
848 V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
849 V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
850 V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
851 V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
852 V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
853 V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
854};
855#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
856enum v4l2_mpeg_audio_l2_bitrate {
857 V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
858 V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
859 V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
860 V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
861 V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
862 V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
863 V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
864 V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
865 V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
866 V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
867 V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
868 V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
869 V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
870 V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
871};
872#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
873enum v4l2_mpeg_audio_l3_bitrate {
874 V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
875 V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
876 V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
877 V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
878 V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
879 V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
880 V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
881 V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
882 V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
883 V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
884 V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
885 V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
886 V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
887 V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
888};
889#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
890enum v4l2_mpeg_audio_mode {
891 V4L2_MPEG_AUDIO_MODE_STEREO = 0,
892 V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
893 V4L2_MPEG_AUDIO_MODE_DUAL = 2,
894 V4L2_MPEG_AUDIO_MODE_MONO = 3,
895};
896#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
897enum v4l2_mpeg_audio_mode_extension {
898 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
899 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
900 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
901 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
902};
903#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
904enum v4l2_mpeg_audio_emphasis {
905 V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
906 V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
907 V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
908};
909#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
910enum v4l2_mpeg_audio_crc {
911 V4L2_MPEG_AUDIO_CRC_NONE = 0,
912 V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
913};
914
915/* MPEG video */
916#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
917enum v4l2_mpeg_video_encoding {
918 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
919 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
920};
921#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
922enum v4l2_mpeg_video_aspect {
923 V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
924 V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
925 V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
926 V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
927};
928#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
929#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
930#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
931#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
932#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
933enum v4l2_mpeg_video_bitrate_mode {
934 V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
935 V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
936};
937#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
938#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
939#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
940
941/* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */
942#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
943#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
944enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
945 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
946 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
947};
948#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
949#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
950enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
951 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
952 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
953 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
954 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
955 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
956};
957#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
958enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
959 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
960 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
961};
962#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
963enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
964 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
965 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
966};
967#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
968#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
969enum v4l2_mpeg_cx2341x_video_median_filter_type {
970 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
971 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
972 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
973 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
974 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
975};
976#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
977#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
978#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
979#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
980
836/* 981/*
837 * T U N I N G 982 * T U N I N G
838 */ 983 */
@@ -904,6 +1049,7 @@ struct v4l2_audio
904 __u32 mode; 1049 __u32 mode;
905 __u32 reserved[2]; 1050 __u32 reserved[2];
906}; 1051};
1052
907/* Flags for the 'capability' field */ 1053/* Flags for the 'capability' field */
908#define V4L2_AUDCAP_STEREO 0x00001 1054#define V4L2_AUDCAP_STEREO 0x00001
909#define V4L2_AUDCAP_AVL 0x00002 1055#define V4L2_AUDCAP_AVL 0x00002
@@ -927,7 +1073,6 @@ struct v4l2_audioout
927 */ 1073 */
928 1074
929/* Raw VBI */ 1075/* Raw VBI */
930
931struct v4l2_vbi_format 1076struct v4l2_vbi_format
932{ 1077{
933 __u32 sampling_rate; /* in 1 Hz */ 1078 __u32 sampling_rate; /* in 1 Hz */
@@ -1034,8 +1179,6 @@ struct v4l2_streamparm
1034 } parm; 1179 } parm;
1035}; 1180};
1036 1181
1037
1038
1039/* 1182/*
1040 * I O C T L C O D E S F O R V I D E O D E V I C E S 1183 * I O C T L C O D E S F O R V I D E O D E V I C E S
1041 * 1184 *
@@ -1045,8 +1188,10 @@ struct v4l2_streamparm
1045#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) 1188#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
1046#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) 1189#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
1047#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) 1190#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
1191#ifdef __KERNEL__
1048#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) 1192#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression)
1049#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) 1193#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression)
1194#endif
1050#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) 1195#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
1051#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) 1196#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
1052#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) 1197#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
@@ -1096,7 +1241,11 @@ struct v4l2_streamparm
1096#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) 1241#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
1097#endif 1242#endif
1098#define VIDIOC_LOG_STATUS _IO ('V', 70) 1243#define VIDIOC_LOG_STATUS _IO ('V', 70)
1244#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
1245#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls)
1246#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls)
1099 1247
1248#ifdef __OLD_VIDIOC_
1100/* for compatibility, will go away some day */ 1249/* for compatibility, will go away some day */
1101#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) 1250#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
1102#define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) 1251#define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm)
@@ -1104,57 +1253,10 @@ struct v4l2_streamparm
1104#define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) 1253#define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio)
1105#define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) 1254#define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout)
1106#define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) 1255#define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap)
1107
1108#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1109
1110
1111#ifdef __KERNEL__
1112/*
1113 *
1114 * V 4 L 2 D R I V E R H E L P E R A P I
1115 *
1116 * Some commonly needed functions for drivers (v4l2-common.o module)
1117 */
1118#include <linux/fs.h>
1119
1120/* Video standard functions */
1121extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
1122extern int v4l2_video_std_construct(struct v4l2_standard *vs,
1123 int id, char *name);
1124
1125/* prority handling */
1126struct v4l2_prio_state {
1127 atomic_t prios[4];
1128};
1129int v4l2_prio_init(struct v4l2_prio_state *global);
1130int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
1131 enum v4l2_priority new);
1132int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
1133int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
1134enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
1135int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
1136
1137/* names for fancy debug output */
1138extern char *v4l2_field_names[];
1139extern char *v4l2_type_names[];
1140
1141/* Compatibility layer interface -- v4l1-compat module */
1142typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
1143 unsigned int cmd, void *arg);
1144
1145#ifdef CONFIG_VIDEO_V4L1_COMPAT
1146int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
1147 int cmd, void *arg, v4l2_kioctl driver_ioctl);
1148#else
1149#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL
1150#endif 1256#endif
1151 1257
1152/* 32 Bits compatibility layer for 64 bits processors */ 1258#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1153extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
1154 unsigned long arg);
1155
1156 1259
1157#endif /* __KERNEL__ */
1158#endif /* __LINUX_VIDEODEV2_H */ 1260#endif /* __LINUX_VIDEODEV2_H */
1159 1261
1160/* 1262/*