1<refentry id="vidioc-subdev-enum-mbus-code">
2  <refmeta>
3    <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE</refentrytitle>
4    &manvol;
5  </refmeta>
6
7  <refnamediv>
8    <refname>VIDIOC_SUBDEV_ENUM_MBUS_CODE</refname>
9    <refpurpose>Enumerate media bus formats</refpurpose>
10  </refnamediv>
11
12  <refsynopsisdiv>
13    <funcsynopsis>
14      <funcprototype>
15	<funcdef>int <function>ioctl</function></funcdef>
16	<paramdef>int <parameter>fd</parameter></paramdef>
17	<paramdef>int <parameter>request</parameter></paramdef>
18	<paramdef>struct v4l2_subdev_mbus_code_enum *
19	<parameter>argp</parameter></paramdef>
20      </funcprototype>
21    </funcsynopsis>
22  </refsynopsisdiv>
23
24  <refsect1>
25    <title>Arguments</title>
26
27    <variablelist>
28      <varlistentry>
29	<term><parameter>fd</parameter></term>
30	<listitem>
31	  <para>&fd;</para>
32	</listitem>
33      </varlistentry>
34      <varlistentry>
35	<term><parameter>request</parameter></term>
36	<listitem>
37	  <para>VIDIOC_SUBDEV_ENUM_MBUS_CODE</para>
38	</listitem>
39      </varlistentry>
40      <varlistentry>
41	<term><parameter>argp</parameter></term>
42	<listitem>
43	  <para></para>
44	</listitem>
45      </varlistentry>
46    </variablelist>
47  </refsect1>
48
49  <refsect1>
50    <title>Description</title>
51
52    <note>
53      <title>Experimental</title>
54      <para>This is an <link linkend="experimental">experimental</link>
55      interface and may change in the future.</para>
56    </note>
57
58    <para>To enumerate media bus formats available at a given sub-device pad
59    applications initialize the <structfield>pad</structfield>, <structfield>which</structfield>
60    and <structfield>index</structfield> fields of &v4l2-subdev-mbus-code-enum; and
61    call the <constant>VIDIOC_SUBDEV_ENUM_MBUS_CODE</constant> ioctl with a
62    pointer to this structure. Drivers fill the rest of the structure or return
63    an &EINVAL; if either the <structfield>pad</structfield> or
64    <structfield>index</structfield> are invalid. All media bus formats are
65    enumerable by beginning at index zero and incrementing by one until
66    <errorcode>EINVAL</errorcode> is returned.</para>
67
68    <para>Available media bus formats may depend on the current 'try' formats
69    at other pads of the sub-device, as well as on the current active links. See
70    &VIDIOC-SUBDEV-G-FMT; for more information about the try formats.</para>
71
72    <table pgwide="1" frame="none" id="v4l2-subdev-mbus-code-enum">
73      <title>struct <structname>v4l2_subdev_mbus_code_enum</structname></title>
74      <tgroup cols="3">
75	&cs-str;
76	<tbody valign="top">
77	  <row>
78	    <entry>__u32</entry>
79	    <entry><structfield>pad</structfield></entry>
80	    <entry>Pad number as reported by the media controller API.</entry>
81	  </row>
82	  <row>
83	    <entry>__u32</entry>
84	    <entry><structfield>index</structfield></entry>
85	    <entry>Number of the format in the enumeration, set by the
86	    application.</entry>
87	  </row>
88	  <row>
89	    <entry>__u32</entry>
90	    <entry><structfield>code</structfield></entry>
91	    <entry>The media bus format code, as defined in
92	    <xref linkend="v4l2-mbus-format" />.</entry>
93	  </row>
94	  <row>
95	    <entry>__u32</entry>
96	    <entry><structfield>which</structfield></entry>
97	    <entry>Media bus format codes to be enumerated, from &v4l2-subdev-format-whence;.</entry>
98	  </row>
99	  <row>
100	    <entry>__u32</entry>
101	    <entry><structfield>reserved</structfield>[8]</entry>
102	    <entry>Reserved for future extensions. Applications and drivers must
103	    set the array to zero.</entry>
104	  </row>
105	</tbody>
106      </tgroup>
107    </table>
108  </refsect1>
109
110  <refsect1>
111    &return-value;
112
113    <variablelist>
114      <varlistentry>
115	<term><errorcode>EINVAL</errorcode></term>
116	<listitem>
117	  <para>The &v4l2-subdev-mbus-code-enum; <structfield>pad</structfield>
118	  references a non-existing pad, or the <structfield>index</structfield>
119	  field is out of bounds.</para>
120	</listitem>
121      </varlistentry>
122    </variablelist>
123  </refsect1>
124</refentry>
125