[media] doc-rst: linux_tv CEC part, DocBook to reST migration
[cascardo/linux.git] / Documentation / media / uapi / cec / cec-ioc-adap-g-phys-addr.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _cec-ioc-adap-g-phys-addr:
4
5 ************************************************
6 ioctl CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR
7 ************************************************
8
9 *man CEC_ADAP_G_PHYS_ADDR(2)*
10
11 CEC_ADAP_S_PHYS_ADDR
12 Get or set the physical address
13
14
15 Synopsis
16 ========
17
18 .. c:function:: int ioctl( int fd, int request, __u16 *argp )
19
20 Arguments
21 =========
22
23 ``fd``
24     File descriptor returned by :ref:`open() <cec-func-open>`.
25
26 ``request``
27     CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR
28
29 ``argp``
30
31
32 Description
33 ===========
34
35 Note: this documents the proposed CEC API. This API is not yet finalized
36 and is currently only available as a staging kernel module.
37
38 To query the current physical address applications call the
39 ``CEC_ADAP_G_PHYS_ADDR`` ioctl with a pointer to an __u16 where the
40 driver stores the physical address.
41
42 To set a new physical address applications store the physical address in
43 an __u16 and call the ``CEC_ADAP_S_PHYS_ADDR`` ioctl with a pointer to
44 this integer. ``CEC_ADAP_S_PHYS_ADDR`` is only available if
45 ``CEC_CAP_PHYS_ADDR`` is set (ENOTTY error code will be returned
46 otherwise). ``CEC_ADAP_S_PHYS_ADDR`` can only be called by a file handle
47 in initiator mode (see :ref:`CEC_S_MODE <cec-ioc-g-mode>`), if not
48 EBUSY error code will be returned.
49
50 The physical address is a 16-bit number where each group of 4 bits
51 represent a digit of the physical address a.b.c.d where the most
52 significant 4 bits represent 'a'. The CEC root device (usually the TV)
53 has address 0.0.0.0. Every device that is hooked up to an input of the
54 TV has address a.0.0.0 (where 'a' is ≥ 1), devices hooked up to those in
55 turn have addresses a.b.0.0, etc. So a topology of up to 5 devices deep
56 is supported. The physical address a device shall use is stored in the
57 EDID of the sink.
58
59 For example, the EDID for each HDMI input of the TV will have a
60 different physical address of the form a.0.0.0 that the sources will
61 read out and use as their physical address.
62
63
64 Return Value
65 ============
66
67 On success 0 is returned, on error -1 and the ``errno`` variable is set
68 appropriately. The generic error codes are described at the
69 :ref:`Generic Error Codes <gen-errors>` chapter.
70
71
72 .. ------------------------------------------------------------------------------
73 .. This file was automatically converted from DocBook-XML with the dbxml
74 .. library (https://github.com/return42/sphkerneldoc). The origin XML comes
75 .. from the linux kernel, refer to:
76 ..
77 .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
78 .. ------------------------------------------------------------------------------