xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/cec/cec-intro.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun.. _cec-intro:
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunIntroduction
6*4882a593Smuzhiyun============
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunHDMI connectors provide a single pin for use by the Consumer Electronics
9*4882a593SmuzhiyunControl protocol. This protocol allows different devices connected by an
10*4882a593SmuzhiyunHDMI cable to communicate. The protocol for CEC version 1.4 is defined
11*4882a593Smuzhiyunin supplements 1 (CEC) and 2 (HEAC or HDMI Ethernet and Audio Return
12*4882a593SmuzhiyunChannel) of the HDMI 1.4a (:ref:`hdmi`) specification and the
13*4882a593Smuzhiyunextensions added to CEC version 2.0 are defined in chapter 11 of the
14*4882a593SmuzhiyunHDMI 2.0 (:ref:`hdmi2`) specification.
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunThe bitrate is very slow (effectively no more than 36 bytes per second)
17*4882a593Smuzhiyunand is based on the ancient AV.link protocol used in old SCART
18*4882a593Smuzhiyunconnectors. The protocol closely resembles a crazy Rube Goldberg
19*4882a593Smuzhiyuncontraption and is an unholy mix of low and high level messages. Some
20*4882a593Smuzhiyunmessages, especially those part of the HEAC protocol layered on top of
21*4882a593SmuzhiyunCEC, need to be handled by the kernel, others can be handled either by
22*4882a593Smuzhiyunthe kernel or by userspace.
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunIn addition, CEC can be implemented in HDMI receivers, transmitters and
25*4882a593Smuzhiyunin USB devices that have an HDMI input and an HDMI output and that
26*4882a593Smuzhiyuncontrol just the CEC pin.
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunDrivers that support CEC will create a CEC device node (/dev/cecX) to
29*4882a593Smuzhiyungive userspace access to the CEC adapter. The
30*4882a593Smuzhiyun:ref:`CEC_ADAP_G_CAPS` ioctl will tell userspace what it is allowed to do.
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunIn order to check the support and test it, it is suggested to download
33*4882a593Smuzhiyunthe `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ package. It
34*4882a593Smuzhiyunprovides three tools to handle CEC:
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun- cec-ctl: the Swiss army knife of CEC. Allows you to configure, transmit
37*4882a593Smuzhiyun  and monitor CEC messages.
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun- cec-compliance: does a CEC compliance test of a remote CEC device to
40*4882a593Smuzhiyun  determine how compliant the CEC implementation is.
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun- cec-follower: emulates a CEC follower.
43