18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci.. _cec-intro:
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciIntroduction
68c2ecf20Sopenharmony_ci============
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciHDMI connectors provide a single pin for use by the Consumer Electronics
98c2ecf20Sopenharmony_ciControl protocol. This protocol allows different devices connected by an
108c2ecf20Sopenharmony_ciHDMI cable to communicate. The protocol for CEC version 1.4 is defined
118c2ecf20Sopenharmony_ciin supplements 1 (CEC) and 2 (HEAC or HDMI Ethernet and Audio Return
128c2ecf20Sopenharmony_ciChannel) of the HDMI 1.4a (:ref:`hdmi`) specification and the
138c2ecf20Sopenharmony_ciextensions added to CEC version 2.0 are defined in chapter 11 of the
148c2ecf20Sopenharmony_ciHDMI 2.0 (:ref:`hdmi2`) specification.
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciThe bitrate is very slow (effectively no more than 36 bytes per second)
178c2ecf20Sopenharmony_ciand is based on the ancient AV.link protocol used in old SCART
188c2ecf20Sopenharmony_ciconnectors. The protocol closely resembles a crazy Rube Goldberg
198c2ecf20Sopenharmony_cicontraption and is an unholy mix of low and high level messages. Some
208c2ecf20Sopenharmony_cimessages, especially those part of the HEAC protocol layered on top of
218c2ecf20Sopenharmony_ciCEC, need to be handled by the kernel, others can be handled either by
228c2ecf20Sopenharmony_cithe kernel or by userspace.
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciIn addition, CEC can be implemented in HDMI receivers, transmitters and
258c2ecf20Sopenharmony_ciin USB devices that have an HDMI input and an HDMI output and that
268c2ecf20Sopenharmony_cicontrol just the CEC pin.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciDrivers that support CEC will create a CEC device node (/dev/cecX) to
298c2ecf20Sopenharmony_cigive userspace access to the CEC adapter. The
308c2ecf20Sopenharmony_ci:ref:`CEC_ADAP_G_CAPS` ioctl will tell userspace what it is allowed to do.
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciIn order to check the support and test it, it is suggested to download
338c2ecf20Sopenharmony_cithe `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ package. It
348c2ecf20Sopenharmony_ciprovides three tools to handle CEC:
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci- cec-ctl: the Swiss army knife of CEC. Allows you to configure, transmit
378c2ecf20Sopenharmony_ci  and monitor CEC messages.
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci- cec-compliance: does a CEC compliance test of a remote CEC device to
408c2ecf20Sopenharmony_ci  determine how compliant the CEC implementation is.
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci- cec-follower: emulates a CEC follower.
43