18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciCEC Pin Framework Error Injection
48c2ecf20Sopenharmony_ci=================================
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciThe CEC Pin Framework is a core CEC framework for CEC hardware that only
78c2ecf20Sopenharmony_cihas low-level support for the CEC bus. Most hardware today will have
88c2ecf20Sopenharmony_cihigh-level CEC support where the hardware deals with driving the CEC bus,
98c2ecf20Sopenharmony_cibut some older devices aren't that fancy. However, this framework also
108c2ecf20Sopenharmony_ciallows you to connect the CEC pin to a GPIO on e.g. a Raspberry Pi and
118c2ecf20Sopenharmony_ciyou have now made a CEC adapter.
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciWhat makes doing this so interesting is that since we have full control
148c2ecf20Sopenharmony_ciover the bus it is easy to support error injection. This is ideal to
158c2ecf20Sopenharmony_citest how well CEC adapters can handle error conditions.
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciCurrently only the cec-gpio driver (when the CEC line is directly
188c2ecf20Sopenharmony_ciconnected to a pull-up GPIO line) and the AllWinner A10/A20 drm driver
198c2ecf20Sopenharmony_cisupport this framework.
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciIf ``CONFIG_CEC_PIN_ERROR_INJ`` is enabled, then error injection is available
228c2ecf20Sopenharmony_cithrough debugfs. Specifically, in ``/sys/kernel/debug/cec/cecX/`` there is
238c2ecf20Sopenharmony_cinow an ``error-inj`` file.
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci.. note::
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci    The error injection commands are not a stable ABI and may change in the
288c2ecf20Sopenharmony_ci    future.
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciWith ``cat error-inj`` you can see both the possible commands and the current
318c2ecf20Sopenharmony_cierror injection status::
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci	$ cat /sys/kernel/debug/cec/cec0/error-inj
348c2ecf20Sopenharmony_ci	# Clear error injections:
358c2ecf20Sopenharmony_ci	#   clear          clear all rx and tx error injections
368c2ecf20Sopenharmony_ci	#   rx-clear       clear all rx error injections
378c2ecf20Sopenharmony_ci	#   tx-clear       clear all tx error injections
388c2ecf20Sopenharmony_ci	#   <op> clear     clear all rx and tx error injections for <op>
398c2ecf20Sopenharmony_ci	#   <op> rx-clear  clear all rx error injections for <op>
408c2ecf20Sopenharmony_ci	#   <op> tx-clear  clear all tx error injections for <op>
418c2ecf20Sopenharmony_ci	#
428c2ecf20Sopenharmony_ci	# RX error injection:
438c2ecf20Sopenharmony_ci	#   <op>[,<mode>] rx-nack              NACK the message instead of sending an ACK
448c2ecf20Sopenharmony_ci	#   <op>[,<mode>] rx-low-drive <bit>   force a low-drive condition at this bit position
458c2ecf20Sopenharmony_ci	#   <op>[,<mode>] rx-add-byte          add a spurious byte to the received CEC message
468c2ecf20Sopenharmony_ci	#   <op>[,<mode>] rx-remove-byte       remove the last byte from the received CEC message
478c2ecf20Sopenharmony_ci	#   <op>[,<mode>] rx-arb-lost <poll>   generate a POLL message to trigger an arbitration lost
488c2ecf20Sopenharmony_ci	#
498c2ecf20Sopenharmony_ci	# TX error injection settings:
508c2ecf20Sopenharmony_ci	#   tx-ignore-nack-until-eom           ignore early NACKs until EOM
518c2ecf20Sopenharmony_ci	#   tx-custom-low-usecs <usecs>        define the 'low' time for the custom pulse
528c2ecf20Sopenharmony_ci	#   tx-custom-high-usecs <usecs>       define the 'high' time for the custom pulse
538c2ecf20Sopenharmony_ci	#   tx-custom-pulse                    transmit the custom pulse once the bus is idle
548c2ecf20Sopenharmony_ci	#
558c2ecf20Sopenharmony_ci	# TX error injection:
568c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-no-eom            don't set the EOM bit
578c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-early-eom         set the EOM bit one byte too soon
588c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-add-bytes <num>   append <num> (1-255) spurious bytes to the message
598c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-remove-byte       drop the last byte from the message
608c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-short-bit <bit>   make this bit shorter than allowed
618c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-long-bit <bit>    make this bit longer than allowed
628c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-custom-bit <bit>  send the custom pulse instead of this bit
638c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-short-start       send a start pulse that's too short
648c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-long-start        send a start pulse that's too long
658c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-custom-start      send the custom pulse instead of the start pulse
668c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-last-bit <bit>    stop sending after this bit
678c2ecf20Sopenharmony_ci	#   <op>[,<mode>] tx-low-drive <bit>   force a low-drive condition at this bit position
688c2ecf20Sopenharmony_ci	#
698c2ecf20Sopenharmony_ci	# <op>       CEC message opcode (0-255) or 'any'
708c2ecf20Sopenharmony_ci	# <mode>     'once' (default), 'always', 'toggle' or 'off'
718c2ecf20Sopenharmony_ci	# <bit>      CEC message bit (0-159)
728c2ecf20Sopenharmony_ci	#            10 bits per 'byte': bits 0-7: data, bit 8: EOM, bit 9: ACK
738c2ecf20Sopenharmony_ci	# <poll>     CEC poll message used to test arbitration lost (0x00-0xff, default 0x0f)
748c2ecf20Sopenharmony_ci	# <usecs>    microseconds (0-10000000, default 1000)
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	clear
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciYou can write error injection commands to ``error-inj`` using
798c2ecf20Sopenharmony_ci``echo 'cmd' >error-inj`` or ``cat cmd.txt >error-inj``. The ``cat error-inj``
808c2ecf20Sopenharmony_cioutput contains the current error commands. You can save the output to a file
818c2ecf20Sopenharmony_ciand use it as an input to ``error-inj`` later.
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ciBasic Syntax
848c2ecf20Sopenharmony_ci------------
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ciLeading spaces/tabs are ignored. If the next character is a ``#`` or the end
878c2ecf20Sopenharmony_ciof the line was reached, then the whole line is ignored. Otherwise a command
888c2ecf20Sopenharmony_ciis expected.
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ciThe error injection commands fall in two main groups: those relating to
918c2ecf20Sopenharmony_cireceiving CEC messages and those relating to transmitting CEC messages. In
928c2ecf20Sopenharmony_ciaddition, there are commands to clear existing error injection commands and
938c2ecf20Sopenharmony_cito create custom pulses on the CEC bus.
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ciMost error injection commands can be executed for specific CEC opcodes or for
968c2ecf20Sopenharmony_ciall opcodes (``any``). Each command also has a 'mode' which can be ``off``
978c2ecf20Sopenharmony_ci(can be used to turn off an existing error injection command), ``once``
988c2ecf20Sopenharmony_ci(the default) which will trigger the error injection only once for the next
998c2ecf20Sopenharmony_cireceived or transmitted message, ``always`` to always trigger the error
1008c2ecf20Sopenharmony_ciinjection and ``toggle`` to toggle the error injection on or off for every
1018c2ecf20Sopenharmony_citransmit or receive.
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ciSo '``any rx-nack``' will NACK the next received CEC message,
1048c2ecf20Sopenharmony_ci'``any,always rx-nack``' will NACK all received CEC messages and
1058c2ecf20Sopenharmony_ci'``0x82,toggle rx-nack``' will only NACK if an Active Source message was
1068c2ecf20Sopenharmony_cireceived and do that only for every other received message.
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ciAfter an error was injected with mode ``once`` the error injection command
1098c2ecf20Sopenharmony_ciis cleared automatically, so ``once`` is a one-time deal.
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ciAll combinations of ``<op>`` and error injection commands can co-exist. So
1128c2ecf20Sopenharmony_cithis is fine::
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci	0x9e tx-add-bytes 1
1158c2ecf20Sopenharmony_ci	0x9e tx-early-eom
1168c2ecf20Sopenharmony_ci	0x9f tx-add-bytes 2
1178c2ecf20Sopenharmony_ci	any rx-nack
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ciAll four error injection commands will be active simultaneously.
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ciHowever, if the same ``<op>`` and command combination is specified,
1228c2ecf20Sopenharmony_cibut with different arguments::
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci	0x9e tx-add-bytes 1
1258c2ecf20Sopenharmony_ci	0x9e tx-add-bytes 2
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ciThen the second will overwrite the first.
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ciClear Error Injections
1308c2ecf20Sopenharmony_ci----------------------
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci``clear``
1338c2ecf20Sopenharmony_ci    Clear all error injections.
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci``rx-clear``
1368c2ecf20Sopenharmony_ci    Clear all receive error injections
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci``tx-clear``
1398c2ecf20Sopenharmony_ci    Clear all transmit error injections
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci``<op> clear``
1428c2ecf20Sopenharmony_ci    Clear all error injections for the given opcode.
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci``<op> rx-clear``
1458c2ecf20Sopenharmony_ci    Clear all receive error injections for the given opcode.
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci``<op> tx-clear``
1488c2ecf20Sopenharmony_ci    Clear all transmit error injections for the given opcode.
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ciReceive Messages
1518c2ecf20Sopenharmony_ci----------------
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci``<op>[,<mode>] rx-nack``
1548c2ecf20Sopenharmony_ci    NACK broadcast messages and messages directed to this CEC adapter.
1558c2ecf20Sopenharmony_ci    Every byte of the message will be NACKed in case the transmitter
1568c2ecf20Sopenharmony_ci    keeps transmitting after the first byte was NACKed.
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci``<op>[,<mode>] rx-low-drive <bit>``
1598c2ecf20Sopenharmony_ci    Force a Low Drive condition at this bit position. If <op> specifies
1608c2ecf20Sopenharmony_ci    a specific CEC opcode then the bit position must be at least 18,
1618c2ecf20Sopenharmony_ci    otherwise the opcode hasn't been received yet. This tests if the
1628c2ecf20Sopenharmony_ci    transmitter can handle the Low Drive condition correctly and reports
1638c2ecf20Sopenharmony_ci    the error correctly. Note that a Low Drive in the first 4 bits can also
1648c2ecf20Sopenharmony_ci    be interpreted as an Arbitration Lost condition by the transmitter.
1658c2ecf20Sopenharmony_ci    This is implementation dependent.
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci``<op>[,<mode>] rx-add-byte``
1688c2ecf20Sopenharmony_ci    Add a spurious 0x55 byte to the received CEC message, provided
1698c2ecf20Sopenharmony_ci    the message was 15 bytes long or less. This is useful to test
1708c2ecf20Sopenharmony_ci    the high-level protocol since spurious bytes should be ignored.
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci``<op>[,<mode>] rx-remove-byte``
1738c2ecf20Sopenharmony_ci    Remove the last byte from the received CEC message, provided it
1748c2ecf20Sopenharmony_ci    was at least 2 bytes long. This is useful to test the high-level
1758c2ecf20Sopenharmony_ci    protocol since messages that are too short should be ignored.
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci``<op>[,<mode>] rx-arb-lost <poll>``
1788c2ecf20Sopenharmony_ci    Generate a POLL message to trigger an Arbitration Lost condition.
1798c2ecf20Sopenharmony_ci    This command is only allowed for ``<op>`` values of ``next`` or ``all``.
1808c2ecf20Sopenharmony_ci    As soon as a start bit has been received the CEC adapter will switch
1818c2ecf20Sopenharmony_ci    to transmit mode and it will transmit a POLL message. By default this is
1828c2ecf20Sopenharmony_ci    0x0f, but it can also be specified explicitly via the ``<poll>`` argument.
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci    This command can be used to test the Arbitration Lost condition in
1858c2ecf20Sopenharmony_ci    the remote CEC transmitter. Arbitration happens when two CEC adapters
1868c2ecf20Sopenharmony_ci    start sending a message at the same time. In that case the initiator
1878c2ecf20Sopenharmony_ci    with the most leading zeroes wins and the other transmitter has to
1888c2ecf20Sopenharmony_ci    stop transmitting ('Arbitration Lost'). This is very hard to test,
1898c2ecf20Sopenharmony_ci    except by using this error injection command.
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci    This does not work if the remote CEC transmitter has logical address
1928c2ecf20Sopenharmony_ci    0 ('TV') since that will always win.
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ciTransmit Messages
1958c2ecf20Sopenharmony_ci-----------------
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci``tx-ignore-nack-until-eom``
1988c2ecf20Sopenharmony_ci    This setting changes the behavior of transmitting CEC messages. Normally
1998c2ecf20Sopenharmony_ci    as soon as the receiver NACKs a byte the transmit will stop, but the
2008c2ecf20Sopenharmony_ci    specification also allows that the full message is transmitted and only
2018c2ecf20Sopenharmony_ci    at the end will the transmitter look at the ACK bit. This is not
2028c2ecf20Sopenharmony_ci    recommended behavior since there is no point in keeping the CEC bus busy
2038c2ecf20Sopenharmony_ci    for longer than is strictly needed. Especially given how slow the bus is.
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci    This setting can be used to test how well a receiver deals with
2068c2ecf20Sopenharmony_ci    transmitters that ignore NACKs until the very end of the message.
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-no-eom``
2098c2ecf20Sopenharmony_ci    Don't set the EOM bit. Normally the last byte of the message has the EOM
2108c2ecf20Sopenharmony_ci    (End-Of-Message) bit set. With this command the transmit will just stop
2118c2ecf20Sopenharmony_ci    without ever sending an EOM. This can be used to test how a receiver
2128c2ecf20Sopenharmony_ci    handles this case. Normally receivers have a time-out after which
2138c2ecf20Sopenharmony_ci    they will go back to the Idle state.
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-early-eom``
2168c2ecf20Sopenharmony_ci    Set the EOM bit one byte too soon. This obviously only works for messages
2178c2ecf20Sopenharmony_ci    of two bytes or more. The EOM bit will be set for the second-to-last byte
2188c2ecf20Sopenharmony_ci    and not for the final byte. The receiver should ignore the last byte in
2198c2ecf20Sopenharmony_ci    this case. Since the resulting message is likely to be too short for this
2208c2ecf20Sopenharmony_ci    same reason the whole message is typically ignored. The receiver should be
2218c2ecf20Sopenharmony_ci    in Idle state after the last byte was transmitted.
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-add-bytes <num>``
2248c2ecf20Sopenharmony_ci    Append ``<num>`` (1-255) spurious bytes to the message. The extra bytes
2258c2ecf20Sopenharmony_ci    have the value of the byte position in the message. So if you transmit a
2268c2ecf20Sopenharmony_ci    two byte message (e.g. a Get CEC Version message) and add 2 bytes, then
2278c2ecf20Sopenharmony_ci    the full message received by the remote CEC adapter is
2288c2ecf20Sopenharmony_ci    ``0x40 0x9f 0x02 0x03``.
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_ci    This command can be used to test buffer overflows in the receiver. E.g.
2318c2ecf20Sopenharmony_ci    what does it do when it receives more than the maximum message size of 16
2328c2ecf20Sopenharmony_ci    bytes.
2338c2ecf20Sopenharmony_ci
2348c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-remove-byte``
2358c2ecf20Sopenharmony_ci    Drop the last byte from the message, provided the message is at least
2368c2ecf20Sopenharmony_ci    two bytes long. The receiver should ignore messages that are too short.
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-short-bit <bit>``
2398c2ecf20Sopenharmony_ci    Make this bit period shorter than allowed. The bit position cannot be
2408c2ecf20Sopenharmony_ci    an Ack bit.  If <op> specifies a specific CEC opcode then the bit position
2418c2ecf20Sopenharmony_ci    must be at least 18, otherwise the opcode hasn't been received yet.
2428c2ecf20Sopenharmony_ci    Normally the period of a data bit is between 2.05 and 2.75 milliseconds.
2438c2ecf20Sopenharmony_ci    With this command the period of this bit is 1.8 milliseconds, this is
2448c2ecf20Sopenharmony_ci    done by reducing the time the CEC bus is high. This bit period is less
2458c2ecf20Sopenharmony_ci    than is allowed and the receiver should respond with a Low Drive
2468c2ecf20Sopenharmony_ci    condition.
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci    This command is ignored for 0 bits in bit positions 0 to 3. This is
2498c2ecf20Sopenharmony_ci    because the receiver also looks for an Arbitration Lost condition in
2508c2ecf20Sopenharmony_ci    those first four bits and it is undefined what will happen if it
2518c2ecf20Sopenharmony_ci    sees a too-short 0 bit.
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-long-bit <bit>``
2548c2ecf20Sopenharmony_ci    Make this bit period longer than is valid. The bit position cannot be
2558c2ecf20Sopenharmony_ci    an Ack bit.  If <op> specifies a specific CEC opcode then the bit position
2568c2ecf20Sopenharmony_ci    must be at least 18, otherwise the opcode hasn't been received yet.
2578c2ecf20Sopenharmony_ci    Normally the period of a data bit is between 2.05 and 2.75 milliseconds.
2588c2ecf20Sopenharmony_ci    With this command the period of this bit is 2.9 milliseconds, this is
2598c2ecf20Sopenharmony_ci    done by increasing the time the CEC bus is high.
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ci    Even though this bit period is longer than is valid it is undefined what
2628c2ecf20Sopenharmony_ci    a receiver will do. It might just accept it, or it might time out and
2638c2ecf20Sopenharmony_ci    return to Idle state. Unfortunately the CEC specification is silent about
2648c2ecf20Sopenharmony_ci    this.
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci    This command is ignored for 0 bits in bit positions 0 to 3. This is
2678c2ecf20Sopenharmony_ci    because the receiver also looks for an Arbitration Lost condition in
2688c2ecf20Sopenharmony_ci    those first four bits and it is undefined what will happen if it
2698c2ecf20Sopenharmony_ci    sees a too-long 0 bit.
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-short-start``
2728c2ecf20Sopenharmony_ci    Make this start bit period shorter than allowed. Normally the period of
2738c2ecf20Sopenharmony_ci    a start bit is between 4.3 and 4.7 milliseconds. With this command the
2748c2ecf20Sopenharmony_ci    period of the start bit is 4.1 milliseconds, this is done by reducing
2758c2ecf20Sopenharmony_ci    the time the CEC bus is high. This start bit period is less than is
2768c2ecf20Sopenharmony_ci    allowed and the receiver should return to Idle state when this is detected.
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-long-start``
2798c2ecf20Sopenharmony_ci    Make this start bit period longer than is valid. Normally the period of
2808c2ecf20Sopenharmony_ci    a start bit is between 4.3 and 4.7 milliseconds. With this command the
2818c2ecf20Sopenharmony_ci    period of the start bit is 5 milliseconds, this is done by increasing
2828c2ecf20Sopenharmony_ci    the time the CEC bus is high. This start bit period is more than is
2838c2ecf20Sopenharmony_ci    valid and the receiver should return to Idle state when this is detected.
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci    Even though this start bit period is longer than is valid it is undefined
2868c2ecf20Sopenharmony_ci    what a receiver will do. It might just accept it, or it might time out and
2878c2ecf20Sopenharmony_ci    return to Idle state. Unfortunately the CEC specification is silent about
2888c2ecf20Sopenharmony_ci    this.
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-last-bit <bit>``
2918c2ecf20Sopenharmony_ci    Just stop transmitting after this bit.  If <op> specifies a specific CEC
2928c2ecf20Sopenharmony_ci    opcode then the bit position must be at least 18, otherwise the opcode
2938c2ecf20Sopenharmony_ci    hasn't been received yet. This command can be used to test how the receiver
2948c2ecf20Sopenharmony_ci    reacts when a message just suddenly stops. It should time out and go back
2958c2ecf20Sopenharmony_ci    to Idle state.
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-low-drive <bit>``
2988c2ecf20Sopenharmony_ci    Force a Low Drive condition at this bit position. If <op> specifies a
2998c2ecf20Sopenharmony_ci    specific CEC opcode then the bit position must be at least 18, otherwise
3008c2ecf20Sopenharmony_ci    the opcode hasn't been received yet. This can be used to test how the
3018c2ecf20Sopenharmony_ci    receiver handles Low Drive conditions. Note that if this happens at bit
3028c2ecf20Sopenharmony_ci    positions 0-3 the receiver can interpret this as an Arbitration Lost
3038c2ecf20Sopenharmony_ci    condition. This is implementation dependent.
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ciCustom Pulses
3068c2ecf20Sopenharmony_ci-------------
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci``tx-custom-low-usecs <usecs>``
3098c2ecf20Sopenharmony_ci    This defines the duration in microseconds that the custom pulse pulls
3108c2ecf20Sopenharmony_ci    the CEC line low. The default is 1000 microseconds.
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci``tx-custom-high-usecs <usecs>``
3138c2ecf20Sopenharmony_ci    This defines the duration in microseconds that the custom pulse keeps the
3148c2ecf20Sopenharmony_ci    CEC line high (unless another CEC adapter pulls it low in that time).
3158c2ecf20Sopenharmony_ci    The default is 1000 microseconds. The total period of the custom pulse is
3168c2ecf20Sopenharmony_ci    ``tx-custom-low-usecs + tx-custom-high-usecs``.
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-custom-bit <bit>``
3198c2ecf20Sopenharmony_ci    Send the custom bit instead of a regular data bit. The bit position cannot
3208c2ecf20Sopenharmony_ci    be an Ack bit.  If <op> specifies a specific CEC opcode then the bit
3218c2ecf20Sopenharmony_ci    position must be at least 18, otherwise the opcode hasn't been received yet.
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci``<op>[,<mode>] tx-custom-start``
3248c2ecf20Sopenharmony_ci    Send the custom bit instead of a regular start bit.
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci``tx-custom-pulse``
3278c2ecf20Sopenharmony_ci    Transmit a single custom pulse as soon as the CEC bus is idle.
328