Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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