xref: /openbmc/linux/Documentation/userspace-api/media/cec/cec-pin-error-inj.rst (revision 92eda6b7dad6372cd35f13560cad980cf2f6485a)
1059b1c5bSMauro Carvalho Chehab.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
254f38fcaSMauro Carvalho Chehab
354f38fcaSMauro Carvalho ChehabCEC Pin Framework Error Injection
454f38fcaSMauro Carvalho Chehab=================================
554f38fcaSMauro Carvalho Chehab
654f38fcaSMauro Carvalho ChehabThe CEC Pin Framework is a core CEC framework for CEC hardware that only
754f38fcaSMauro Carvalho Chehabhas low-level support for the CEC bus. Most hardware today will have
854f38fcaSMauro Carvalho Chehabhigh-level CEC support where the hardware deals with driving the CEC bus,
954f38fcaSMauro Carvalho Chehabbut some older devices aren't that fancy. However, this framework also
1054f38fcaSMauro Carvalho Chehaballows you to connect the CEC pin to a GPIO on e.g. a Raspberry Pi and
1154f38fcaSMauro Carvalho Chehabyou have now made a CEC adapter.
1254f38fcaSMauro Carvalho Chehab
1354f38fcaSMauro Carvalho ChehabWhat makes doing this so interesting is that since we have full control
1454f38fcaSMauro Carvalho Chehabover the bus it is easy to support error injection. This is ideal to
1554f38fcaSMauro Carvalho Chehabtest how well CEC adapters can handle error conditions.
1654f38fcaSMauro Carvalho Chehab
1754f38fcaSMauro Carvalho ChehabCurrently only the cec-gpio driver (when the CEC line is directly
1854f38fcaSMauro Carvalho Chehabconnected to a pull-up GPIO line) and the AllWinner A10/A20 drm driver
1954f38fcaSMauro Carvalho Chehabsupport this framework.
2054f38fcaSMauro Carvalho Chehab
2154f38fcaSMauro Carvalho ChehabIf ``CONFIG_CEC_PIN_ERROR_INJ`` is enabled, then error injection is available
2254f38fcaSMauro Carvalho Chehabthrough debugfs. Specifically, in ``/sys/kernel/debug/cec/cecX/`` there is
2354f38fcaSMauro Carvalho Chehabnow an ``error-inj`` file.
2454f38fcaSMauro Carvalho Chehab
2554f38fcaSMauro Carvalho Chehab.. note::
2654f38fcaSMauro Carvalho Chehab
2754f38fcaSMauro Carvalho Chehab    The error injection commands are not a stable ABI and may change in the
2854f38fcaSMauro Carvalho Chehab    future.
2954f38fcaSMauro Carvalho Chehab
3054f38fcaSMauro Carvalho ChehabWith ``cat error-inj`` you can see both the possible commands and the current
3154f38fcaSMauro Carvalho Chehaberror injection status::
3254f38fcaSMauro Carvalho Chehab
3354f38fcaSMauro Carvalho Chehab	$ cat /sys/kernel/debug/cec/cec0/error-inj
3454f38fcaSMauro Carvalho Chehab	# Clear error injections:
3554f38fcaSMauro Carvalho Chehab	#   clear          clear all rx and tx error injections
3654f38fcaSMauro Carvalho Chehab	#   rx-clear       clear all rx error injections
3754f38fcaSMauro Carvalho Chehab	#   tx-clear       clear all tx error injections
3854f38fcaSMauro Carvalho Chehab	#   <op> clear     clear all rx and tx error injections for <op>
3954f38fcaSMauro Carvalho Chehab	#   <op> rx-clear  clear all rx error injections for <op>
4054f38fcaSMauro Carvalho Chehab	#   <op> tx-clear  clear all tx error injections for <op>
4154f38fcaSMauro Carvalho Chehab	#
4254f38fcaSMauro Carvalho Chehab	# RX error injection:
4354f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] rx-nack              NACK the message instead of sending an ACK
4454f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] rx-low-drive <bit>   force a low-drive condition at this bit position
4554f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] rx-add-byte          add a spurious byte to the received CEC message
4654f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] rx-remove-byte       remove the last byte from the received CEC message
47*92eda6b7SHans Verkuil	#    any[,<mode>] rx-arb-lost [<poll>] generate a POLL message to trigger an arbitration lost
4854f38fcaSMauro Carvalho Chehab	#
4954f38fcaSMauro Carvalho Chehab	# TX error injection settings:
5054f38fcaSMauro Carvalho Chehab	#   tx-ignore-nack-until-eom           ignore early NACKs until EOM
5154f38fcaSMauro Carvalho Chehab	#   tx-custom-low-usecs <usecs>        define the 'low' time for the custom pulse
5254f38fcaSMauro Carvalho Chehab	#   tx-custom-high-usecs <usecs>       define the 'high' time for the custom pulse
5354f38fcaSMauro Carvalho Chehab	#   tx-custom-pulse                    transmit the custom pulse once the bus is idle
5454f38fcaSMauro Carvalho Chehab	#
5554f38fcaSMauro Carvalho Chehab	# TX error injection:
5654f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-no-eom            don't set the EOM bit
5754f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-early-eom         set the EOM bit one byte too soon
5854f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-add-bytes <num>   append <num> (1-255) spurious bytes to the message
5954f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-remove-byte       drop the last byte from the message
6054f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-short-bit <bit>   make this bit shorter than allowed
6154f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-long-bit <bit>    make this bit longer than allowed
6254f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-custom-bit <bit>  send the custom pulse instead of this bit
6354f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-short-start       send a start pulse that's too short
6454f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-long-start        send a start pulse that's too long
6554f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-custom-start      send the custom pulse instead of the start pulse
6654f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-last-bit <bit>    stop sending after this bit
6754f38fcaSMauro Carvalho Chehab	#   <op>[,<mode>] tx-low-drive <bit>   force a low-drive condition at this bit position
6854f38fcaSMauro Carvalho Chehab	#
6954f38fcaSMauro Carvalho Chehab	# <op>       CEC message opcode (0-255) or 'any'
7054f38fcaSMauro Carvalho Chehab	# <mode>     'once' (default), 'always', 'toggle' or 'off'
7154f38fcaSMauro Carvalho Chehab	# <bit>      CEC message bit (0-159)
7254f38fcaSMauro Carvalho Chehab	#            10 bits per 'byte': bits 0-7: data, bit 8: EOM, bit 9: ACK
7354f38fcaSMauro Carvalho Chehab	# <poll>     CEC poll message used to test arbitration lost (0x00-0xff, default 0x0f)
7454f38fcaSMauro Carvalho Chehab	# <usecs>    microseconds (0-10000000, default 1000)
7554f38fcaSMauro Carvalho Chehab
7654f38fcaSMauro Carvalho Chehab	clear
7754f38fcaSMauro Carvalho Chehab
7854f38fcaSMauro Carvalho ChehabYou can write error injection commands to ``error-inj`` using
7954f38fcaSMauro Carvalho Chehab``echo 'cmd' >error-inj`` or ``cat cmd.txt >error-inj``. The ``cat error-inj``
8054f38fcaSMauro Carvalho Chehaboutput contains the current error commands. You can save the output to a file
8154f38fcaSMauro Carvalho Chehaband use it as an input to ``error-inj`` later.
8254f38fcaSMauro Carvalho Chehab
8354f38fcaSMauro Carvalho ChehabBasic Syntax
8454f38fcaSMauro Carvalho Chehab------------
8554f38fcaSMauro Carvalho Chehab
8654f38fcaSMauro Carvalho ChehabLeading spaces/tabs are ignored. If the next character is a ``#`` or the end
8754f38fcaSMauro Carvalho Chehabof the line was reached, then the whole line is ignored. Otherwise a command
8854f38fcaSMauro Carvalho Chehabis expected.
8954f38fcaSMauro Carvalho Chehab
9054f38fcaSMauro Carvalho ChehabThe error injection commands fall in two main groups: those relating to
9154f38fcaSMauro Carvalho Chehabreceiving CEC messages and those relating to transmitting CEC messages. In
9254f38fcaSMauro Carvalho Chehabaddition, there are commands to clear existing error injection commands and
9354f38fcaSMauro Carvalho Chehabto create custom pulses on the CEC bus.
9454f38fcaSMauro Carvalho Chehab
9554f38fcaSMauro Carvalho ChehabMost error injection commands can be executed for specific CEC opcodes or for
9654f38fcaSMauro Carvalho Chehaball opcodes (``any``). Each command also has a 'mode' which can be ``off``
9754f38fcaSMauro Carvalho Chehab(can be used to turn off an existing error injection command), ``once``
9854f38fcaSMauro Carvalho Chehab(the default) which will trigger the error injection only once for the next
9954f38fcaSMauro Carvalho Chehabreceived or transmitted message, ``always`` to always trigger the error
10054f38fcaSMauro Carvalho Chehabinjection and ``toggle`` to toggle the error injection on or off for every
10154f38fcaSMauro Carvalho Chehabtransmit or receive.
10254f38fcaSMauro Carvalho Chehab
10354f38fcaSMauro Carvalho ChehabSo '``any rx-nack``' will NACK the next received CEC message,
10454f38fcaSMauro Carvalho Chehab'``any,always rx-nack``' will NACK all received CEC messages and
10554f38fcaSMauro Carvalho Chehab'``0x82,toggle rx-nack``' will only NACK if an Active Source message was
10654f38fcaSMauro Carvalho Chehabreceived and do that only for every other received message.
10754f38fcaSMauro Carvalho Chehab
10854f38fcaSMauro Carvalho ChehabAfter an error was injected with mode ``once`` the error injection command
10954f38fcaSMauro Carvalho Chehabis cleared automatically, so ``once`` is a one-time deal.
11054f38fcaSMauro Carvalho Chehab
11154f38fcaSMauro Carvalho ChehabAll combinations of ``<op>`` and error injection commands can co-exist. So
11254f38fcaSMauro Carvalho Chehabthis is fine::
11354f38fcaSMauro Carvalho Chehab
11454f38fcaSMauro Carvalho Chehab	0x9e tx-add-bytes 1
11554f38fcaSMauro Carvalho Chehab	0x9e tx-early-eom
11654f38fcaSMauro Carvalho Chehab	0x9f tx-add-bytes 2
11754f38fcaSMauro Carvalho Chehab	any rx-nack
11854f38fcaSMauro Carvalho Chehab
11954f38fcaSMauro Carvalho ChehabAll four error injection commands will be active simultaneously.
12054f38fcaSMauro Carvalho Chehab
12154f38fcaSMauro Carvalho ChehabHowever, if the same ``<op>`` and command combination is specified,
12254f38fcaSMauro Carvalho Chehabbut with different arguments::
12354f38fcaSMauro Carvalho Chehab
12454f38fcaSMauro Carvalho Chehab	0x9e tx-add-bytes 1
12554f38fcaSMauro Carvalho Chehab	0x9e tx-add-bytes 2
12654f38fcaSMauro Carvalho Chehab
12754f38fcaSMauro Carvalho ChehabThen the second will overwrite the first.
12854f38fcaSMauro Carvalho Chehab
12954f38fcaSMauro Carvalho ChehabClear Error Injections
13054f38fcaSMauro Carvalho Chehab----------------------
13154f38fcaSMauro Carvalho Chehab
13254f38fcaSMauro Carvalho Chehab``clear``
13354f38fcaSMauro Carvalho Chehab    Clear all error injections.
13454f38fcaSMauro Carvalho Chehab
13554f38fcaSMauro Carvalho Chehab``rx-clear``
13654f38fcaSMauro Carvalho Chehab    Clear all receive error injections
13754f38fcaSMauro Carvalho Chehab
13854f38fcaSMauro Carvalho Chehab``tx-clear``
13954f38fcaSMauro Carvalho Chehab    Clear all transmit error injections
14054f38fcaSMauro Carvalho Chehab
14154f38fcaSMauro Carvalho Chehab``<op> clear``
14254f38fcaSMauro Carvalho Chehab    Clear all error injections for the given opcode.
14354f38fcaSMauro Carvalho Chehab
14454f38fcaSMauro Carvalho Chehab``<op> rx-clear``
14554f38fcaSMauro Carvalho Chehab    Clear all receive error injections for the given opcode.
14654f38fcaSMauro Carvalho Chehab
14754f38fcaSMauro Carvalho Chehab``<op> tx-clear``
14854f38fcaSMauro Carvalho Chehab    Clear all transmit error injections for the given opcode.
14954f38fcaSMauro Carvalho Chehab
15054f38fcaSMauro Carvalho ChehabReceive Messages
15154f38fcaSMauro Carvalho Chehab----------------
15254f38fcaSMauro Carvalho Chehab
15354f38fcaSMauro Carvalho Chehab``<op>[,<mode>] rx-nack``
15454f38fcaSMauro Carvalho Chehab    NACK broadcast messages and messages directed to this CEC adapter.
15554f38fcaSMauro Carvalho Chehab    Every byte of the message will be NACKed in case the transmitter
15654f38fcaSMauro Carvalho Chehab    keeps transmitting after the first byte was NACKed.
15754f38fcaSMauro Carvalho Chehab
15854f38fcaSMauro Carvalho Chehab``<op>[,<mode>] rx-low-drive <bit>``
15954f38fcaSMauro Carvalho Chehab    Force a Low Drive condition at this bit position. If <op> specifies
16054f38fcaSMauro Carvalho Chehab    a specific CEC opcode then the bit position must be at least 18,
16154f38fcaSMauro Carvalho Chehab    otherwise the opcode hasn't been received yet. This tests if the
16254f38fcaSMauro Carvalho Chehab    transmitter can handle the Low Drive condition correctly and reports
16354f38fcaSMauro Carvalho Chehab    the error correctly. Note that a Low Drive in the first 4 bits can also
16454f38fcaSMauro Carvalho Chehab    be interpreted as an Arbitration Lost condition by the transmitter.
16554f38fcaSMauro Carvalho Chehab    This is implementation dependent.
16654f38fcaSMauro Carvalho Chehab
16754f38fcaSMauro Carvalho Chehab``<op>[,<mode>] rx-add-byte``
16854f38fcaSMauro Carvalho Chehab    Add a spurious 0x55 byte to the received CEC message, provided
16954f38fcaSMauro Carvalho Chehab    the message was 15 bytes long or less. This is useful to test
17054f38fcaSMauro Carvalho Chehab    the high-level protocol since spurious bytes should be ignored.
17154f38fcaSMauro Carvalho Chehab
17254f38fcaSMauro Carvalho Chehab``<op>[,<mode>] rx-remove-byte``
17354f38fcaSMauro Carvalho Chehab    Remove the last byte from the received CEC message, provided it
17454f38fcaSMauro Carvalho Chehab    was at least 2 bytes long. This is useful to test the high-level
17554f38fcaSMauro Carvalho Chehab    protocol since messages that are too short should be ignored.
17654f38fcaSMauro Carvalho Chehab
17754f38fcaSMauro Carvalho Chehab``<op>[,<mode>] rx-arb-lost <poll>``
17854f38fcaSMauro Carvalho Chehab    Generate a POLL message to trigger an Arbitration Lost condition.
17954f38fcaSMauro Carvalho Chehab    This command is only allowed for ``<op>`` values of ``next`` or ``all``.
18054f38fcaSMauro Carvalho Chehab    As soon as a start bit has been received the CEC adapter will switch
18154f38fcaSMauro Carvalho Chehab    to transmit mode and it will transmit a POLL message. By default this is
18254f38fcaSMauro Carvalho Chehab    0x0f, but it can also be specified explicitly via the ``<poll>`` argument.
18354f38fcaSMauro Carvalho Chehab
18454f38fcaSMauro Carvalho Chehab    This command can be used to test the Arbitration Lost condition in
18554f38fcaSMauro Carvalho Chehab    the remote CEC transmitter. Arbitration happens when two CEC adapters
18654f38fcaSMauro Carvalho Chehab    start sending a message at the same time. In that case the initiator
18754f38fcaSMauro Carvalho Chehab    with the most leading zeroes wins and the other transmitter has to
18854f38fcaSMauro Carvalho Chehab    stop transmitting ('Arbitration Lost'). This is very hard to test,
18954f38fcaSMauro Carvalho Chehab    except by using this error injection command.
19054f38fcaSMauro Carvalho Chehab
19154f38fcaSMauro Carvalho Chehab    This does not work if the remote CEC transmitter has logical address
19254f38fcaSMauro Carvalho Chehab    0 ('TV') since that will always win.
19354f38fcaSMauro Carvalho Chehab
19454f38fcaSMauro Carvalho ChehabTransmit Messages
19554f38fcaSMauro Carvalho Chehab-----------------
19654f38fcaSMauro Carvalho Chehab
19754f38fcaSMauro Carvalho Chehab``tx-ignore-nack-until-eom``
19854f38fcaSMauro Carvalho Chehab    This setting changes the behavior of transmitting CEC messages. Normally
19954f38fcaSMauro Carvalho Chehab    as soon as the receiver NACKs a byte the transmit will stop, but the
20054f38fcaSMauro Carvalho Chehab    specification also allows that the full message is transmitted and only
20154f38fcaSMauro Carvalho Chehab    at the end will the transmitter look at the ACK bit. This is not
20254f38fcaSMauro Carvalho Chehab    recommended behavior since there is no point in keeping the CEC bus busy
20354f38fcaSMauro Carvalho Chehab    for longer than is strictly needed. Especially given how slow the bus is.
20454f38fcaSMauro Carvalho Chehab
20554f38fcaSMauro Carvalho Chehab    This setting can be used to test how well a receiver deals with
20654f38fcaSMauro Carvalho Chehab    transmitters that ignore NACKs until the very end of the message.
20754f38fcaSMauro Carvalho Chehab
20854f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-no-eom``
20954f38fcaSMauro Carvalho Chehab    Don't set the EOM bit. Normally the last byte of the message has the EOM
21054f38fcaSMauro Carvalho Chehab    (End-Of-Message) bit set. With this command the transmit will just stop
21154f38fcaSMauro Carvalho Chehab    without ever sending an EOM. This can be used to test how a receiver
21254f38fcaSMauro Carvalho Chehab    handles this case. Normally receivers have a time-out after which
21354f38fcaSMauro Carvalho Chehab    they will go back to the Idle state.
21454f38fcaSMauro Carvalho Chehab
21554f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-early-eom``
21654f38fcaSMauro Carvalho Chehab    Set the EOM bit one byte too soon. This obviously only works for messages
21754f38fcaSMauro Carvalho Chehab    of two bytes or more. The EOM bit will be set for the second-to-last byte
21854f38fcaSMauro Carvalho Chehab    and not for the final byte. The receiver should ignore the last byte in
21954f38fcaSMauro Carvalho Chehab    this case. Since the resulting message is likely to be too short for this
22054f38fcaSMauro Carvalho Chehab    same reason the whole message is typically ignored. The receiver should be
22154f38fcaSMauro Carvalho Chehab    in Idle state after the last byte was transmitted.
22254f38fcaSMauro Carvalho Chehab
22354f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-add-bytes <num>``
22454f38fcaSMauro Carvalho Chehab    Append ``<num>`` (1-255) spurious bytes to the message. The extra bytes
22554f38fcaSMauro Carvalho Chehab    have the value of the byte position in the message. So if you transmit a
22654f38fcaSMauro Carvalho Chehab    two byte message (e.g. a Get CEC Version message) and add 2 bytes, then
22754f38fcaSMauro Carvalho Chehab    the full message received by the remote CEC adapter is
22854f38fcaSMauro Carvalho Chehab    ``0x40 0x9f 0x02 0x03``.
22954f38fcaSMauro Carvalho Chehab
23054f38fcaSMauro Carvalho Chehab    This command can be used to test buffer overflows in the receiver. E.g.
23154f38fcaSMauro Carvalho Chehab    what does it do when it receives more than the maximum message size of 16
23254f38fcaSMauro Carvalho Chehab    bytes.
23354f38fcaSMauro Carvalho Chehab
23454f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-remove-byte``
23554f38fcaSMauro Carvalho Chehab    Drop the last byte from the message, provided the message is at least
23654f38fcaSMauro Carvalho Chehab    two bytes long. The receiver should ignore messages that are too short.
23754f38fcaSMauro Carvalho Chehab
23854f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-short-bit <bit>``
23954f38fcaSMauro Carvalho Chehab    Make this bit period shorter than allowed. The bit position cannot be
24054f38fcaSMauro Carvalho Chehab    an Ack bit.  If <op> specifies a specific CEC opcode then the bit position
24154f38fcaSMauro Carvalho Chehab    must be at least 18, otherwise the opcode hasn't been received yet.
24254f38fcaSMauro Carvalho Chehab    Normally the period of a data bit is between 2.05 and 2.75 milliseconds.
24354f38fcaSMauro Carvalho Chehab    With this command the period of this bit is 1.8 milliseconds, this is
24454f38fcaSMauro Carvalho Chehab    done by reducing the time the CEC bus is high. This bit period is less
24554f38fcaSMauro Carvalho Chehab    than is allowed and the receiver should respond with a Low Drive
24654f38fcaSMauro Carvalho Chehab    condition.
24754f38fcaSMauro Carvalho Chehab
24854f38fcaSMauro Carvalho Chehab    This command is ignored for 0 bits in bit positions 0 to 3. This is
24954f38fcaSMauro Carvalho Chehab    because the receiver also looks for an Arbitration Lost condition in
25054f38fcaSMauro Carvalho Chehab    those first four bits and it is undefined what will happen if it
25154f38fcaSMauro Carvalho Chehab    sees a too-short 0 bit.
25254f38fcaSMauro Carvalho Chehab
25354f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-long-bit <bit>``
25454f38fcaSMauro Carvalho Chehab    Make this bit period longer than is valid. The bit position cannot be
25554f38fcaSMauro Carvalho Chehab    an Ack bit.  If <op> specifies a specific CEC opcode then the bit position
25654f38fcaSMauro Carvalho Chehab    must be at least 18, otherwise the opcode hasn't been received yet.
25754f38fcaSMauro Carvalho Chehab    Normally the period of a data bit is between 2.05 and 2.75 milliseconds.
25854f38fcaSMauro Carvalho Chehab    With this command the period of this bit is 2.9 milliseconds, this is
25954f38fcaSMauro Carvalho Chehab    done by increasing the time the CEC bus is high.
26054f38fcaSMauro Carvalho Chehab
26154f38fcaSMauro Carvalho Chehab    Even though this bit period is longer than is valid it is undefined what
26254f38fcaSMauro Carvalho Chehab    a receiver will do. It might just accept it, or it might time out and
26354f38fcaSMauro Carvalho Chehab    return to Idle state. Unfortunately the CEC specification is silent about
26454f38fcaSMauro Carvalho Chehab    this.
26554f38fcaSMauro Carvalho Chehab
26654f38fcaSMauro Carvalho Chehab    This command is ignored for 0 bits in bit positions 0 to 3. This is
26754f38fcaSMauro Carvalho Chehab    because the receiver also looks for an Arbitration Lost condition in
26854f38fcaSMauro Carvalho Chehab    those first four bits and it is undefined what will happen if it
26954f38fcaSMauro Carvalho Chehab    sees a too-long 0 bit.
27054f38fcaSMauro Carvalho Chehab
27154f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-short-start``
27254f38fcaSMauro Carvalho Chehab    Make this start bit period shorter than allowed. Normally the period of
27354f38fcaSMauro Carvalho Chehab    a start bit is between 4.3 and 4.7 milliseconds. With this command the
27454f38fcaSMauro Carvalho Chehab    period of the start bit is 4.1 milliseconds, this is done by reducing
27554f38fcaSMauro Carvalho Chehab    the time the CEC bus is high. This start bit period is less than is
27654f38fcaSMauro Carvalho Chehab    allowed and the receiver should return to Idle state when this is detected.
27754f38fcaSMauro Carvalho Chehab
27854f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-long-start``
27954f38fcaSMauro Carvalho Chehab    Make this start bit period longer than is valid. Normally the period of
28054f38fcaSMauro Carvalho Chehab    a start bit is between 4.3 and 4.7 milliseconds. With this command the
28154f38fcaSMauro Carvalho Chehab    period of the start bit is 5 milliseconds, this is done by increasing
28254f38fcaSMauro Carvalho Chehab    the time the CEC bus is high. This start bit period is more than is
28354f38fcaSMauro Carvalho Chehab    valid and the receiver should return to Idle state when this is detected.
28454f38fcaSMauro Carvalho Chehab
28554f38fcaSMauro Carvalho Chehab    Even though this start bit period is longer than is valid it is undefined
28654f38fcaSMauro Carvalho Chehab    what a receiver will do. It might just accept it, or it might time out and
28754f38fcaSMauro Carvalho Chehab    return to Idle state. Unfortunately the CEC specification is silent about
28854f38fcaSMauro Carvalho Chehab    this.
28954f38fcaSMauro Carvalho Chehab
29054f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-last-bit <bit>``
29154f38fcaSMauro Carvalho Chehab    Just stop transmitting after this bit.  If <op> specifies a specific CEC
29254f38fcaSMauro Carvalho Chehab    opcode then the bit position must be at least 18, otherwise the opcode
29354f38fcaSMauro Carvalho Chehab    hasn't been received yet. This command can be used to test how the receiver
29454f38fcaSMauro Carvalho Chehab    reacts when a message just suddenly stops. It should time out and go back
29554f38fcaSMauro Carvalho Chehab    to Idle state.
29654f38fcaSMauro Carvalho Chehab
29754f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-low-drive <bit>``
29854f38fcaSMauro Carvalho Chehab    Force a Low Drive condition at this bit position. If <op> specifies a
29954f38fcaSMauro Carvalho Chehab    specific CEC opcode then the bit position must be at least 18, otherwise
30054f38fcaSMauro Carvalho Chehab    the opcode hasn't been received yet. This can be used to test how the
30154f38fcaSMauro Carvalho Chehab    receiver handles Low Drive conditions. Note that if this happens at bit
30254f38fcaSMauro Carvalho Chehab    positions 0-3 the receiver can interpret this as an Arbitration Lost
30354f38fcaSMauro Carvalho Chehab    condition. This is implementation dependent.
30454f38fcaSMauro Carvalho Chehab
30554f38fcaSMauro Carvalho ChehabCustom Pulses
30654f38fcaSMauro Carvalho Chehab-------------
30754f38fcaSMauro Carvalho Chehab
30854f38fcaSMauro Carvalho Chehab``tx-custom-low-usecs <usecs>``
30954f38fcaSMauro Carvalho Chehab    This defines the duration in microseconds that the custom pulse pulls
31054f38fcaSMauro Carvalho Chehab    the CEC line low. The default is 1000 microseconds.
31154f38fcaSMauro Carvalho Chehab
31254f38fcaSMauro Carvalho Chehab``tx-custom-high-usecs <usecs>``
31354f38fcaSMauro Carvalho Chehab    This defines the duration in microseconds that the custom pulse keeps the
31454f38fcaSMauro Carvalho Chehab    CEC line high (unless another CEC adapter pulls it low in that time).
31554f38fcaSMauro Carvalho Chehab    The default is 1000 microseconds. The total period of the custom pulse is
31654f38fcaSMauro Carvalho Chehab    ``tx-custom-low-usecs + tx-custom-high-usecs``.
31754f38fcaSMauro Carvalho Chehab
31854f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-custom-bit <bit>``
31954f38fcaSMauro Carvalho Chehab    Send the custom bit instead of a regular data bit. The bit position cannot
32054f38fcaSMauro Carvalho Chehab    be an Ack bit.  If <op> specifies a specific CEC opcode then the bit
32154f38fcaSMauro Carvalho Chehab    position must be at least 18, otherwise the opcode hasn't been received yet.
32254f38fcaSMauro Carvalho Chehab
32354f38fcaSMauro Carvalho Chehab``<op>[,<mode>] tx-custom-start``
32454f38fcaSMauro Carvalho Chehab    Send the custom bit instead of a regular start bit.
32554f38fcaSMauro Carvalho Chehab
32654f38fcaSMauro Carvalho Chehab``tx-custom-pulse``
32754f38fcaSMauro Carvalho Chehab    Transmit a single custom pulse as soon as the CEC bus is idle.
328