Lines Matching +full:hdmi +full:- +full:cec
1 .. SPDX-License-Identifier: GPL-2.0
3 CEC Kernel Support
6 The CEC framework provides a unified kernel interface for use with HDMI CEC
14 The CEC Protocol
15 ----------------
17 The CEC protocol enables consumer electronic devices to communicate with each
18 other through the HDMI connection. The protocol uses logical addresses in the
24 The CEC framework described here is up to date with the CEC 2.0 specification.
25 It is documented in the HDMI 1.4 specification with the new 2.0 bits documented
26 in the HDMI 2.0 specification. But for most of the features the freely available
27 HDMI 1.3a specification is sufficient:
29 https://www.hdmi.org/spec/index
32 CEC Adapter Interface
33 ---------------------
35 The struct cec_adapter represents the CEC adapter hardware. It is created by
49 adapter operations which are called by the CEC framework and that you
53 will be stored in adap->priv and can be used by the adapter ops.
57 the name of the CEC adapter. Note: this name will be copied.
60 capabilities of the CEC adapter. These capabilities determine the
95 Implementing the Low-Level CEC Adapter
96 --------------------------------------
98 The following low-level adapter operations have to be implemented in
103 .. code-block:: none
107 /* Low-level callbacks */
121 /* High-level callback */
125 The seven low-level ops deal with various aspects of controlling the CEC adapter
133 This callback enables or disables the CEC hardware. Enabling the CEC hardware
136 capability is not set, then the physical address can change while the CEC
137 hardware is enabled. CEC drivers should not set CEC_CAP_NEEDS_HPD unless
140 state of the CEC adapter after calling cec_allocate_adapter() is disabled.
161 If enabled, then the adapter should be put in a mode to also monitor CEC pin
176 should return -ENXIO. Once a logical address is programmed the CEC hardware
210 To log the current CEC hardware status::
214 This optional callback can be used to show the status of the CEC hardware.
215 The status is available through debugfs: cat /sys/kernel/debug/cec/cecX/status
244 arbitration was lost: another CEC initiator
245 took control of the CEC line and you lost the arbitration.
252 low drive was detected on the CEC bus. This indicates that
290 When a CEC message was received:
298 ----------------------------------
300 Typically the CEC hardware provides interrupts that signal when a transmit
302 when a CEC message was received.
304 The CEC driver should always process the transmit interrupts first before
310 ----------------------------------------------
312 If the CEC adapter supports Error Injection functionality, then that can
315 .. code-block:: none
318 /* Low-level callbacks */
325 /* High-level CEC message callback */
329 If both callbacks are set, then an ``error-inj`` file will appear in debugfs.
335 This basic parsing is done in the CEC Framework. It is up to the driver to decide
340 This ensures that you can always do ``echo clear >error-inj`` to clear any error
341 injections without having to know the details of the driver-specific commands.
343 Note that the output of ``error-inj`` shall be valid as input to ``error-inj``.
346 .. code-block:: none
348 $ cat error-inj >einj.txt
349 $ cat einj.txt >error-inj
359 The second callback will parse commands written to the ``error-inj`` file::
365 are no embedded newlines) and it is 0-terminated. The callback is free to
371 Implementing the High-Level CEC Adapter
372 ---------------------------------------
374 The low-level operations drive the hardware, the high-level operations are
375 CEC protocol driven. The following high-level callbacks are available:
377 .. code-block:: none
380 /* Low-level callbacks */
386 /* High-level CEC message callback */
391 received CEC message::
395 If the driver wants to process a CEC message, then it can implement this
397 -ENOMSG, otherwise the CEC framework assumes it processed this message and
401 CEC framework functions
402 -----------------------
404 CEC Adapter drivers can call the following CEC framework functions:
410 Transmit a CEC message. If block is true, then wait until the message has been
416 Change the physical address. This function will set adap->phys_addr and
418 the physical address has become valid, then the CEC framework will start
422 When the physical address is set to a valid value the CEC adapter will
424 then the CEC adapter will be disabled. If you change a valid physical address
440 Claim the CEC logical addresses. Should never be called if CEC_CAP_LOG_ADDRS
444 log_addrs->num_log_addrs set to 0. The block argument is ignored when
449 CEC Pin framework
450 -----------------
452 Most CEC hardware operates on full CEC messages where the software provides
453 the message and the hardware handles the low-level CEC protocol. But some
454 hardware only drives the CEC pin and software has to handle the low-level
455 CEC protocol. The CEC pin framework was created to handle such devices.
457 Note that due to the close-to-realtime requirements it can never be guaranteed
462 One advantage of this low-level implementation is that it can be used as
463 a cheap CEC analyser, especially if interrupts can be used to detect
464 CEC pin transitions from low to high or vice versa.
466 .. kernel-doc:: include/media/cec-pin.h
468 CEC Notifier framework
469 ----------------------
471 Most drm HDMI implementations have an integrated CEC implementation and no
472 notifier support is needed. But some have independent CEC implementations
474 completely separate chip that deals with the CEC pin. For those cases a
476 CEC driver about changes in the physical address.
478 .. kernel-doc:: include/media/cec-notifier.h