1 .. SPDX-License-Identifier: GFDL-1.1-no-invari 1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 2 .. c:namespace:: CEC 2 .. c:namespace:: CEC 3 3 4 .. _CEC_ADAP_PHYS_ADDR: 4 .. _CEC_ADAP_PHYS_ADDR: 5 .. _CEC_ADAP_G_PHYS_ADDR: 5 .. _CEC_ADAP_G_PHYS_ADDR: 6 .. _CEC_ADAP_S_PHYS_ADDR: 6 .. _CEC_ADAP_S_PHYS_ADDR: 7 7 8 ********************************************** 8 **************************************************** 9 ioctls CEC_ADAP_G_PHYS_ADDR and CEC_ADAP_S_PHY 9 ioctls CEC_ADAP_G_PHYS_ADDR and CEC_ADAP_S_PHYS_ADDR 10 ********************************************** 10 **************************************************** 11 11 12 Name 12 Name 13 ==== 13 ==== 14 14 15 CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR - G 15 CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR - Get or set the physical address 16 16 17 Synopsis 17 Synopsis 18 ======== 18 ======== 19 19 20 .. c:macro:: CEC_ADAP_G_PHYS_ADDR 20 .. c:macro:: CEC_ADAP_G_PHYS_ADDR 21 21 22 ``int ioctl(int fd, CEC_ADAP_G_PHYS_ADDR, __u1 22 ``int ioctl(int fd, CEC_ADAP_G_PHYS_ADDR, __u16 *argp)`` 23 23 24 .. c:macro:: CEC_ADAP_S_PHYS_ADDR 24 .. c:macro:: CEC_ADAP_S_PHYS_ADDR 25 25 26 ``int ioctl(int fd, CEC_ADAP_S_PHYS_ADDR, __u1 26 ``int ioctl(int fd, CEC_ADAP_S_PHYS_ADDR, __u16 *argp)`` 27 27 28 Arguments 28 Arguments 29 ========= 29 ========= 30 30 31 ``fd`` 31 ``fd`` 32 File descriptor returned by :c:func:`open( 32 File descriptor returned by :c:func:`open()`. 33 33 34 ``argp`` 34 ``argp`` 35 Pointer to the CEC address. 35 Pointer to the CEC address. 36 36 37 Description 37 Description 38 =========== 38 =========== 39 39 40 To query the current physical address applicat 40 To query the current physical address applications call 41 :ref:`ioctl CEC_ADAP_G_PHYS_ADDR <CEC_ADAP_G_P 41 :ref:`ioctl CEC_ADAP_G_PHYS_ADDR <CEC_ADAP_G_PHYS_ADDR>` with a pointer to a __u16 where the 42 driver stores the physical address. 42 driver stores the physical address. 43 43 44 To set a new physical address applications sto 44 To set a new physical address applications store the physical address in 45 a __u16 and call :ref:`ioctl CEC_ADAP_S_PHYS_A 45 a __u16 and call :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` with a pointer to 46 this integer. The :ref:`ioctl CEC_ADAP_S_PHYS_ 46 this integer. The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` is only available if 47 ``CEC_CAP_PHYS_ADDR`` is set (the ``ENOTTY`` e 47 ``CEC_CAP_PHYS_ADDR`` is set (the ``ENOTTY`` error code will be returned 48 otherwise). The :ref:`ioctl CEC_ADAP_S_PHYS_AD 48 otherwise). The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` can only be called 49 by a file descriptor in initiator mode (see :r 49 by a file descriptor in initiator mode (see :ref:`CEC_S_MODE`), if not 50 the ``EBUSY`` error code will be returned. 50 the ``EBUSY`` error code will be returned. 51 51 52 To clear an existing physical address use ``CE 52 To clear an existing physical address use ``CEC_PHYS_ADDR_INVALID``. 53 The adapter will go to the unconfigured state. 53 The adapter will go to the unconfigured state. 54 54 55 If logical address types have been defined (se 55 If logical address types have been defined (see :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`), 56 then this ioctl will block until all 56 then this ioctl will block until all 57 requested logical addresses have been claimed. 57 requested logical addresses have been claimed. If the file descriptor is in non-blocking mode 58 then it will not wait for the logical addresse 58 then it will not wait for the logical addresses to be claimed, instead it just returns 0. 59 59 60 A :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STAT 60 A :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>` event is sent when the physical address 61 changes. 61 changes. 62 62 63 The physical address is a 16-bit number where 63 The physical address is a 16-bit number where each group of 4 bits 64 represent a digit of the physical address a.b. 64 represent a digit of the physical address a.b.c.d where the most 65 significant 4 bits represent 'a'. The CEC root 65 significant 4 bits represent 'a'. The CEC root device (usually the TV) 66 has address 0.0.0.0. Every device that is hook 66 has address 0.0.0.0. Every device that is hooked up to an input of the 67 TV has address a.0.0.0 (where 'a' is ≥ 1), d 67 TV has address a.0.0.0 (where 'a' is ≥ 1), devices hooked up to those in 68 turn have addresses a.b.0.0, etc. So a topolog 68 turn have addresses a.b.0.0, etc. So a topology of up to 5 devices deep 69 is supported. The physical address a device sh 69 is supported. The physical address a device shall use is stored in the 70 EDID of the sink. 70 EDID of the sink. 71 71 72 For example, the EDID for each HDMI input of t 72 For example, the EDID for each HDMI input of the TV will have a 73 different physical address of the form a.0.0.0 73 different physical address of the form a.0.0.0 that the sources will 74 read out and use as their physical address. 74 read out and use as their physical address. 75 75 76 Return Value 76 Return Value 77 ============ 77 ============ 78 78 79 On success 0 is returned, on error -1 and the 79 On success 0 is returned, on error -1 and the ``errno`` variable is set 80 appropriately. The generic error codes are des 80 appropriately. The generic error codes are described at the 81 :ref:`Generic Error Codes <gen-errors>` chapte 81 :ref:`Generic Error Codes <gen-errors>` chapter. 82 82 83 The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP 83 The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` can return the following 84 error codes: 84 error codes: 85 85 86 ENOTTY 86 ENOTTY 87 The ``CEC_CAP_PHYS_ADDR`` capability wasn' 87 The ``CEC_CAP_PHYS_ADDR`` capability wasn't set, so this ioctl is not supported. 88 88 89 EBUSY 89 EBUSY 90 Another filehandle is in exclusive followe 90 Another filehandle is in exclusive follower or initiator mode, or the filehandle 91 is in mode ``CEC_MODE_NO_INITIATOR``. 91 is in mode ``CEC_MODE_NO_INITIATOR``. 92 92 93 EINVAL 93 EINVAL 94 The physical address is malformed. 94 The physical address is malformed.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.