Merge remote-tracking branch 'mmc-uh/next'
[deliverable/linux.git] / Documentation / media / uapi / cec / cec-func-ioctl.rst
CommitLineData
e2460b1d
MH
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _cec-func-ioctl:
4
5***********
6cec ioctl()
7***********
8
21c62694
MH
9Name
10====
e2460b1d 11
21c62694 12cec-ioctl - Control a cec device
e2460b1d
MH
13
14Synopsis
15========
16
17.. code-block:: c
18
19 #include <sys/ioctl.h>
20
21
1b81f010 22.. c:function:: int ioctl( int fd, int request, void *argp )
99547836 23 :name: cec-ioctl
e2460b1d
MH
24
25Arguments
26=========
27
28``fd``
99547836 29 File descriptor returned by :c:func:`open() <cec-open>`.
e2460b1d
MH
30
31``request``
32 CEC ioctl request code as defined in the cec.h header file, for
99547836 33 example :c:func:`CEC_ADAP_G_CAPS`.
e2460b1d
MH
34
35``argp``
36 Pointer to a request-specific structure.
37
38
39Description
40===========
41
b6b6e678
MCC
42.. note::
43
44 This documents the proposed CEC API. This API is not yet finalized
706f8a99 45 and is currently only available as a staging kernel module.
e2460b1d
MH
46
47The :c:func:`ioctl()` function manipulates cec device parameters. The
48argument ``fd`` must be an open file descriptor.
49
50The ioctl ``request`` code specifies the cec function to be called. It
51has encoded in it whether the argument is an input, output or read/write
52parameter, and the size of the argument ``argp`` in bytes.
53
54Macros and structures definitions specifying cec ioctl requests and
55their parameters are located in the cec.h header file. All cec ioctl
56requests, their respective function and parameters are specified in
57:ref:`cec-user-func`.
58
59
60Return Value
61============
62
63On success 0 is returned, on error -1 and the ``errno`` variable is set
64appropriately. The generic error codes are described at the
65:ref:`Generic Error Codes <gen-errors>` chapter.
66
67Request-specific error codes are listed in the individual requests
68descriptions.
69
70When an ioctl that takes an output or read/write parameter fails, the
71parameter remains unmodified.
This page took 0.042796 seconds and 5 git commands to generate.