brintos

brintos / linux-shallow public Read only

0
0
Text · 3.2 KiB · fb22f68 Raw
95 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: CEC3 4.. _CEC_ADAP_PHYS_ADDR:5.. _CEC_ADAP_G_PHYS_ADDR:6.. _CEC_ADAP_S_PHYS_ADDR:7 8****************************************************9ioctls CEC_ADAP_G_PHYS_ADDR and CEC_ADAP_S_PHYS_ADDR10****************************************************11 12Name13====14 15CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR - Get or set the physical address16 17Synopsis18========19 20.. c:macro:: CEC_ADAP_G_PHYS_ADDR21 22``int ioctl(int fd, CEC_ADAP_G_PHYS_ADDR, __u16 *argp)``23 24.. c:macro:: CEC_ADAP_S_PHYS_ADDR25 26``int ioctl(int fd, CEC_ADAP_S_PHYS_ADDR, __u16 *argp)``27 28Arguments29=========30 31``fd``32    File descriptor returned by :c:func:`open()`.33 34``argp``35    Pointer to the CEC address.36 37Description38===========39 40To query the current physical address applications call41:ref:`ioctl CEC_ADAP_G_PHYS_ADDR <CEC_ADAP_G_PHYS_ADDR>` with a pointer to a __u16 where the42driver stores the physical address.43 44To set a new physical address applications store the physical address in45a __u16 and call :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` with a pointer to46this integer. The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` is only available if47``CEC_CAP_PHYS_ADDR`` is set (the ``ENOTTY`` error code will be returned48otherwise). The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` can only be called49by a file descriptor in initiator mode (see :ref:`CEC_S_MODE`), if not50the ``EBUSY`` error code will be returned.51 52To clear an existing physical address use ``CEC_PHYS_ADDR_INVALID``.53The adapter will go to the unconfigured state.54 55If logical address types have been defined (see :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`),56then this ioctl will block until all57requested logical addresses have been claimed. If the file descriptor is in non-blocking mode58then it will not wait for the logical addresses to be claimed, instead it just returns 0.59 60A :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>` event is sent when the physical address61changes.62 63The physical address is a 16-bit number where each group of 4 bits64represent a digit of the physical address a.b.c.d where the most65significant 4 bits represent 'a'. The CEC root device (usually the TV)66has address 0.0.0.0. Every device that is hooked up to an input of the67TV has address a.0.0.0 (where 'a' is ≥ 1), devices hooked up to those in68turn have addresses a.b.0.0, etc. So a topology of up to 5 devices deep69is supported. The physical address a device shall use is stored in the70EDID of the sink.71 72For example, the EDID for each HDMI input of the TV will have a73different physical address of the form a.0.0.0 that the sources will74read out and use as their physical address.75 76Return Value77============78 79On success 0 is returned, on error -1 and the ``errno`` variable is set80appropriately. The generic error codes are described at the81:ref:`Generic Error Codes <gen-errors>` chapter.82 83The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` can return the following84error codes:85 86ENOTTY87    The ``CEC_CAP_PHYS_ADDR`` capability wasn't set, so this ioctl is not supported.88 89EBUSY90    Another filehandle is in exclusive follower or initiator mode, or the filehandle91    is in mode ``CEC_MODE_NO_INITIATOR``.92 93EINVAL94    The physical address is malformed.95