^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)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) .. _cec-intro:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) HDMI connectors provide a single pin for use by the Consumer Electronics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Control protocol. This protocol allows different devices connected by an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) HDMI cable to communicate. The protocol for CEC version 1.4 is defined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) in supplements 1 (CEC) and 2 (HEAC or HDMI Ethernet and Audio Return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Channel) of the HDMI 1.4a (:ref:`hdmi`) specification and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) extensions added to CEC version 2.0 are defined in chapter 11 of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) HDMI 2.0 (:ref:`hdmi2`) specification.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) The bitrate is very slow (effectively no more than 36 bytes per second)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) and is based on the ancient AV.link protocol used in old SCART
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) connectors. The protocol closely resembles a crazy Rube Goldberg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) contraption and is an unholy mix of low and high level messages. Some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) messages, especially those part of the HEAC protocol layered on top of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) CEC, need to be handled by the kernel, others can be handled either by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) the kernel or by userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) In addition, CEC can be implemented in HDMI receivers, transmitters and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) in USB devices that have an HDMI input and an HDMI output and that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) control just the CEC pin.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Drivers that support CEC will create a CEC device node (/dev/cecX) to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) give userspace access to the CEC adapter. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) :ref:`CEC_ADAP_G_CAPS` ioctl will tell userspace what it is allowed to do.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) In order to check the support and test it, it is suggested to download
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) the `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ package. It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) provides three tools to handle CEC:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) - cec-ctl: the Swiss army knife of CEC. Allows you to configure, transmit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) and monitor CEC messages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) - cec-compliance: does a CEC compliance test of a remote CEC device to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) determine how compliant the CEC implementation is.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) - cec-follower: emulates a CEC follower.