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