Commit | Line | Data |
---|---|---|
e2460b1d MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
21c62694 MH |
3 | .. _CEC_ADAP_LOG_ADDRS: |
4 | .. _CEC_ADAP_G_LOG_ADDRS: | |
5 | .. _CEC_ADAP_S_LOG_ADDRS: | |
e2460b1d MH |
6 | |
7 | ************************************************ | |
8 | ioctl CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS | |
9 | ************************************************ | |
10 | ||
21c62694 MH |
11 | Name |
12 | ==== | |
e2460b1d | 13 | |
21c62694 | 14 | CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS - Get or set the logical addresses |
e2460b1d MH |
15 | |
16 | ||
17 | Synopsis | |
18 | ======== | |
19 | ||
21c62694 MH |
20 | .. cpp:function:: int ioctl( int fd, int request, struct cec_log_addrs *argp ) |
21 | ||
e2460b1d MH |
22 | |
23 | Arguments | |
24 | ========= | |
25 | ||
26 | ``fd`` | |
27 | File descriptor returned by :ref:`open() <cec-func-open>`. | |
28 | ||
29 | ``request`` | |
30 | CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS | |
31 | ||
32 | ``argp`` | |
33 | ||
34 | ||
35 | Description | |
36 | =========== | |
37 | ||
706f8a99 MCC |
38 | .. note:: This documents the proposed CEC API. This API is not yet finalized |
39 | and is currently only available as a staging kernel module. | |
e2460b1d MH |
40 | |
41 | To query the current CEC logical addresses, applications call the | |
21c62694 | 42 | :ref:`CEC_ADAP_G_LOG_ADDRS` ioctl with a pointer to a |
e2460b1d MH |
43 | :c:type:`struct cec_log_addrs` structure where the drivers stores |
44 | the logical addresses. | |
45 | ||
46 | To set new logical addresses, applications fill in struct | |
21c62694 MH |
47 | :c:type:`struct cec_log_addrs` and call the :ref:`CEC_ADAP_S_LOG_ADDRS` |
48 | ioctl with a pointer to this struct. The :ref:`CEC_ADAP_S_LOG_ADDRS` ioctl | |
e2460b1d MH |
49 | is only available if ``CEC_CAP_LOG_ADDRS`` is set (ENOTTY error code is |
50 | returned otherwise). This ioctl will block until all requested logical | |
21c62694 | 51 | addresses have been claimed. :ref:`CEC_ADAP_S_LOG_ADDRS` can only be called |
e2460b1d | 52 | by a file handle in initiator mode (see |
21c62694 | 53 | :ref:`CEC_S_MODE`). |
e2460b1d MH |
54 | |
55 | ||
56 | .. _cec-log-addrs: | |
57 | ||
58 | .. flat-table:: struct cec_log_addrs | |
59 | :header-rows: 0 | |
60 | :stub-columns: 0 | |
b2a58436 | 61 | :widths: 1 1 16 |
e2460b1d MH |
62 | |
63 | ||
64 | - .. row 1 | |
65 | ||
66 | - __u8 | |
67 | ||
68 | - ``log_addr`` [CEC_MAX_LOG_ADDRS] | |
69 | ||
70 | - The actual logical addresses that were claimed. This is set by the | |
706f8a99 MCC |
71 | driver. If no logical address could be claimed, then it is set to |
72 | ``CEC_LOG_ADDR_INVALID``. If this adapter is Unregistered, then | |
73 | ``log_addr[0]`` is set to 0xf and all others to | |
74 | ``CEC_LOG_ADDR_INVALID``. | |
e2460b1d MH |
75 | |
76 | - .. row 2 | |
77 | ||
78 | - __u16 | |
79 | ||
80 | - ``log_addr_mask`` | |
81 | ||
82 | - The bitmask of all logical addresses this adapter has claimed. If | |
706f8a99 MCC |
83 | this adapter is Unregistered then ``log_addr_mask`` sets bit 15 |
84 | and clears all other bits. If this adapter is not configured at | |
85 | all, then ``log_addr_mask`` is set to 0. Set by the driver. | |
e2460b1d MH |
86 | |
87 | - .. row 3 | |
88 | ||
89 | - __u8 | |
90 | ||
91 | - ``cec_version`` | |
92 | ||
93 | - The CEC version that this adapter shall use. See | |
706f8a99 MCC |
94 | :ref:`cec-versions`. Used to implement the |
95 | ``CEC_MSG_CEC_VERSION`` and ``CEC_MSG_REPORT_FEATURES`` messages. | |
96 | Note that :ref:`CEC_OP_CEC_VERSION_1_3A <CEC-OP-CEC-VERSION-1-3A>` is not allowed by the CEC | |
97 | framework. | |
e2460b1d MH |
98 | |
99 | - .. row 4 | |
100 | ||
101 | - __u8 | |
102 | ||
103 | - ``num_log_addrs`` | |
104 | ||
105 | - Number of logical addresses to set up. Must be ≤ | |
706f8a99 MCC |
106 | ``available_log_addrs`` as returned by |
107 | :ref:`CEC_ADAP_G_CAPS`. All arrays in | |
108 | this structure are only filled up to index | |
109 | ``available_log_addrs``-1. The remaining array elements will be | |
110 | ignored. Note that the CEC 2.0 standard allows for a maximum of 2 | |
111 | logical addresses, although some hardware has support for more. | |
112 | ``CEC_MAX_LOG_ADDRS`` is 4. The driver will return the actual | |
113 | number of logical addresses it could claim, which may be less than | |
114 | what was requested. If this field is set to 0, then the CEC | |
115 | adapter shall clear all claimed logical addresses and all other | |
116 | fields will be ignored. | |
e2460b1d MH |
117 | |
118 | - .. row 5 | |
119 | ||
120 | - __u32 | |
121 | ||
122 | - ``vendor_id`` | |
123 | ||
124 | - The vendor ID is a 24-bit number that identifies the specific | |
706f8a99 MCC |
125 | vendor or entity. Based on this ID vendor specific commands may be |
126 | defined. If you do not want a vendor ID then set it to | |
127 | ``CEC_VENDOR_ID_NONE``. | |
e2460b1d MH |
128 | |
129 | - .. row 6 | |
130 | ||
131 | - __u32 | |
132 | ||
133 | - ``flags`` | |
134 | ||
135 | - Flags. No flags are defined yet, so set this to 0. | |
136 | ||
137 | - .. row 7 | |
138 | ||
139 | - char | |
140 | ||
141 | - ``osd_name``\ [15] | |
142 | ||
143 | - The On-Screen Display name as is returned by the | |
706f8a99 | 144 | ``CEC_MSG_SET_OSD_NAME`` message. |
e2460b1d MH |
145 | |
146 | - .. row 8 | |
147 | ||
148 | - __u8 | |
149 | ||
150 | - ``primary_device_type`` [CEC_MAX_LOG_ADDRS] | |
151 | ||
152 | - Primary device type for each logical address. See | |
706f8a99 | 153 | :ref:`cec-prim-dev-types` for possible types. |
e2460b1d MH |
154 | |
155 | - .. row 9 | |
156 | ||
157 | - __u8 | |
158 | ||
159 | - ``log_addr_type`` [CEC_MAX_LOG_ADDRS] | |
160 | ||
161 | - Logical address types. See :ref:`cec-log-addr-types` for | |
706f8a99 MCC |
162 | possible types. The driver will update this with the actual |
163 | logical address type that it claimed (e.g. it may have to fallback | |
164 | to :ref:`CEC_LOG_ADDR_TYPE_UNREGISTERED <CEC-LOG-ADDR-TYPE-UNREGISTERED>`). | |
e2460b1d MH |
165 | |
166 | - .. row 10 | |
167 | ||
168 | - __u8 | |
169 | ||
170 | - ``all_device_types`` [CEC_MAX_LOG_ADDRS] | |
171 | ||
172 | - CEC 2.0 specific: all device types. See | |
706f8a99 MCC |
173 | :ref:`cec-all-dev-types-flags`. Used to implement the |
174 | ``CEC_MSG_REPORT_FEATURES`` message. This field is ignored if | |
175 | ``cec_version`` < :ref:`CEC_OP_CEC_VERSION_2_0 <CEC-OP-CEC-VERSION-2-0>`. | |
e2460b1d MH |
176 | |
177 | - .. row 11 | |
178 | ||
179 | - __u8 | |
180 | ||
181 | - ``features`` [CEC_MAX_LOG_ADDRS][12] | |
182 | ||
183 | - Features for each logical address. Used to implement the | |
706f8a99 MCC |
184 | ``CEC_MSG_REPORT_FEATURES`` message. The 12 bytes include both the |
185 | RC Profile and the Device Features. This field is ignored if | |
186 | ``cec_version`` < :ref:`CEC_OP_CEC_VERSION_2_0 <CEC-OP-CEC-VERSION-2-0>`. | |
e2460b1d MH |
187 | |
188 | ||
189 | ||
190 | .. _cec-versions: | |
191 | ||
192 | .. flat-table:: CEC Versions | |
193 | :header-rows: 0 | |
194 | :stub-columns: 0 | |
195 | :widths: 3 1 4 | |
196 | ||
197 | ||
96f69e0e | 198 | - .. _`CEC-OP-CEC-VERSION-1-3A`: |
e2460b1d MH |
199 | |
200 | - ``CEC_OP_CEC_VERSION_1_3A`` | |
201 | ||
202 | - 4 | |
203 | ||
204 | - CEC version according to the HDMI 1.3a standard. | |
205 | ||
96f69e0e | 206 | - .. _`CEC-OP-CEC-VERSION-1-4B`: |
e2460b1d MH |
207 | |
208 | - ``CEC_OP_CEC_VERSION_1_4B`` | |
209 | ||
210 | - 5 | |
211 | ||
212 | - CEC version according to the HDMI 1.4b standard. | |
213 | ||
96f69e0e | 214 | - .. _`CEC-OP-CEC-VERSION-2-0`: |
e2460b1d MH |
215 | |
216 | - ``CEC_OP_CEC_VERSION_2_0`` | |
217 | ||
218 | - 6 | |
219 | ||
220 | - CEC version according to the HDMI 2.0 standard. | |
221 | ||
222 | ||
223 | ||
224 | .. _cec-prim-dev-types: | |
225 | ||
226 | .. flat-table:: CEC Primary Device Types | |
227 | :header-rows: 0 | |
228 | :stub-columns: 0 | |
229 | :widths: 3 1 4 | |
230 | ||
231 | ||
96f69e0e | 232 | - .. _`CEC-OP-PRIM-DEVTYPE-TV`: |
e2460b1d MH |
233 | |
234 | - ``CEC_OP_PRIM_DEVTYPE_TV`` | |
235 | ||
236 | - 0 | |
237 | ||
238 | - Use for a TV. | |
239 | ||
96f69e0e | 240 | - .. _`CEC-OP-PRIM-DEVTYPE-RECORD`: |
e2460b1d MH |
241 | |
242 | - ``CEC_OP_PRIM_DEVTYPE_RECORD`` | |
243 | ||
244 | - 1 | |
245 | ||
246 | - Use for a recording device. | |
247 | ||
96f69e0e | 248 | - .. _`CEC-OP-PRIM-DEVTYPE-TUNER`: |
e2460b1d MH |
249 | |
250 | - ``CEC_OP_PRIM_DEVTYPE_TUNER`` | |
251 | ||
252 | - 3 | |
253 | ||
254 | - Use for a device with a tuner. | |
255 | ||
96f69e0e | 256 | - .. _`CEC-OP-PRIM-DEVTYPE-PLAYBACK`: |
e2460b1d MH |
257 | |
258 | - ``CEC_OP_PRIM_DEVTYPE_PLAYBACK`` | |
259 | ||
260 | - 4 | |
261 | ||
262 | - Use for a playback device. | |
263 | ||
96f69e0e | 264 | - .. _`CEC-OP-PRIM-DEVTYPE-AUDIOSYSTEM`: |
e2460b1d MH |
265 | |
266 | - ``CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM`` | |
267 | ||
268 | - 5 | |
269 | ||
270 | - Use for an audio system (e.g. an audio/video receiver). | |
271 | ||
96f69e0e | 272 | - .. _`CEC-OP-PRIM-DEVTYPE-SWITCH`: |
e2460b1d MH |
273 | |
274 | - ``CEC_OP_PRIM_DEVTYPE_SWITCH`` | |
275 | ||
276 | - 6 | |
277 | ||
278 | - Use for a CEC switch. | |
279 | ||
96f69e0e | 280 | - .. _`CEC-OP-PRIM-DEVTYPE-VIDEOPROC`: |
e2460b1d MH |
281 | |
282 | - ``CEC_OP_PRIM_DEVTYPE_VIDEOPROC`` | |
283 | ||
284 | - 7 | |
285 | ||
286 | - Use for a video processor device. | |
287 | ||
288 | ||
289 | ||
290 | .. _cec-log-addr-types: | |
291 | ||
292 | .. flat-table:: CEC Logical Address Types | |
293 | :header-rows: 0 | |
294 | :stub-columns: 0 | |
b2a58436 | 295 | :widths: 3 1 16 |
e2460b1d MH |
296 | |
297 | ||
96f69e0e | 298 | - .. _`CEC-LOG-ADDR-TYPE-TV`: |
e2460b1d MH |
299 | |
300 | - ``CEC_LOG_ADDR_TYPE_TV`` | |
301 | ||
302 | - 0 | |
303 | ||
304 | - Use for a TV. | |
305 | ||
96f69e0e | 306 | - .. _`CEC-LOG-ADDR-TYPE-RECORD`: |
e2460b1d MH |
307 | |
308 | - ``CEC_LOG_ADDR_TYPE_RECORD`` | |
309 | ||
310 | - 1 | |
311 | ||
312 | - Use for a recording device. | |
313 | ||
96f69e0e | 314 | - .. _`CEC-LOG-ADDR-TYPE-TUNER`: |
e2460b1d MH |
315 | |
316 | - ``CEC_LOG_ADDR_TYPE_TUNER`` | |
317 | ||
318 | - 2 | |
319 | ||
320 | - Use for a tuner device. | |
321 | ||
96f69e0e | 322 | - .. _`CEC-LOG-ADDR-TYPE-PLAYBACK`: |
e2460b1d MH |
323 | |
324 | - ``CEC_LOG_ADDR_TYPE_PLAYBACK`` | |
325 | ||
326 | - 3 | |
327 | ||
328 | - Use for a playback device. | |
329 | ||
96f69e0e | 330 | - .. _`CEC-LOG-ADDR-TYPE-AUDIOSYSTEM`: |
e2460b1d MH |
331 | |
332 | - ``CEC_LOG_ADDR_TYPE_AUDIOSYSTEM`` | |
333 | ||
334 | - 4 | |
335 | ||
336 | - Use for an audio system device. | |
337 | ||
96f69e0e | 338 | - .. _`CEC-LOG-ADDR-TYPE-SPECIFIC`: |
e2460b1d MH |
339 | |
340 | - ``CEC_LOG_ADDR_TYPE_SPECIFIC`` | |
341 | ||
342 | - 5 | |
343 | ||
344 | - Use for a second TV or for a video processor device. | |
345 | ||
96f69e0e | 346 | - .. _`CEC-LOG-ADDR-TYPE-UNREGISTERED`: |
e2460b1d MH |
347 | |
348 | - ``CEC_LOG_ADDR_TYPE_UNREGISTERED`` | |
349 | ||
350 | - 6 | |
351 | ||
352 | - Use this if you just want to remain unregistered. Used for pure | |
706f8a99 MCC |
353 | CEC switches or CDC-only devices (CDC: Capability Discovery and |
354 | Control). | |
e2460b1d MH |
355 | |
356 | ||
357 | ||
358 | .. _cec-all-dev-types-flags: | |
359 | ||
360 | .. flat-table:: CEC All Device Types Flags | |
361 | :header-rows: 0 | |
362 | :stub-columns: 0 | |
363 | :widths: 3 1 4 | |
364 | ||
365 | ||
96f69e0e | 366 | - .. _`CEC-OP-ALL-DEVTYPE-TV`: |
e2460b1d MH |
367 | |
368 | - ``CEC_OP_ALL_DEVTYPE_TV`` | |
369 | ||
370 | - 0x80 | |
371 | ||
372 | - This supports the TV type. | |
373 | ||
96f69e0e | 374 | - .. _`CEC-OP-ALL-DEVTYPE-RECORD`: |
e2460b1d MH |
375 | |
376 | - ``CEC_OP_ALL_DEVTYPE_RECORD`` | |
377 | ||
378 | - 0x40 | |
379 | ||
380 | - This supports the Recording type. | |
381 | ||
96f69e0e | 382 | - .. _`CEC-OP-ALL-DEVTYPE-TUNER`: |
e2460b1d MH |
383 | |
384 | - ``CEC_OP_ALL_DEVTYPE_TUNER`` | |
385 | ||
386 | - 0x20 | |
387 | ||
388 | - This supports the Tuner type. | |
389 | ||
96f69e0e | 390 | - .. _`CEC-OP-ALL-DEVTYPE-PLAYBACK`: |
e2460b1d MH |
391 | |
392 | - ``CEC_OP_ALL_DEVTYPE_PLAYBACK`` | |
393 | ||
394 | - 0x10 | |
395 | ||
396 | - This supports the Playback type. | |
397 | ||
96f69e0e | 398 | - .. _`CEC-OP-ALL-DEVTYPE-AUDIOSYSTEM`: |
e2460b1d MH |
399 | |
400 | - ``CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM`` | |
401 | ||
402 | - 0x08 | |
403 | ||
404 | - This supports the Audio System type. | |
405 | ||
96f69e0e | 406 | - .. _`CEC-OP-ALL-DEVTYPE-SWITCH`: |
e2460b1d MH |
407 | |
408 | - ``CEC_OP_ALL_DEVTYPE_SWITCH`` | |
409 | ||
410 | - 0x04 | |
411 | ||
412 | - This supports the CEC Switch or Video Processing type. | |
413 | ||
414 | ||
415 | ||
416 | Return Value | |
417 | ============ | |
418 | ||
419 | On success 0 is returned, on error -1 and the ``errno`` variable is set | |
420 | appropriately. The generic error codes are described at the | |
421 | :ref:`Generic Error Codes <gen-errors>` chapter. | |
422 |