Merge branch 'pm-cpufreq'
[cascardo/linux.git] / Documentation / media / uapi / cec / cec-ioc-adap-g-caps.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _CEC_ADAP_G_CAPS:
4
5 *********************
6 ioctl CEC_ADAP_G_CAPS
7 *********************
8
9 Name
10 ====
11
12 CEC_ADAP_G_CAPS - Query device capabilities
13
14 Synopsis
15 ========
16
17 .. c:function:: int ioctl( int fd, CEC_ADAP_G_CAPS, struct cec_caps *argp )
18     :name: CEC_ADAP_G_CAPS
19
20 Arguments
21 =========
22
23 ``fd``
24     File descriptor returned by :ref:`open() <cec-func-open>`.
25
26 ``argp``
27
28
29 Description
30 ===========
31
32 .. note::
33
34    This documents the proposed CEC API. This API is not yet finalized
35    and is currently only available as a staging kernel module.
36
37 All cec devices must support :ref:`ioctl CEC_ADAP_G_CAPS <CEC_ADAP_G_CAPS>`. To query
38 device information, applications call the ioctl with a pointer to a
39 struct :c:type:`cec_caps`. The driver fills the structure and
40 returns the information to the application. The ioctl never fails.
41
42 .. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.8cm}|
43
44 .. c:type:: cec_caps
45
46 .. flat-table:: struct cec_caps
47     :header-rows:  0
48     :stub-columns: 0
49     :widths:       1 1 16
50
51
52     -  .. row 1
53
54        -  char
55
56        -  ``driver[32]``
57
58        -  The name of the cec adapter driver.
59
60     -  .. row 2
61
62        -  char
63
64        -  ``name[32]``
65
66        -  The name of this CEC adapter. The combination ``driver`` and
67           ``name`` must be unique.
68
69     -  .. row 3
70
71        -  __u32
72
73        -  ``capabilities``
74
75        -  The capabilities of the CEC adapter, see
76           :ref:`cec-capabilities`.
77
78     -  .. row 4
79
80        -  __u32
81
82        -  ``version``
83
84        -  CEC Framework API version, formatted with the ``KERNEL_VERSION()``
85           macro.
86
87
88 .. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.6cm}|
89
90 .. _cec-capabilities:
91
92 .. flat-table:: CEC Capabilities Flags
93     :header-rows:  0
94     :stub-columns: 0
95     :widths:       3 1 8
96
97
98     -  .. _`CEC-CAP-PHYS-ADDR`:
99
100        -  ``CEC_CAP_PHYS_ADDR``
101
102        -  0x00000001
103
104        -  Userspace has to configure the physical address by calling
105           :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>`. If
106           this capability isn't set, then setting the physical address is
107           handled by the kernel whenever the EDID is set (for an HDMI
108           receiver) or read (for an HDMI transmitter).
109
110     -  .. _`CEC-CAP-LOG-ADDRS`:
111
112        -  ``CEC_CAP_LOG_ADDRS``
113
114        -  0x00000002
115
116        -  Userspace has to configure the logical addresses by calling
117           :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`. If
118           this capability isn't set, then the kernel will have configured
119           this.
120
121     -  .. _`CEC-CAP-TRANSMIT`:
122
123        -  ``CEC_CAP_TRANSMIT``
124
125        -  0x00000004
126
127        -  Userspace can transmit CEC messages by calling
128           :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. This implies that
129           userspace can be a follower as well, since being able to transmit
130           messages is a prerequisite of becoming a follower. If this
131           capability isn't set, then the kernel will handle all CEC
132           transmits and process all CEC messages it receives.
133
134     -  .. _`CEC-CAP-PASSTHROUGH`:
135
136        -  ``CEC_CAP_PASSTHROUGH``
137
138        -  0x00000008
139
140        -  Userspace can use the passthrough mode by calling
141           :ref:`ioctl CEC_S_MODE <CEC_S_MODE>`.
142
143     -  .. _`CEC-CAP-RC`:
144
145        -  ``CEC_CAP_RC``
146
147        -  0x00000010
148
149        -  This adapter supports the remote control protocol.
150
151     -  .. _`CEC-CAP-MONITOR-ALL`:
152
153        -  ``CEC_CAP_MONITOR_ALL``
154
155        -  0x00000020
156
157        -  The CEC hardware can monitor all messages, not just directed and
158           broadcast messages.
159
160
161
162 Return Value
163 ============
164
165 On success 0 is returned, on error -1 and the ``errno`` variable is set
166 appropriately. The generic error codes are described at the
167 :ref:`Generic Error Codes <gen-errors>` chapter.