Merge branch 'i2c/for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
[sfrench/cifs-2.6.git] / Documentation / DocBook / media / v4l / cec-func-ioctl.xml
1 <refentry id="cec-func-ioctl">
2   <refmeta>
3     <refentrytitle>cec ioctl()</refentrytitle>
4     &manvol;
5   </refmeta>
6
7   <refnamediv>
8     <refname>cec-ioctl</refname>
9     <refpurpose>Control a cec device</refpurpose>
10   </refnamediv>
11
12   <refsynopsisdiv>
13     <funcsynopsis>
14       <funcsynopsisinfo>#include &lt;sys/ioctl.h&gt;</funcsynopsisinfo>
15       <funcprototype>
16         <funcdef>int <function>ioctl</function></funcdef>
17         <paramdef>int <parameter>fd</parameter></paramdef>
18         <paramdef>int <parameter>request</parameter></paramdef>
19         <paramdef>void *<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>CEC ioctl request code as defined in the cec.h header file,
38           for example CEC_ADAP_G_CAPS.</para>
39         </listitem>
40       </varlistentry>
41       <varlistentry>
42         <term><parameter>argp</parameter></term>
43         <listitem>
44           <para>Pointer to a request-specific structure.</para>
45         </listitem>
46       </varlistentry>
47     </variablelist>
48   </refsect1>
49
50   <refsect1>
51     <title>Description</title>
52     <para>
53       Note: this documents the proposed CEC API. This API is not yet finalized and
54       is currently only available as a staging kernel module.
55     </para>
56
57     <para>The <function>ioctl()</function> function manipulates cec device
58     parameters. The argument <parameter>fd</parameter> must be an open file
59     descriptor.</para>
60     <para>The ioctl <parameter>request</parameter> code specifies the cec
61     function to be called. It has encoded in it whether the argument is an
62     input, output or read/write parameter, and the size of the argument
63     <parameter>argp</parameter> in bytes.</para>
64     <para>Macros and structures definitions specifying cec ioctl requests and
65     their parameters are located in the cec.h header file. All cec ioctl
66     requests, their respective function and parameters are specified in
67     <xref linkend="cec-user-func" />.</para>
68   </refsect1>
69
70   <refsect1>
71     &return-value;
72
73     <para>Request-specific error codes are listed in the
74     individual requests descriptions.</para>
75     <para>When an ioctl that takes an output or read/write parameter fails,
76     the parameter remains unmodified.</para>
77   </refsect1>
78 </refentry>