aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2012-05-10 01:02:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-14 07:09:02 -0400
commit6016af82eafcb6e086a8f2a2197b46029a843d68 (patch)
treea8133e0651a8e0d5d33fbce904471a9c42127b51
parent121b3ddbe4ad17df77cb7284239be0a63d9a66bd (diff)
[media] v4l2: use __u32 rather than enums in ioctl() structs
V4L2 uses the enum type in IOCTL arguments in IOCTLs that were defined until the use of enum was considered less than ideal. Recently Rémi Denis-Courmont brought up the issue by proposing a patch to convert the enums to unsigned: <URL:http://www.spinics.net/lists/linux-media/msg46167.html> This sparked a long discussion where another solution to the issue was proposed: two sets of IOCTL structures, one with __u32 and the other with enums, and conversion code between the two: <URL:http://www.spinics.net/lists/linux-media/msg47168.html> Both approaches implement a complete solution that resolves the problem. The first one is simple but requires assuming enums and __u32 are the same in size (so we won't break the ABI) while the second one is more complex and less clean but does not require making that assumption. The issue boils down to whether enums are fundamentally different from __u32 or not, and can the former be substituted by the latter. During the discussion it was concluded that the __u32 has the same size as enums on all archs Linux is supported: it has not been shown that replacing those enums in IOCTL arguments would break neither source or binary compatibility. If no such reason is found, just replacing the enums with __u32s is the way to go. This is what this patch does. This patch is slightly different from Remi's first RFC (link above): it uses __u32 instead of unsigned and also changes the arguments of VIDIOC_G_PRIORITY and VIDIOC_S_PRIORITY. Signed-off-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/DocBook/media/v4l/io.xml12
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-create-bufs.xml10
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-cropcap.xml4
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml4
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-crop.xml4
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-fmt.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-frequency.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-parm.xml5
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-tuner.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-queryctrl.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-reqbufs.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml5
-rw-r--r--drivers/media/video/v4l2-compat-ioctl32.c12
-rw-r--r--include/linux/videodev2.h64
15 files changed, 75 insertions, 66 deletions
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
index b815929b5bba..fd6aca2922b6 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -543,12 +543,13 @@ and can range from zero to the number of buffers allocated
543with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.</entry> 543with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.</entry>
544 </row> 544 </row>
545 <row> 545 <row>
546 <entry>&v4l2-buf-type;</entry> 546 <entry>__u32</entry>
547 <entry><structfield>type</structfield></entry> 547 <entry><structfield>type</structfield></entry>
548 <entry></entry> 548 <entry></entry>
549 <entry>Type of the buffer, same as &v4l2-format; 549 <entry>Type of the buffer, same as &v4l2-format;
550<structfield>type</structfield> or &v4l2-requestbuffers; 550<structfield>type</structfield> or &v4l2-requestbuffers;
551<structfield>type</structfield>, set by the application.</entry> 551<structfield>type</structfield>, set by the application. See <xref
552linkend="v4l2-buf-type" /></entry>
552 </row> 553 </row>
553 <row> 554 <row>
554 <entry>__u32</entry> 555 <entry>__u32</entry>
@@ -568,7 +569,7 @@ refers to an input stream, applications when an output stream.</entry>
568linkend="buffer-flags" />.</entry> 569linkend="buffer-flags" />.</entry>
569 </row> 570 </row>
570 <row> 571 <row>
571 <entry>&v4l2-field;</entry> 572 <entry>__u32</entry>
572 <entry><structfield>field</structfield></entry> 573 <entry><structfield>field</structfield></entry>
573 <entry></entry> 574 <entry></entry>
574 <entry>Indicates the field order of the image in the 575 <entry>Indicates the field order of the image in the
@@ -630,11 +631,12 @@ bandwidth. These devices identify by not enumerating any video
630standards, see <xref linkend="standard" />.</para></entry> 631standards, see <xref linkend="standard" />.</para></entry>
631 </row> 632 </row>
632 <row> 633 <row>
633 <entry>&v4l2-memory;</entry> 634 <entry>__u32</entry>
634 <entry><structfield>memory</structfield></entry> 635 <entry><structfield>memory</structfield></entry>
635 <entry></entry> 636 <entry></entry>
636 <entry>This field must be set by applications and/or drivers 637 <entry>This field must be set by applications and/or drivers
637in accordance with the selected I/O method.</entry> 638in accordance with the selected I/O method. See <xref linkend="v4l2-memory"
639 /></entry>
638 </row> 640 </row>
639 <row> 641 <row>
640 <entry>union</entry> 642 <entry>union</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
index 73ae8a6cd004..184cdfc13081 100644
--- a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
@@ -94,16 +94,18 @@ information.</para>
94 <entry>The number of buffers requested or granted.</entry> 94 <entry>The number of buffers requested or granted.</entry>
95 </row> 95 </row>
96 <row> 96 <row>
97 <entry>&v4l2-memory;</entry> 97 <entry>__u32</entry>
98 <entry><structfield>memory</structfield></entry> 98 <entry><structfield>memory</structfield></entry>
99 <entry>Applications set this field to 99 <entry>Applications set this field to
100<constant>V4L2_MEMORY_MMAP</constant> or 100<constant>V4L2_MEMORY_MMAP</constant> or
101<constant>V4L2_MEMORY_USERPTR</constant>.</entry> 101<constant>V4L2_MEMORY_USERPTR</constant>. See <xref linkend="v4l2-memory"
102/></entry>
102 </row> 103 </row>
103 <row> 104 <row>
104 <entry>&v4l2-format;</entry> 105 <entry>__u32</entry>
105 <entry><structfield>format</structfield></entry> 106 <entry><structfield>format</structfield></entry>
106 <entry>Filled in by the application, preserved by the driver.</entry> 107 <entry>Filled in by the application, preserved by the driver.
108 See <xref linkend="v4l2-format" />.</entry>
107 </row> 109 </row>
108 <row> 110 <row>
109 <entry>__u32</entry> 111 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
index b4f2f255211e..f1bac2c6e978 100644
--- a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
@@ -65,7 +65,7 @@ output.</para>
65 &cs-str; 65 &cs-str;
66 <tbody valign="top"> 66 <tbody valign="top">
67 <row> 67 <row>
68 <entry>&v4l2-buf-type;</entry> 68 <entry>__u32</entry>
69 <entry><structfield>type</structfield></entry> 69 <entry><structfield>type</structfield></entry>
70 <entry>Type of the data stream, set by the application. 70 <entry>Type of the data stream, set by the application.
71Only these types are valid here: 71Only these types are valid here:
@@ -73,7 +73,7 @@ Only these types are valid here:
73<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 73<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
74<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 74<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver
75defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 75defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
76and higher.</entry> 76and higher. See <xref linkend="v4l2-buf-type" />.</entry>
77 </row> 77 </row>
78 <row> 78 <row>
79 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry> 79 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
index 347d142e7431..81ebe48317fe 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
@@ -71,7 +71,7 @@ the application. This is in no way related to the <structfield>
71pixelformat</structfield> field.</entry> 71pixelformat</structfield> field.</entry>
72 </row> 72 </row>
73 <row> 73 <row>
74 <entry>&v4l2-buf-type;</entry> 74 <entry>__u32</entry>
75 <entry><structfield>type</structfield></entry> 75 <entry><structfield>type</structfield></entry>
76 <entry>Type of the data stream, set by the application. 76 <entry>Type of the data stream, set by the application.
77Only these types are valid here: 77Only these types are valid here:
@@ -81,7 +81,7 @@ Only these types are valid here:
81<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>, 81<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>,
82<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 82<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver
83defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 83defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
84and higher.</entry> 84and higher. See <xref linkend="v4l2-buf-type" />.</entry>
85 </row> 85 </row>
86 <row> 86 <row>
87 <entry>__u32</entry> 87 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
index 01a50640dce0..c4ff3b1887fb 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
@@ -100,14 +100,14 @@ changed and <constant>VIDIOC_S_CROP</constant> returns the
100 &cs-str; 100 &cs-str;
101 <tbody valign="top"> 101 <tbody valign="top">
102 <row> 102 <row>
103 <entry>&v4l2-buf-type;</entry> 103 <entry>__u32</entry>
104 <entry><structfield>type</structfield></entry> 104 <entry><structfield>type</structfield></entry>
105 <entry>Type of the data stream, set by the application. 105 <entry>Type of the data stream, set by the application.
106Only these types are valid here: <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, 106Only these types are valid here: <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
107<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 107<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
108<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 108<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver
109defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 109defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
110and higher.</entry> 110and higher. See <xref linkend="v4l2-buf-type" />.</entry>
111 </row> 111 </row>
112 <row> 112 <row>
113 <entry>&v4l2-rect;</entry> 113 <entry>&v4l2-rect;</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
index 17fbda15137b..52acff193a6f 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
@@ -116,7 +116,7 @@ this ioctl.</para>
116 <colspec colname="c4" /> 116 <colspec colname="c4" />
117 <tbody valign="top"> 117 <tbody valign="top">
118 <row> 118 <row>
119 <entry>&v4l2-buf-type;</entry> 119 <entry>__u32</entry>
120 <entry><structfield>type</structfield></entry> 120 <entry><structfield>type</structfield></entry>
121 <entry></entry> 121 <entry></entry>
122 <entry>Type of the data stream, see <xref 122 <entry>Type of the data stream, see <xref
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
index 66e9a5257861..69c178a4d205 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
@@ -95,14 +95,14 @@ the &v4l2-output; <structfield>modulator</structfield> field and the
95&v4l2-modulator; <structfield>index</structfield> field.</entry> 95&v4l2-modulator; <structfield>index</structfield> field.</entry>
96 </row> 96 </row>
97 <row> 97 <row>
98 <entry>&v4l2-tuner-type;</entry> 98 <entry>__u32</entry>
99 <entry><structfield>type</structfield></entry> 99 <entry><structfield>type</structfield></entry>
100 <entry>The tuner type. This is the same value as in the 100 <entry>The tuner type. This is the same value as in the
101&v4l2-tuner; <structfield>type</structfield> field. The type must be set 101&v4l2-tuner; <structfield>type</structfield> field. See The type must be set
102to <constant>V4L2_TUNER_RADIO</constant> for <filename>/dev/radioX</filename> 102to <constant>V4L2_TUNER_RADIO</constant> for <filename>/dev/radioX</filename>
103device nodes, and to <constant>V4L2_TUNER_ANALOG_TV</constant> 103device nodes, and to <constant>V4L2_TUNER_ANALOG_TV</constant>
104for all others. The field is not applicable to modulators, &ie; ignored 104for all others. The field is not applicable to modulators, &ie; ignored
105by drivers.</entry> 105by drivers. See <xref linkend="v4l2-tuner-type" /></entry>
106 </row> 106 </row>
107 <row> 107 <row>
108 <entry>__u32</entry> 108 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
index 19b1d85dd668..f83d2cdd1185 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
@@ -75,11 +75,12 @@ devices.</para>
75 &cs-ustr; 75 &cs-ustr;
76 <tbody valign="top"> 76 <tbody valign="top">
77 <row> 77 <row>
78 <entry>&v4l2-buf-type;</entry> 78 <entry>__u32</entry>
79 <entry><structfield>type</structfield></entry> 79 <entry><structfield>type</structfield></entry>
80 <entry></entry> 80 <entry></entry>
81 <entry>The buffer (stream) type, same as &v4l2-format; 81 <entry>The buffer (stream) type, same as &v4l2-format;
82<structfield>type</structfield>, set by the application.</entry> 82<structfield>type</structfield>, set by the application. See <xref
83 linkend="v4l2-buf-type" /></entry>
83 </row> 84 </row>
84 <row> 85 <row>
85 <entry>union</entry> 86 <entry>union</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml b/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
index 71741daaf725..bd015d1563ff 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
@@ -148,7 +148,7 @@ using the &VIDIOC-S-FMT; ioctl as described in <xref
148<structfield>service_lines</structfield>[1][0] to zero.</entry> 148<structfield>service_lines</structfield>[1][0] to zero.</entry>
149 </row> 149 </row>
150 <row> 150 <row>
151 <entry>&v4l2-buf-type;</entry> 151 <entry>__u32</entry>
152 <entry><structfield>type</structfield></entry> 152 <entry><structfield>type</structfield></entry>
153 <entry>Type of the data stream, see <xref 153 <entry>Type of the data stream, see <xref
154 linkend="v4l2-buf-type" />. Should be 154 linkend="v4l2-buf-type" />. Should be
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
index 91ec2fb658f8..62a1aa200a36 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
@@ -107,7 +107,7 @@ user.<!-- FIXME Video inputs already have a name, the purpose of this
107field is not quite clear.--></para></entry> 107field is not quite clear.--></para></entry>
108 </row> 108 </row>
109 <row> 109 <row>
110 <entry>&v4l2-tuner-type;</entry> 110 <entry>__u32</entry>
111 <entry><structfield>type</structfield></entry> 111 <entry><structfield>type</structfield></entry>
112 <entry spanname="hspan">Type of the tuner, see <xref 112 <entry spanname="hspan">Type of the tuner, see <xref
113 linkend="v4l2-tuner-type" />.</entry> 113 linkend="v4l2-tuner-type" />.</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
index 505f0206e5bd..e6645b996558 100644
--- a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
@@ -127,7 +127,7 @@ the first control with a higher ID. Drivers which do not support this
127flag yet always return an &EINVAL;.</entry> 127flag yet always return an &EINVAL;.</entry>
128 </row> 128 </row>
129 <row> 129 <row>
130 <entry>&v4l2-ctrl-type;</entry> 130 <entry>__u32</entry>
131 <entry><structfield>type</structfield></entry> 131 <entry><structfield>type</structfield></entry>
132 <entry>Type of control, see <xref 132 <entry>Type of control, see <xref
133 linkend="v4l2-ctrl-type" />.</entry> 133 linkend="v4l2-ctrl-type" />.</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
index 7be4b1d29b90..d7c95057bc51 100644
--- a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
@@ -92,18 +92,19 @@ streamoff.--></para>
92 <entry>The number of buffers requested or granted.</entry> 92 <entry>The number of buffers requested or granted.</entry>
93 </row> 93 </row>
94 <row> 94 <row>
95 <entry>&v4l2-buf-type;</entry> 95 <entry>__u32</entry>
96 <entry><structfield>type</structfield></entry> 96 <entry><structfield>type</structfield></entry>
97 <entry>Type of the stream or buffers, this is the same 97 <entry>Type of the stream or buffers, this is the same
98as the &v4l2-format; <structfield>type</structfield> field. See <xref 98as the &v4l2-format; <structfield>type</structfield> field. See <xref
99 linkend="v4l2-buf-type" /> for valid values.</entry> 99 linkend="v4l2-buf-type" /> for valid values.</entry>
100 </row> 100 </row>
101 <row> 101 <row>
102 <entry>&v4l2-memory;</entry> 102 <entry>__u32</entry>
103 <entry><structfield>memory</structfield></entry> 103 <entry><structfield>memory</structfield></entry>
104 <entry>Applications set this field to 104 <entry>Applications set this field to
105<constant>V4L2_MEMORY_MMAP</constant> or 105<constant>V4L2_MEMORY_MMAP</constant> or
106<constant>V4L2_MEMORY_USERPTR</constant>.</entry> 106<constant>V4L2_MEMORY_USERPTR</constant>. See <xref linkend="v4l2-memory"
107/>.</entry>
107 </row> 108 </row>
108 <row> 109 <row>
109 <entry>__u32</entry> 110 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
index 18b1a8266f7c..407dfceb71f0 100644
--- a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
@@ -73,10 +73,11 @@ same value as in the &v4l2-input; <structfield>tuner</structfield>
73field and the &v4l2-tuner; <structfield>index</structfield> field.</entry> 73field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
74 </row> 74 </row>
75 <row> 75 <row>
76 <entry>&v4l2-tuner-type;</entry> 76 <entry>__u32</entry>
77 <entry><structfield>type</structfield></entry> 77 <entry><structfield>type</structfield></entry>
78 <entry>The tuner type. This is the same value as in the 78 <entry>The tuner type. This is the same value as in the
79&v4l2-tuner; <structfield>type</structfield> field.</entry> 79&v4l2-tuner; <structfield>type</structfield> field. See <xref
80 linkend="v4l2-tuner-type" /></entry>
80 </row> 81 </row>
81 <row> 82 <row>
82 <entry>__u32</entry> 83 <entry>__u32</entry>
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c
index 2829d256e4b7..89ae433877e6 100644
--- a/drivers/media/video/v4l2-compat-ioctl32.c
+++ b/drivers/media/video/v4l2-compat-ioctl32.c
@@ -37,7 +37,7 @@ struct v4l2_clip32 {
37 37
38struct v4l2_window32 { 38struct v4l2_window32 {
39 struct v4l2_rect w; 39 struct v4l2_rect w;
40 enum v4l2_field field; 40 __u32 field; /* enum v4l2_field */
41 __u32 chromakey; 41 __u32 chromakey;
42 compat_caddr_t clips; /* actually struct v4l2_clip32 * */ 42 compat_caddr_t clips; /* actually struct v4l2_clip32 * */
43 __u32 clipcount; 43 __u32 clipcount;
@@ -147,7 +147,7 @@ static inline int put_v4l2_sliced_vbi_format(struct v4l2_sliced_vbi_format *kp,
147} 147}
148 148
149struct v4l2_format32 { 149struct v4l2_format32 {
150 enum v4l2_buf_type type; 150 __u32 type; /* enum v4l2_buf_type */
151 union { 151 union {
152 struct v4l2_pix_format pix; 152 struct v4l2_pix_format pix;
153 struct v4l2_pix_format_mplane pix_mp; 153 struct v4l2_pix_format_mplane pix_mp;
@@ -170,7 +170,7 @@ struct v4l2_format32 {
170struct v4l2_create_buffers32 { 170struct v4l2_create_buffers32 {
171 __u32 index; 171 __u32 index;
172 __u32 count; 172 __u32 count;
173 enum v4l2_memory memory; 173 __u32 memory; /* enum v4l2_memory */
174 struct v4l2_format32 format; 174 struct v4l2_format32 format;
175 __u32 reserved[8]; 175 __u32 reserved[8];
176}; 176};
@@ -311,16 +311,16 @@ struct v4l2_plane32 {
311 311
312struct v4l2_buffer32 { 312struct v4l2_buffer32 {
313 __u32 index; 313 __u32 index;
314 enum v4l2_buf_type type; 314 __u32 type; /* enum v4l2_buf_type */
315 __u32 bytesused; 315 __u32 bytesused;
316 __u32 flags; 316 __u32 flags;
317 enum v4l2_field field; 317 __u32 field; /* enum v4l2_field */
318 struct compat_timeval timestamp; 318 struct compat_timeval timestamp;
319 struct v4l2_timecode timecode; 319 struct v4l2_timecode timecode;
320 __u32 sequence; 320 __u32 sequence;
321 321
322 /* memory location */ 322 /* memory location */
323 enum v4l2_memory memory; 323 __u32 memory; /* enum v4l2_memory */
324 union { 324 union {
325 __u32 offset; 325 __u32 offset;
326 compat_long_t userptr; 326 compat_long_t userptr;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 5a09ac3f7683..ace8ac000b9b 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
@@ -432,7 +432,7 @@ struct v4l2_pix_format {
432 */ 432 */
433struct v4l2_fmtdesc { 433struct v4l2_fmtdesc {
434 __u32 index; /* Format number */ 434 __u32 index; /* Format number */
435 enum v4l2_buf_type type; /* buffer type */ 435 __u32 type; /* enum v4l2_buf_type */
436 __u32 flags; 436 __u32 flags;
437 __u8 description[32]; /* Description string */ 437 __u8 description[32]; /* Description string */
438 __u32 pixelformat; /* Format fourcc */ 438 __u32 pixelformat; /* Format fourcc */
@@ -573,8 +573,8 @@ struct v4l2_jpegcompression {
573 */ 573 */
574struct v4l2_requestbuffers { 574struct v4l2_requestbuffers {
575 __u32 count; 575 __u32 count;
576 enum v4l2_buf_type type; 576 __u32 type; /* enum v4l2_buf_type */
577 enum v4l2_memory memory; 577 __u32 memory; /* enum v4l2_memory */
578 __u32 reserved[2]; 578 __u32 reserved[2];
579}; 579};
580 580
@@ -610,15 +610,17 @@ struct v4l2_plane {
610/** 610/**
611 * struct v4l2_buffer - video buffer info 611 * struct v4l2_buffer - video buffer info
612 * @index: id number of the buffer 612 * @index: id number of the buffer
613 * @type: buffer type (type == *_MPLANE for multiplanar buffers) 613 * @type: enum v4l2_buf_type; buffer type (type == *_MPLANE for
614 * multiplanar buffers);
614 * @bytesused: number of bytes occupied by data in the buffer (payload); 615 * @bytesused: number of bytes occupied by data in the buffer (payload);
615 * unused (set to 0) for multiplanar buffers 616 * unused (set to 0) for multiplanar buffers
616 * @flags: buffer informational flags 617 * @flags: buffer informational flags
617 * @field: field order of the image in the buffer 618 * @field: enum v4l2_field; field order of the image in the buffer
618 * @timestamp: frame timestamp 619 * @timestamp: frame timestamp
619 * @timecode: frame timecode 620 * @timecode: frame timecode
620 * @sequence: sequence count of this frame 621 * @sequence: sequence count of this frame
621 * @memory: the method, in which the actual video data is passed 622 * @memory: enum v4l2_memory; the method, in which the actual video data is
623 * passed
622 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP; 624 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
623 * offset from the start of the device memory for this plane, 625 * offset from the start of the device memory for this plane,
624 * (or a "cookie" that should be passed to mmap() as offset) 626 * (or a "cookie" that should be passed to mmap() as offset)
@@ -636,16 +638,16 @@ struct v4l2_plane {
636 */ 638 */
637struct v4l2_buffer { 639struct v4l2_buffer {
638 __u32 index; 640 __u32 index;
639 enum v4l2_buf_type type; 641 __u32 type;
640 __u32 bytesused; 642 __u32 bytesused;
641 __u32 flags; 643 __u32 flags;
642 enum v4l2_field field; 644 __u32 field;
643 struct timeval timestamp; 645 struct timeval timestamp;
644 struct v4l2_timecode timecode; 646 struct v4l2_timecode timecode;
645 __u32 sequence; 647 __u32 sequence;
646 648
647 /* memory location */ 649 /* memory location */
648 enum v4l2_memory memory; 650 __u32 memory;
649 union { 651 union {
650 __u32 offset; 652 __u32 offset;
651 unsigned long userptr; 653 unsigned long userptr;
@@ -708,7 +710,7 @@ struct v4l2_clip {
708 710
709struct v4l2_window { 711struct v4l2_window {
710 struct v4l2_rect w; 712 struct v4l2_rect w;
711 enum v4l2_field field; 713 __u32 field; /* enum v4l2_field */
712 __u32 chromakey; 714 __u32 chromakey;
713 struct v4l2_clip __user *clips; 715 struct v4l2_clip __user *clips;
714 __u32 clipcount; 716 __u32 clipcount;
@@ -745,14 +747,14 @@ struct v4l2_outputparm {
745 * I N P U T I M A G E C R O P P I N G 747 * I N P U T I M A G E C R O P P I N G
746 */ 748 */
747struct v4l2_cropcap { 749struct v4l2_cropcap {
748 enum v4l2_buf_type type; 750 __u32 type; /* enum v4l2_buf_type */
749 struct v4l2_rect bounds; 751 struct v4l2_rect bounds;
750 struct v4l2_rect defrect; 752 struct v4l2_rect defrect;
751 struct v4l2_fract pixelaspect; 753 struct v4l2_fract pixelaspect;
752}; 754};
753 755
754struct v4l2_crop { 756struct v4l2_crop {
755 enum v4l2_buf_type type; 757 __u32 type; /* enum v4l2_buf_type */
756 struct v4l2_rect c; 758 struct v4l2_rect c;
757}; 759};
758 760
@@ -1040,7 +1042,7 @@ struct v4l2_input {
1040 __u8 name[32]; /* Label */ 1042 __u8 name[32]; /* Label */
1041 __u32 type; /* Type of input */ 1043 __u32 type; /* Type of input */
1042 __u32 audioset; /* Associated audios (bitfield) */ 1044 __u32 audioset; /* Associated audios (bitfield) */
1043 __u32 tuner; /* Associated tuner */ 1045 __u32 tuner; /* enum v4l2_tuner_type */
1044 v4l2_std_id std; 1046 v4l2_std_id std;
1045 __u32 status; 1047 __u32 status;
1046 __u32 capabilities; 1048 __u32 capabilities;
@@ -1157,7 +1159,7 @@ enum v4l2_ctrl_type {
1157/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 1159/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
1158struct v4l2_queryctrl { 1160struct v4l2_queryctrl {
1159 __u32 id; 1161 __u32 id;
1160 enum v4l2_ctrl_type type; 1162 __u32 type; /* enum v4l2_ctrl_type */
1161 __u8 name[32]; /* Whatever */ 1163 __u8 name[32]; /* Whatever */
1162 __s32 minimum; /* Note signedness */ 1164 __s32 minimum; /* Note signedness */
1163 __s32 maximum; 1165 __s32 maximum;
@@ -1792,7 +1794,7 @@ enum v4l2_jpeg_chroma_subsampling {
1792struct v4l2_tuner { 1794struct v4l2_tuner {
1793 __u32 index; 1795 __u32 index;
1794 __u8 name[32]; 1796 __u8 name[32];
1795 enum v4l2_tuner_type type; 1797 __u32 type; /* enum v4l2_tuner_type */
1796 __u32 capability; 1798 __u32 capability;
1797 __u32 rangelow; 1799 __u32 rangelow;
1798 __u32 rangehigh; 1800 __u32 rangehigh;
@@ -1842,14 +1844,14 @@ struct v4l2_modulator {
1842 1844
1843struct v4l2_frequency { 1845struct v4l2_frequency {
1844 __u32 tuner; 1846 __u32 tuner;
1845 enum v4l2_tuner_type type; 1847 __u32 type; /* enum v4l2_tuner_type */
1846 __u32 frequency; 1848 __u32 frequency;
1847 __u32 reserved[8]; 1849 __u32 reserved[8];
1848}; 1850};
1849 1851
1850struct v4l2_hw_freq_seek { 1852struct v4l2_hw_freq_seek {
1851 __u32 tuner; 1853 __u32 tuner;
1852 enum v4l2_tuner_type type; 1854 __u32 type; /* enum v4l2_tuner_type */
1853 __u32 seek_upward; 1855 __u32 seek_upward;
1854 __u32 wrap_around; 1856 __u32 wrap_around;
1855 __u32 spacing; 1857 __u32 spacing;
@@ -2060,7 +2062,7 @@ struct v4l2_sliced_vbi_cap {
2060 (equals frame lines 313-336 for 625 line video 2062 (equals frame lines 313-336 for 625 line video
2061 standards, 263-286 for 525 line standards) */ 2063 standards, 263-286 for 525 line standards) */
2062 __u16 service_lines[2][24]; 2064 __u16 service_lines[2][24];
2063 enum v4l2_buf_type type; 2065 __u32 type; /* enum v4l2_buf_type */
2064 __u32 reserved[3]; /* must be 0 */ 2066 __u32 reserved[3]; /* must be 0 */
2065}; 2067};
2066 2068
@@ -2141,8 +2143,8 @@ struct v4l2_plane_pix_format {
2141 * @width: image width in pixels 2143 * @width: image width in pixels
2142 * @height: image height in pixels 2144 * @height: image height in pixels
2143 * @pixelformat: little endian four character code (fourcc) 2145 * @pixelformat: little endian four character code (fourcc)
2144 * @field: field order (for interlaced video) 2146 * @field: enum v4l2_field; field order (for interlaced video)
2145 * @colorspace: supplemental to pixelformat 2147 * @colorspace: enum v4l2_colorspace; supplemental to pixelformat
2146 * @plane_fmt: per-plane information 2148 * @plane_fmt: per-plane information
2147 * @num_planes: number of planes for this format 2149 * @num_planes: number of planes for this format
2148 */ 2150 */
@@ -2150,8 +2152,8 @@ struct v4l2_pix_format_mplane {
2150 __u32 width; 2152 __u32 width;
2151 __u32 height; 2153 __u32 height;
2152 __u32 pixelformat; 2154 __u32 pixelformat;
2153 enum v4l2_field field; 2155 __u32 field;
2154 enum v4l2_colorspace colorspace; 2156 __u32 colorspace;
2155 2157
2156 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; 2158 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
2157 __u8 num_planes; 2159 __u8 num_planes;
@@ -2160,7 +2162,7 @@ struct v4l2_pix_format_mplane {
2160 2162
2161/** 2163/**
2162 * struct v4l2_format - stream data format 2164 * struct v4l2_format - stream data format
2163 * @type: type of the data stream 2165 * @type: enum v4l2_buf_type; type of the data stream
2164 * @pix: definition of an image format 2166 * @pix: definition of an image format
2165 * @pix_mp: definition of a multiplanar image format 2167 * @pix_mp: definition of a multiplanar image format
2166 * @win: definition of an overlaid image 2168 * @win: definition of an overlaid image
@@ -2169,7 +2171,7 @@ struct v4l2_pix_format_mplane {
2169 * @raw_data: placeholder for future extensions and custom formats 2171 * @raw_data: placeholder for future extensions and custom formats
2170 */ 2172 */
2171struct v4l2_format { 2173struct v4l2_format {
2172 enum v4l2_buf_type type; 2174 __u32 type;
2173 union { 2175 union {
2174 struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ 2176 struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
2175 struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */ 2177 struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
@@ -2183,7 +2185,7 @@ struct v4l2_format {
2183/* Stream type-dependent parameters 2185/* Stream type-dependent parameters
2184 */ 2186 */
2185struct v4l2_streamparm { 2187struct v4l2_streamparm {
2186 enum v4l2_buf_type type; 2188 __u32 type; /* enum v4l2_buf_type */
2187 union { 2189 union {
2188 struct v4l2_captureparm capture; 2190 struct v4l2_captureparm capture;
2189 struct v4l2_outputparm output; 2191 struct v4l2_outputparm output;
@@ -2296,14 +2298,14 @@ struct v4l2_dbg_chip_ident {
2296 * @index: on return, index of the first created buffer 2298 * @index: on return, index of the first created buffer
2297 * @count: entry: number of requested buffers, 2299 * @count: entry: number of requested buffers,
2298 * return: number of created buffers 2300 * return: number of created buffers
2299 * @memory: buffer memory type 2301 * @memory: enum v4l2_memory; buffer memory type
2300 * @format: frame format, for which buffers are requested 2302 * @format: frame format, for which buffers are requested
2301 * @reserved: future extensions 2303 * @reserved: future extensions
2302 */ 2304 */
2303struct v4l2_create_buffers { 2305struct v4l2_create_buffers {
2304 __u32 index; 2306 __u32 index;
2305 __u32 count; 2307 __u32 count;
2306 enum v4l2_memory memory; 2308 __u32 memory;
2307 struct v4l2_format format; 2309 struct v4l2_format format;
2308 __u32 reserved[8]; 2310 __u32 reserved[8];
2309}; 2311};
@@ -2360,8 +2362,8 @@ struct v4l2_create_buffers {
2360#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) 2362#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
2361#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio) 2363#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
2362#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout) 2364#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
2363#define VIDIOC_G_PRIORITY _IOR('V', 67, enum v4l2_priority) 2365#define VIDIOC_G_PRIORITY _IOR('V', 67, __u32) /* enum v4l2_priority */
2364#define VIDIOC_S_PRIORITY _IOW('V', 68, enum v4l2_priority) 2366#define VIDIOC_S_PRIORITY _IOW('V', 68, __u32) /* enum v4l2_priority */
2365#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap) 2367#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
2366#define VIDIOC_LOG_STATUS _IO('V', 70) 2368#define VIDIOC_LOG_STATUS _IO('V', 70)
2367#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls) 2369#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)