media: cec: core: add glitch error injection
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 30 Jun 2025 11:08:46 +0000 (13:08 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 8 Jul 2025 06:35:26 +0000 (08:35 +0200)
commit36e713438ae3519ef46f3dd1093045627718311b
treefe2ed1e28924538c5e5821d8938b9fe0dcff5adf
parent5bcc50cb55c2bdc24aafffef9ad1529839ddc948
media: cec: core: add glitch error injection

This adds support for inserting 'glitches' after a falling and/or
rising edge. This tests what happens when there are little voltage
spikes after falling or rising edges, which can be caused due to
noise or reflections on the CEC line.

A proper CEC implementation will deglitch this, but a poor implementation
can create a Low Drive pulse in response, effectively making CEC unusable.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/cec/core/cec-pin-error-inj.c
drivers/media/cec/core/cec-pin-priv.h
drivers/media/cec/core/cec-pin.c