[media] doc-rst: linux_tc CEC enhanced markup
[deliverable/linux.git] / Documentation / media / uapi / cec / cec-ioc-adap-g-log-addrs.rst
CommitLineData
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************************************************
8ioctl CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS
9************************************************
10
21c62694
MH
11Name
12====
e2460b1d 13
21c62694 14CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS - Get or set the logical addresses
e2460b1d
MH
15
16
17Synopsis
18========
19
21c62694
MH
20.. cpp:function:: int ioctl( int fd, int request, struct cec_log_addrs *argp )
21
e2460b1d
MH
22
23Arguments
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
35Description
36===========
37
38Note: this documents the proposed CEC API. This API is not yet finalized
39and is currently only available as a staging kernel module.
40
41To 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
44the logical addresses.
45
46To 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`
48ioctl with a pointer to this struct. The :ref:`CEC_ADAP_S_LOG_ADDRS` ioctl
e2460b1d
MH
49is only available if ``CEC_CAP_LOG_ADDRS`` is set (ENOTTY error code is
50returned otherwise). This ioctl will block until all requested logical
21c62694 51addresses have been claimed. :ref:`CEC_ADAP_S_LOG_ADDRS` can only be called
e2460b1d 52by 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
61 :widths: 1 1 2
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
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``.
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
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.
86
87 - .. row 3
88
89 - __u8
90
91 - ``cec_version``
92
93 - The CEC version that this adapter shall use. See
94 :ref:`cec-versions`. Used to implement the
95 ``CEC_MSG_CEC_VERSION`` and ``CEC_MSG_REPORT_FEATURES`` messages.
21c62694 96 Note that :ref:`CEC_OP_CEC_VERSION_1_3A <CEC_OP_CEC_VERSION_1_3A>` is not allowed by the CEC
e2460b1d
MH
97 framework.
98
99 - .. row 4
100
101 - __u8
102
103 - ``num_log_addrs``
104
105 - Number of logical addresses to set up. Must be ≤
106 ``available_log_addrs`` as returned by
21c62694 107 :ref:`CEC_ADAP_G_CAPS`. All arrays in
e2460b1d
MH
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.
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
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``.
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
144 ``CEC_MSG_SET_OSD_NAME`` message.
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
153 :ref:`cec-prim-dev-types` for possible types.
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
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
21c62694 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
173 :ref:`cec-all-dev-types-flags`. Used to implement the
174 ``CEC_MSG_REPORT_FEATURES`` message. This field is ignored if
21c62694 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
184 ``CEC_MSG_REPORT_FEATURES`` message. The 12 bytes include both the
185 RC Profile and the Device Features. This field is ignored if
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
295 :widths: 3 1 4
296
297
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
353 CEC switches or CDC-only devices (CDC: Capability Discovery and
354 Control).
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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
21c62694 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
416Return Value
417============
418
419On success 0 is returned, on error -1 and the ``errno`` variable is set
420appropriately. The generic error codes are described at the
421:ref:`Generic Error Codes <gen-errors>` chapter.
422
This page took 0.050553 seconds and 5 git commands to generate.