i2c: core: Add support for 'i2c-bus' subnode
[cascardo/linux.git] / Documentation / DocBook / media / v4l / vidioc-subdev-enum-mbus-code.xml
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     <para>To enumerate media bus formats available at a given sub-device pad
53     applications initialize the <structfield>pad</structfield>, <structfield>which</structfield>
54     and <structfield>index</structfield> fields of &v4l2-subdev-mbus-code-enum; and
55     call the <constant>VIDIOC_SUBDEV_ENUM_MBUS_CODE</constant> ioctl with a
56     pointer to this structure. Drivers fill the rest of the structure or return
57     an &EINVAL; if either the <structfield>pad</structfield> or
58     <structfield>index</structfield> are invalid. All media bus formats are
59     enumerable by beginning at index zero and incrementing by one until
60     <errorcode>EINVAL</errorcode> is returned.</para>
61
62     <para>Available media bus formats may depend on the current 'try' formats
63     at other pads of the sub-device, as well as on the current active links. See
64     &VIDIOC-SUBDEV-G-FMT; for more information about the try formats.</para>
65
66     <table pgwide="1" frame="none" id="v4l2-subdev-mbus-code-enum">
67       <title>struct <structname>v4l2_subdev_mbus_code_enum</structname></title>
68       <tgroup cols="3">
69         &cs-str;
70         <tbody valign="top">
71           <row>
72             <entry>__u32</entry>
73             <entry><structfield>pad</structfield></entry>
74             <entry>Pad number as reported by the media controller API.</entry>
75           </row>
76           <row>
77             <entry>__u32</entry>
78             <entry><structfield>index</structfield></entry>
79             <entry>Number of the format in the enumeration, set by the
80             application.</entry>
81           </row>
82           <row>
83             <entry>__u32</entry>
84             <entry><structfield>code</structfield></entry>
85             <entry>The media bus format code, as defined in
86             <xref linkend="v4l2-mbus-format" />.</entry>
87           </row>
88           <row>
89             <entry>__u32</entry>
90             <entry><structfield>which</structfield></entry>
91             <entry>Media bus format codes to be enumerated, from &v4l2-subdev-format-whence;.</entry>
92           </row>
93           <row>
94             <entry>__u32</entry>
95             <entry><structfield>reserved</structfield>[8]</entry>
96             <entry>Reserved for future extensions. Applications and drivers must
97             set the array to zero.</entry>
98           </row>
99         </tbody>
100       </tgroup>
101     </table>
102   </refsect1>
103
104   <refsect1>
105     &return-value;
106
107     <variablelist>
108       <varlistentry>
109         <term><errorcode>EINVAL</errorcode></term>
110         <listitem>
111           <para>The &v4l2-subdev-mbus-code-enum; <structfield>pad</structfield>
112           references a non-existing pad, or the <structfield>index</structfield>
113           field is out of bounds.</para>
114         </listitem>
115       </varlistentry>
116     </variablelist>
117   </refsect1>
118 </refentry>