aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/videodev2.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/videodev2.h')
-rw-r--r--include/linux/videodev2.h372
1 files changed, 304 insertions, 68 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index c9c9a4680cc5..370d11106c11 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -292,10 +292,10 @@ struct v4l2_pix_format {
292 __u32 width; 292 __u32 width;
293 __u32 height; 293 __u32 height;
294 __u32 pixelformat; 294 __u32 pixelformat;
295 enum v4l2_field field; 295 __u32 field; /* enum v4l2_field */
296 __u32 bytesperline; /* for padding, zero if unused */ 296 __u32 bytesperline; /* for padding, zero if unused */
297 __u32 sizeimage; 297 __u32 sizeimage;
298 enum v4l2_colorspace colorspace; 298 __u32 colorspace; /* enum v4l2_colorspace */
299 __u32 priv; /* private data, depends on pixelformat */ 299 __u32 priv; /* private data, depends on pixelformat */
300}; 300};
301 301
@@ -378,7 +378,10 @@ struct v4l2_pix_format {
378#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ 378#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
379#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ 379#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
380 /* 10bit raw bayer DPCM compressed to 8 bits */ 380 /* 10bit raw bayer DPCM compressed to 8 bits */
381#define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
382#define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
381#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') 383#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
384#define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
382 /* 385 /*
383 * 10bit raw bayer, expanded to 16 bits 386 * 10bit raw bayer, expanded to 16 bits
384 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... 387 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
@@ -432,7 +435,7 @@ struct v4l2_pix_format {
432 */ 435 */
433struct v4l2_fmtdesc { 436struct v4l2_fmtdesc {
434 __u32 index; /* Format number */ 437 __u32 index; /* Format number */
435 enum v4l2_buf_type type; /* buffer type */ 438 __u32 type; /* enum v4l2_buf_type */
436 __u32 flags; 439 __u32 flags;
437 __u8 description[32]; /* Description string */ 440 __u8 description[32]; /* Description string */
438 __u32 pixelformat; /* Format fourcc */ 441 __u32 pixelformat; /* Format fourcc */
@@ -573,8 +576,8 @@ struct v4l2_jpegcompression {
573 */ 576 */
574struct v4l2_requestbuffers { 577struct v4l2_requestbuffers {
575 __u32 count; 578 __u32 count;
576 enum v4l2_buf_type type; 579 __u32 type; /* enum v4l2_buf_type */
577 enum v4l2_memory memory; 580 __u32 memory; /* enum v4l2_memory */
578 __u32 reserved[2]; 581 __u32 reserved[2];
579}; 582};
580 583
@@ -610,15 +613,17 @@ struct v4l2_plane {
610/** 613/**
611 * struct v4l2_buffer - video buffer info 614 * struct v4l2_buffer - video buffer info
612 * @index: id number of the buffer 615 * @index: id number of the buffer
613 * @type: buffer type (type == *_MPLANE for multiplanar buffers) 616 * @type: enum v4l2_buf_type; buffer type (type == *_MPLANE for
617 * multiplanar buffers);
614 * @bytesused: number of bytes occupied by data in the buffer (payload); 618 * @bytesused: number of bytes occupied by data in the buffer (payload);
615 * unused (set to 0) for multiplanar buffers 619 * unused (set to 0) for multiplanar buffers
616 * @flags: buffer informational flags 620 * @flags: buffer informational flags
617 * @field: field order of the image in the buffer 621 * @field: enum v4l2_field; field order of the image in the buffer
618 * @timestamp: frame timestamp 622 * @timestamp: frame timestamp
619 * @timecode: frame timecode 623 * @timecode: frame timecode
620 * @sequence: sequence count of this frame 624 * @sequence: sequence count of this frame
621 * @memory: the method, in which the actual video data is passed 625 * @memory: enum v4l2_memory; the method, in which the actual video data is
626 * passed
622 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP; 627 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
623 * offset from the start of the device memory for this plane, 628 * offset from the start of the device memory for this plane,
624 * (or a "cookie" that should be passed to mmap() as offset) 629 * (or a "cookie" that should be passed to mmap() as offset)
@@ -636,16 +641,16 @@ struct v4l2_plane {
636 */ 641 */
637struct v4l2_buffer { 642struct v4l2_buffer {
638 __u32 index; 643 __u32 index;
639 enum v4l2_buf_type type; 644 __u32 type;
640 __u32 bytesused; 645 __u32 bytesused;
641 __u32 flags; 646 __u32 flags;
642 enum v4l2_field field; 647 __u32 field;
643 struct timeval timestamp; 648 struct timeval timestamp;
644 struct v4l2_timecode timecode; 649 struct v4l2_timecode timecode;
645 __u32 sequence; 650 __u32 sequence;
646 651
647 /* memory location */ 652 /* memory location */
648 enum v4l2_memory memory; 653 __u32 memory;
649 union { 654 union {
650 __u32 offset; 655 __u32 offset;
651 unsigned long userptr; 656 unsigned long userptr;
@@ -708,7 +713,7 @@ struct v4l2_clip {
708 713
709struct v4l2_window { 714struct v4l2_window {
710 struct v4l2_rect w; 715 struct v4l2_rect w;
711 enum v4l2_field field; 716 __u32 field; /* enum v4l2_field */
712 __u32 chromakey; 717 __u32 chromakey;
713 struct v4l2_clip __user *clips; 718 struct v4l2_clip __user *clips;
714 __u32 clipcount; 719 __u32 clipcount;
@@ -745,14 +750,14 @@ struct v4l2_outputparm {
745 * I N P U T I M A G E C R O P P I N G 750 * I N P U T I M A G E C R O P P I N G
746 */ 751 */
747struct v4l2_cropcap { 752struct v4l2_cropcap {
748 enum v4l2_buf_type type; 753 __u32 type; /* enum v4l2_buf_type */
749 struct v4l2_rect bounds; 754 struct v4l2_rect bounds;
750 struct v4l2_rect defrect; 755 struct v4l2_rect defrect;
751 struct v4l2_fract pixelaspect; 756 struct v4l2_fract pixelaspect;
752}; 757};
753 758
754struct v4l2_crop { 759struct v4l2_crop {
755 enum v4l2_buf_type type; 760 __u32 type; /* enum v4l2_buf_type */
756 struct v4l2_rect c; 761 struct v4l2_rect c;
757}; 762};
758 763
@@ -939,6 +944,9 @@ struct v4l2_standard {
939 __u32 reserved[4]; 944 __u32 reserved[4];
940}; 945};
941 946
947/* The DV Preset API is deprecated in favor of the DV Timings API.
948 New drivers shouldn't use this anymore! */
949
942/* 950/*
943 * V I D E O T I M I N G S D V P R E S E T 951 * V I D E O T I M I N G S D V P R E S E T
944 */ 952 */
@@ -986,29 +994,56 @@ struct v4l2_dv_enum_preset {
986 * D V B T T I M I N G S 994 * D V B T T I M I N G S
987 */ 995 */
988 996
989/* BT.656/BT.1120 timing data */ 997/** struct v4l2_bt_timings - BT.656/BT.1120 timing data
998 * @width: total width of the active video in pixels
999 * @height: total height of the active video in lines
1000 * @interlaced: Interlaced or progressive
1001 * @polarities: Positive or negative polarities
1002 * @pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
1003 * @hfrontporch:Horizontal front porch in pixels
1004 * @hsync: Horizontal Sync length in pixels
1005 * @hbackporch: Horizontal back porch in pixels
1006 * @vfrontporch:Vertical front porch in lines
1007 * @vsync: Vertical Sync length in lines
1008 * @vbackporch: Vertical back porch in lines
1009 * @il_vfrontporch:Vertical front porch for the even field
1010 * (aka field 2) of interlaced field formats
1011 * @il_vsync: Vertical Sync length for the even field
1012 * (aka field 2) of interlaced field formats
1013 * @il_vbackporch:Vertical back porch for the even field
1014 * (aka field 2) of interlaced field formats
1015 * @standards: Standards the timing belongs to
1016 * @flags: Flags
1017 * @reserved: Reserved fields, must be zeroed.
1018 *
1019 * A note regarding vertical interlaced timings: height refers to the total
1020 * height of the active video frame (= two fields). The blanking timings refer
1021 * to the blanking of each field. So the height of the total frame is
1022 * calculated as follows:
1023 *
1024 * tot_height = height + vfrontporch + vsync + vbackporch +
1025 * il_vfrontporch + il_vsync + il_vbackporch
1026 *
1027 * The active height of each field is height / 2.
1028 */
990struct v4l2_bt_timings { 1029struct v4l2_bt_timings {
991 __u32 width; /* width in pixels */ 1030 __u32 width;
992 __u32 height; /* height in lines */ 1031 __u32 height;
993 __u32 interlaced; /* Interlaced or progressive */ 1032 __u32 interlaced;
994 __u32 polarities; /* Positive or negative polarity */ 1033 __u32 polarities;
995 __u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz->74250000 */ 1034 __u64 pixelclock;
996 __u32 hfrontporch; /* Horizpontal front porch in pixels */ 1035 __u32 hfrontporch;
997 __u32 hsync; /* Horizontal Sync length in pixels */ 1036 __u32 hsync;
998 __u32 hbackporch; /* Horizontal back porch in pixels */ 1037 __u32 hbackporch;
999 __u32 vfrontporch; /* Vertical front porch in pixels */ 1038 __u32 vfrontporch;
1000 __u32 vsync; /* Vertical Sync length in lines */ 1039 __u32 vsync;
1001 __u32 vbackporch; /* Vertical back porch in lines */ 1040 __u32 vbackporch;
1002 __u32 il_vfrontporch; /* Vertical front porch for bottom field of 1041 __u32 il_vfrontporch;
1003 * interlaced field formats 1042 __u32 il_vsync;
1004 */ 1043 __u32 il_vbackporch;
1005 __u32 il_vsync; /* Vertical sync length for bottom field of 1044 __u32 standards;
1006 * interlaced field formats 1045 __u32 flags;
1007 */ 1046 __u32 reserved[14];
1008 __u32 il_vbackporch; /* Vertical back porch for bottom field of
1009 * interlaced field formats
1010 */
1011 __u32 reserved[16];
1012} __attribute__ ((packed)); 1047} __attribute__ ((packed));
1013 1048
1014/* Interlaced or progressive format */ 1049/* Interlaced or progressive format */
@@ -1019,8 +1054,42 @@ struct v4l2_bt_timings {
1019#define V4L2_DV_VSYNC_POS_POL 0x00000001 1054#define V4L2_DV_VSYNC_POS_POL 0x00000001
1020#define V4L2_DV_HSYNC_POS_POL 0x00000002 1055#define V4L2_DV_HSYNC_POS_POL 0x00000002
1021 1056
1022 1057/* Timings standards */
1023/* DV timings */ 1058#define V4L2_DV_BT_STD_CEA861 (1 << 0) /* CEA-861 Digital TV Profile */
1059#define V4L2_DV_BT_STD_DMT (1 << 1) /* VESA Discrete Monitor Timings */
1060#define V4L2_DV_BT_STD_CVT (1 << 2) /* VESA Coordinated Video Timings */
1061#define V4L2_DV_BT_STD_GTF (1 << 3) /* VESA Generalized Timings Formula */
1062
1063/* Flags */
1064
1065/* CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary
1066 GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
1067 intervals are reduced, allowing a higher resolution over the same
1068 bandwidth. This is a read-only flag. */
1069#define V4L2_DV_FL_REDUCED_BLANKING (1 << 0)
1070/* CEA-861 specific: set for CEA-861 formats with a framerate of a multiple
1071 of six. These formats can be optionally played at 1 / 1.001 speed.
1072 This is a read-only flag. */
1073#define V4L2_DV_FL_CAN_REDUCE_FPS (1 << 1)
1074/* CEA-861 specific: only valid for video transmitters, the flag is cleared
1075 by receivers.
1076 If the framerate of the format is a multiple of six, then the pixelclock
1077 used to set up the transmitter is divided by 1.001 to make it compatible
1078 with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
1079 29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate
1080 such frequencies, then the flag will also be cleared. */
1081#define V4L2_DV_FL_REDUCED_FPS (1 << 2)
1082/* Specific to interlaced formats: if set, then field 1 is really one half-line
1083 longer and field 2 is really one half-line shorter, so each field has
1084 exactly the same number of half-lines. Whether half-lines can be detected
1085 or used depends on the hardware. */
1086#define V4L2_DV_FL_HALF_LINE (1 << 0)
1087
1088
1089/** struct v4l2_dv_timings - DV timings
1090 * @type: the type of the timings
1091 * @bt: BT656/1120 timings
1092 */
1024struct v4l2_dv_timings { 1093struct v4l2_dv_timings {
1025 __u32 type; 1094 __u32 type;
1026 union { 1095 union {
@@ -1032,6 +1101,64 @@ struct v4l2_dv_timings {
1032/* Values for the type field */ 1101/* Values for the type field */
1033#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */ 1102#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */
1034 1103
1104
1105/** struct v4l2_enum_dv_timings - DV timings enumeration
1106 * @index: enumeration index
1107 * @reserved: must be zeroed
1108 * @timings: the timings for the given index
1109 */
1110struct v4l2_enum_dv_timings {
1111 __u32 index;
1112 __u32 reserved[3];
1113 struct v4l2_dv_timings timings;
1114};
1115
1116/** struct v4l2_bt_timings_cap - BT.656/BT.1120 timing capabilities
1117 * @min_width: width in pixels
1118 * @max_width: width in pixels
1119 * @min_height: height in lines
1120 * @max_height: height in lines
1121 * @min_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
1122 * @max_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
1123 * @standards: Supported standards
1124 * @capabilities: Supported capabilities
1125 * @reserved: Must be zeroed
1126 */
1127struct v4l2_bt_timings_cap {
1128 __u32 min_width;
1129 __u32 max_width;
1130 __u32 min_height;
1131 __u32 max_height;
1132 __u64 min_pixelclock;
1133 __u64 max_pixelclock;
1134 __u32 standards;
1135 __u32 capabilities;
1136 __u32 reserved[16];
1137} __attribute__ ((packed));
1138
1139/* Supports interlaced formats */
1140#define V4L2_DV_BT_CAP_INTERLACED (1 << 0)
1141/* Supports progressive formats */
1142#define V4L2_DV_BT_CAP_PROGRESSIVE (1 << 1)
1143/* Supports CVT/GTF reduced blanking */
1144#define V4L2_DV_BT_CAP_REDUCED_BLANKING (1 << 2)
1145/* Supports custom formats */
1146#define V4L2_DV_BT_CAP_CUSTOM (1 << 3)
1147
1148/** struct v4l2_dv_timings_cap - DV timings capabilities
1149 * @type: the type of the timings (same as in struct v4l2_dv_timings)
1150 * @bt: the BT656/1120 timings capabilities
1151 */
1152struct v4l2_dv_timings_cap {
1153 __u32 type;
1154 __u32 reserved[3];
1155 union {
1156 struct v4l2_bt_timings_cap bt;
1157 __u32 raw_data[32];
1158 };
1159};
1160
1161
1035/* 1162/*
1036 * V I D E O I N P U T S 1163 * V I D E O I N P U T S
1037 */ 1164 */
@@ -1040,7 +1167,7 @@ struct v4l2_input {
1040 __u8 name[32]; /* Label */ 1167 __u8 name[32]; /* Label */
1041 __u32 type; /* Type of input */ 1168 __u32 type; /* Type of input */
1042 __u32 audioset; /* Associated audios (bitfield) */ 1169 __u32 audioset; /* Associated audios (bitfield) */
1043 __u32 tuner; /* Associated tuner */ 1170 __u32 tuner; /* enum v4l2_tuner_type */
1044 v4l2_std_id std; 1171 v4l2_std_id std;
1045 __u32 status; 1172 __u32 status;
1046 __u32 capabilities; 1173 __u32 capabilities;
@@ -1137,6 +1264,8 @@ struct v4l2_ext_controls {
1137#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ 1264#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
1138#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ 1265#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
1139#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */ 1266#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */
1267#define V4L2_CTRL_CLASS_IMAGE_SOURCE 0x009e0000 /* Image source controls */
1268#define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */
1140 1269
1141#define V4L2_CTRL_ID_MASK (0x0fffffff) 1270#define V4L2_CTRL_ID_MASK (0x0fffffff)
1142#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) 1271#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
@@ -1151,12 +1280,13 @@ enum v4l2_ctrl_type {
1151 V4L2_CTRL_TYPE_CTRL_CLASS = 6, 1280 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
1152 V4L2_CTRL_TYPE_STRING = 7, 1281 V4L2_CTRL_TYPE_STRING = 7,
1153 V4L2_CTRL_TYPE_BITMASK = 8, 1282 V4L2_CTRL_TYPE_BITMASK = 8,
1283 V4L2_CTRL_TYPE_INTEGER_MENU = 9,
1154}; 1284};
1155 1285
1156/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 1286/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
1157struct v4l2_queryctrl { 1287struct v4l2_queryctrl {
1158 __u32 id; 1288 __u32 id;
1159 enum v4l2_ctrl_type type; 1289 __u32 type; /* enum v4l2_ctrl_type */
1160 __u8 name[32]; /* Whatever */ 1290 __u8 name[32]; /* Whatever */
1161 __s32 minimum; /* Note signedness */ 1291 __s32 minimum; /* Note signedness */
1162 __s32 maximum; 1292 __s32 maximum;
@@ -1170,9 +1300,12 @@ struct v4l2_queryctrl {
1170struct v4l2_querymenu { 1300struct v4l2_querymenu {
1171 __u32 id; 1301 __u32 id;
1172 __u32 index; 1302 __u32 index;
1173 __u8 name[32]; /* Whatever */ 1303 union {
1304 __u8 name[32]; /* Whatever */
1305 __s64 value;
1306 };
1174 __u32 reserved; 1307 __u32 reserved;
1175}; 1308} __attribute__ ((packed));
1176 1309
1177/* Control flags */ 1310/* Control flags */
1178#define V4L2_CTRL_FLAG_DISABLED 0x0001 1311#define V4L2_CTRL_FLAG_DISABLED 0x0001
@@ -1237,16 +1370,22 @@ enum v4l2_power_line_frequency {
1237#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30) 1370#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
1238#define V4L2_CID_COLORFX (V4L2_CID_BASE+31) 1371#define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
1239enum v4l2_colorfx { 1372enum v4l2_colorfx {
1240 V4L2_COLORFX_NONE = 0, 1373 V4L2_COLORFX_NONE = 0,
1241 V4L2_COLORFX_BW = 1, 1374 V4L2_COLORFX_BW = 1,
1242 V4L2_COLORFX_SEPIA = 2, 1375 V4L2_COLORFX_SEPIA = 2,
1243 V4L2_COLORFX_NEGATIVE = 3, 1376 V4L2_COLORFX_NEGATIVE = 3,
1244 V4L2_COLORFX_EMBOSS = 4, 1377 V4L2_COLORFX_EMBOSS = 4,
1245 V4L2_COLORFX_SKETCH = 5, 1378 V4L2_COLORFX_SKETCH = 5,
1246 V4L2_COLORFX_SKY_BLUE = 6, 1379 V4L2_COLORFX_SKY_BLUE = 6,
1247 V4L2_COLORFX_GRASS_GREEN = 7, 1380 V4L2_COLORFX_GRASS_GREEN = 7,
1248 V4L2_COLORFX_SKIN_WHITEN = 8, 1381 V4L2_COLORFX_SKIN_WHITEN = 8,
1249 V4L2_COLORFX_VIVID = 9, 1382 V4L2_COLORFX_VIVID = 9,
1383 V4L2_COLORFX_AQUA = 10,
1384 V4L2_COLORFX_ART_FREEZE = 11,
1385 V4L2_COLORFX_SILHOUETTE = 12,
1386 V4L2_COLORFX_SOLARIZATION = 13,
1387 V4L2_COLORFX_ANTIQUE = 14,
1388 V4L2_COLORFX_SET_CBCR = 15,
1250}; 1389};
1251#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) 1390#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
1252#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) 1391#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
@@ -1263,9 +1402,10 @@ enum v4l2_colorfx {
1263#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40) 1402#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
1264 1403
1265#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41) 1404#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
1405#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
1266 1406
1267/* last CID + 1 */ 1407/* last CID + 1 */
1268#define V4L2_CID_LASTP1 (V4L2_CID_BASE+42) 1408#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43)
1269 1409
1270/* MPEG-class control IDs defined by V4L2 */ 1410/* MPEG-class control IDs defined by V4L2 */
1271#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1411#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1689,6 +1829,78 @@ enum v4l2_exposure_auto_type {
1689#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17) 1829#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
1690#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18) 1830#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
1691 1831
1832#define V4L2_CID_AUTO_EXPOSURE_BIAS (V4L2_CID_CAMERA_CLASS_BASE+19)
1833
1834#define V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (V4L2_CID_CAMERA_CLASS_BASE+20)
1835enum v4l2_auto_n_preset_white_balance {
1836 V4L2_WHITE_BALANCE_MANUAL = 0,
1837 V4L2_WHITE_BALANCE_AUTO = 1,
1838 V4L2_WHITE_BALANCE_INCANDESCENT = 2,
1839 V4L2_WHITE_BALANCE_FLUORESCENT = 3,
1840 V4L2_WHITE_BALANCE_FLUORESCENT_H = 4,
1841 V4L2_WHITE_BALANCE_HORIZON = 5,
1842 V4L2_WHITE_BALANCE_DAYLIGHT = 6,
1843 V4L2_WHITE_BALANCE_FLASH = 7,
1844 V4L2_WHITE_BALANCE_CLOUDY = 8,
1845 V4L2_WHITE_BALANCE_SHADE = 9,
1846};
1847
1848#define V4L2_CID_WIDE_DYNAMIC_RANGE (V4L2_CID_CAMERA_CLASS_BASE+21)
1849#define V4L2_CID_IMAGE_STABILIZATION (V4L2_CID_CAMERA_CLASS_BASE+22)
1850
1851#define V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
1852#define V4L2_CID_ISO_SENSITIVITY_AUTO (V4L2_CID_CAMERA_CLASS_BASE+24)
1853enum v4l2_iso_sensitivity_auto_type {
1854 V4L2_ISO_SENSITIVITY_MANUAL = 0,
1855 V4L2_ISO_SENSITIVITY_AUTO = 1,
1856};
1857
1858#define V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25)
1859enum v4l2_exposure_metering {
1860 V4L2_EXPOSURE_METERING_AVERAGE = 0,
1861 V4L2_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
1862 V4L2_EXPOSURE_METERING_SPOT = 2,
1863};
1864
1865#define V4L2_CID_SCENE_MODE (V4L2_CID_CAMERA_CLASS_BASE+26)
1866enum v4l2_scene_mode {
1867 V4L2_SCENE_MODE_NONE = 0,
1868 V4L2_SCENE_MODE_BACKLIGHT = 1,
1869 V4L2_SCENE_MODE_BEACH_SNOW = 2,
1870 V4L2_SCENE_MODE_CANDLE_LIGHT = 3,
1871 V4L2_SCENE_MODE_DAWN_DUSK = 4,
1872 V4L2_SCENE_MODE_FALL_COLORS = 5,
1873 V4L2_SCENE_MODE_FIREWORKS = 6,
1874 V4L2_SCENE_MODE_LANDSCAPE = 7,
1875 V4L2_SCENE_MODE_NIGHT = 8,
1876 V4L2_SCENE_MODE_PARTY_INDOOR = 9,
1877 V4L2_SCENE_MODE_PORTRAIT = 10,
1878 V4L2_SCENE_MODE_SPORTS = 11,
1879 V4L2_SCENE_MODE_SUNSET = 12,
1880 V4L2_SCENE_MODE_TEXT = 13,
1881};
1882
1883#define V4L2_CID_3A_LOCK (V4L2_CID_CAMERA_CLASS_BASE+27)
1884#define V4L2_LOCK_EXPOSURE (1 << 0)
1885#define V4L2_LOCK_WHITE_BALANCE (1 << 1)
1886#define V4L2_LOCK_FOCUS (1 << 2)
1887
1888#define V4L2_CID_AUTO_FOCUS_START (V4L2_CID_CAMERA_CLASS_BASE+28)
1889#define V4L2_CID_AUTO_FOCUS_STOP (V4L2_CID_CAMERA_CLASS_BASE+29)
1890#define V4L2_CID_AUTO_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+30)
1891#define V4L2_AUTO_FOCUS_STATUS_IDLE (0 << 0)
1892#define V4L2_AUTO_FOCUS_STATUS_BUSY (1 << 0)
1893#define V4L2_AUTO_FOCUS_STATUS_REACHED (1 << 1)
1894#define V4L2_AUTO_FOCUS_STATUS_FAILED (1 << 2)
1895
1896#define V4L2_CID_AUTO_FOCUS_RANGE (V4L2_CID_CAMERA_CLASS_BASE+31)
1897enum v4l2_auto_focus_range {
1898 V4L2_AUTO_FOCUS_RANGE_AUTO = 0,
1899 V4L2_AUTO_FOCUS_RANGE_NORMAL = 1,
1900 V4L2_AUTO_FOCUS_RANGE_MACRO = 2,
1901 V4L2_AUTO_FOCUS_RANGE_INFINITY = 3,
1902};
1903
1692/* FM Modulator class control IDs */ 1904/* FM Modulator class control IDs */
1693#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) 1905#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
1694#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) 1906#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
@@ -1782,13 +1994,28 @@ enum v4l2_jpeg_chroma_subsampling {
1782#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17) 1994#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
1783#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18) 1995#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
1784 1996
1997/* Image source controls */
1998#define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
1999#define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1)
2000
2001#define V4L2_CID_VBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
2002#define V4L2_CID_HBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
2003#define V4L2_CID_ANALOGUE_GAIN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
2004
2005/* Image processing controls */
2006#define V4L2_CID_IMAGE_PROC_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_PROC | 0x900)
2007#define V4L2_CID_IMAGE_PROC_CLASS (V4L2_CTRL_CLASS_IMAGE_PROC | 1)
2008
2009#define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
2010#define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
2011
1785/* 2012/*
1786 * T U N I N G 2013 * T U N I N G
1787 */ 2014 */
1788struct v4l2_tuner { 2015struct v4l2_tuner {
1789 __u32 index; 2016 __u32 index;
1790 __u8 name[32]; 2017 __u8 name[32];
1791 enum v4l2_tuner_type type; 2018 __u32 type; /* enum v4l2_tuner_type */
1792 __u32 capability; 2019 __u32 capability;
1793 __u32 rangelow; 2020 __u32 rangelow;
1794 __u32 rangehigh; 2021 __u32 rangehigh;
@@ -1838,14 +2065,14 @@ struct v4l2_modulator {
1838 2065
1839struct v4l2_frequency { 2066struct v4l2_frequency {
1840 __u32 tuner; 2067 __u32 tuner;
1841 enum v4l2_tuner_type type; 2068 __u32 type; /* enum v4l2_tuner_type */
1842 __u32 frequency; 2069 __u32 frequency;
1843 __u32 reserved[8]; 2070 __u32 reserved[8];
1844}; 2071};
1845 2072
1846struct v4l2_hw_freq_seek { 2073struct v4l2_hw_freq_seek {
1847 __u32 tuner; 2074 __u32 tuner;
1848 enum v4l2_tuner_type type; 2075 __u32 type; /* enum v4l2_tuner_type */
1849 __u32 seek_upward; 2076 __u32 seek_upward;
1850 __u32 wrap_around; 2077 __u32 wrap_around;
1851 __u32 spacing; 2078 __u32 spacing;
@@ -2056,7 +2283,7 @@ struct v4l2_sliced_vbi_cap {
2056 (equals frame lines 313-336 for 625 line video 2283 (equals frame lines 313-336 for 625 line video
2057 standards, 263-286 for 525 line standards) */ 2284 standards, 263-286 for 525 line standards) */
2058 __u16 service_lines[2][24]; 2285 __u16 service_lines[2][24];
2059 enum v4l2_buf_type type; 2286 __u32 type; /* enum v4l2_buf_type */
2060 __u32 reserved[3]; /* must be 0 */ 2287 __u32 reserved[3]; /* must be 0 */
2061}; 2288};
2062 2289
@@ -2137,8 +2364,8 @@ struct v4l2_plane_pix_format {
2137 * @width: image width in pixels 2364 * @width: image width in pixels
2138 * @height: image height in pixels 2365 * @height: image height in pixels
2139 * @pixelformat: little endian four character code (fourcc) 2366 * @pixelformat: little endian four character code (fourcc)
2140 * @field: field order (for interlaced video) 2367 * @field: enum v4l2_field; field order (for interlaced video)
2141 * @colorspace: supplemental to pixelformat 2368 * @colorspace: enum v4l2_colorspace; supplemental to pixelformat
2142 * @plane_fmt: per-plane information 2369 * @plane_fmt: per-plane information
2143 * @num_planes: number of planes for this format 2370 * @num_planes: number of planes for this format
2144 */ 2371 */
@@ -2146,8 +2373,8 @@ struct v4l2_pix_format_mplane {
2146 __u32 width; 2373 __u32 width;
2147 __u32 height; 2374 __u32 height;
2148 __u32 pixelformat; 2375 __u32 pixelformat;
2149 enum v4l2_field field; 2376 __u32 field;
2150 enum v4l2_colorspace colorspace; 2377 __u32 colorspace;
2151 2378
2152 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; 2379 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
2153 __u8 num_planes; 2380 __u8 num_planes;
@@ -2156,7 +2383,7 @@ struct v4l2_pix_format_mplane {
2156 2383
2157/** 2384/**
2158 * struct v4l2_format - stream data format 2385 * struct v4l2_format - stream data format
2159 * @type: type of the data stream 2386 * @type: enum v4l2_buf_type; type of the data stream
2160 * @pix: definition of an image format 2387 * @pix: definition of an image format
2161 * @pix_mp: definition of a multiplanar image format 2388 * @pix_mp: definition of a multiplanar image format
2162 * @win: definition of an overlaid image 2389 * @win: definition of an overlaid image
@@ -2165,7 +2392,7 @@ struct v4l2_pix_format_mplane {
2165 * @raw_data: placeholder for future extensions and custom formats 2392 * @raw_data: placeholder for future extensions and custom formats
2166 */ 2393 */
2167struct v4l2_format { 2394struct v4l2_format {
2168 enum v4l2_buf_type type; 2395 __u32 type;
2169 union { 2396 union {
2170 struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ 2397 struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
2171 struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */ 2398 struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
@@ -2179,7 +2406,7 @@ struct v4l2_format {
2179/* Stream type-dependent parameters 2406/* Stream type-dependent parameters
2180 */ 2407 */
2181struct v4l2_streamparm { 2408struct v4l2_streamparm {
2182 enum v4l2_buf_type type; 2409 __u32 type; /* enum v4l2_buf_type */
2183 union { 2410 union {
2184 struct v4l2_captureparm capture; 2411 struct v4l2_captureparm capture;
2185 struct v4l2_outputparm output; 2412 struct v4l2_outputparm output;
@@ -2292,14 +2519,14 @@ struct v4l2_dbg_chip_ident {
2292 * @index: on return, index of the first created buffer 2519 * @index: on return, index of the first created buffer
2293 * @count: entry: number of requested buffers, 2520 * @count: entry: number of requested buffers,
2294 * return: number of created buffers 2521 * return: number of created buffers
2295 * @memory: buffer memory type 2522 * @memory: enum v4l2_memory; buffer memory type
2296 * @format: frame format, for which buffers are requested 2523 * @format: frame format, for which buffers are requested
2297 * @reserved: future extensions 2524 * @reserved: future extensions
2298 */ 2525 */
2299struct v4l2_create_buffers { 2526struct v4l2_create_buffers {
2300 __u32 index; 2527 __u32 index;
2301 __u32 count; 2528 __u32 count;
2302 enum v4l2_memory memory; 2529 __u32 memory;
2303 struct v4l2_format format; 2530 struct v4l2_format format;
2304 __u32 reserved[8]; 2531 __u32 reserved[8];
2305}; 2532};
@@ -2356,8 +2583,8 @@ struct v4l2_create_buffers {
2356#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) 2583#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
2357#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio) 2584#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
2358#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout) 2585#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
2359#define VIDIOC_G_PRIORITY _IOR('V', 67, enum v4l2_priority) 2586#define VIDIOC_G_PRIORITY _IOR('V', 67, __u32) /* enum v4l2_priority */
2360#define VIDIOC_S_PRIORITY _IOW('V', 68, enum v4l2_priority) 2587#define VIDIOC_S_PRIORITY _IOW('V', 68, __u32) /* enum v4l2_priority */
2361#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap) 2588#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
2362#define VIDIOC_LOG_STATUS _IO('V', 70) 2589#define VIDIOC_LOG_STATUS _IO('V', 70)
2363#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls) 2590#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
@@ -2384,6 +2611,9 @@ struct v4l2_create_buffers {
2384#endif 2611#endif
2385 2612
2386#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) 2613#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
2614
2615/* These four DV Preset ioctls are deprecated in favor of the DV Timings
2616 ioctls. */
2387#define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct v4l2_dv_enum_preset) 2617#define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct v4l2_dv_enum_preset)
2388#define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct v4l2_dv_preset) 2618#define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct v4l2_dv_preset)
2389#define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct v4l2_dv_preset) 2619#define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct v4l2_dv_preset)
@@ -2408,6 +2638,12 @@ struct v4l2_create_buffers {
2408#define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd) 2638#define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
2409#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd) 2639#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
2410 2640
2641/* Experimental, these three ioctls may change over the next couple of kernel
2642 versions. */
2643#define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 96, struct v4l2_enum_dv_timings)
2644#define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 97, struct v4l2_dv_timings)
2645#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 98, struct v4l2_dv_timings_cap)
2646
2411/* Reminder: when adding new ioctls please add support for them to 2647/* Reminder: when adding new ioctls please add support for them to
2412 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 2648 drivers/media/video/v4l2-compat-ioctl32.c as well! */
2413 2649