diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2017-07-11 09:30:42 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-07-18 18:57:18 +0300 |
commit | ea5c8ef296681b53480ebeeffd06083bb60e693d (patch) | |
tree | 672a2ad5ce04c93d6e5a6afff7eeb290147bf3f1 /include/media/cec.h | |
parent | b8d62f50b1df2571afcf47107bbbe9cd60f8aafd (diff) | |
download | linux-ea5c8ef296681b53480ebeeffd06083bb60e693d.tar.xz |
media: cec-pin: add low-level pin hardware support
Add support for CEC hardware that relies on low-level pin polling or
GPIO interrupts.
One example is the Allwinner SoC. But any GPIO-based CEC implementation can
use this as well.
A GPIO implementation is very suitable as well for debugging: it can use
interrupts to detect state changes and report it. Userspace can then verify
if the bus traffic is correct. This also makes error injection possible.
The disadvantage is that it is hard to get the timings right since linux
isn't a hard realtime system.
In general on an idle system it works quite well, but under load the timer
will miss its mark every so often.
The debugfs file /sys/kernel/debug/cec/cecX/status gives some statistics
with respect to the timer overruns.
When the adapter is unconfigured and the low-level driver supports
interrupts, then the interrupt will be used to detect changes. This should
be quite accurate. But when the adapter is configured a hrtimer has to be
used.
The hrtimer implements a state machine where for each state the code will
read the bus or drive the bus and go on to the next state. It will re-arm
the timer with a delay based on the next state.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media/cec.h')
-rw-r--r-- | include/media/cec.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/media/cec.h b/include/media/cec.h index d983960b37ad..f9cab1a9f912 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -61,6 +61,7 @@ struct cec_devnode { struct cec_adapter; struct cec_data; +struct cec_pin; struct cec_data { struct list_head list; @@ -189,6 +190,9 @@ struct cec_adapter { #ifdef CONFIG_CEC_NOTIFIER struct cec_notifier *notifier; #endif +#ifdef CONFIG_CEC_PIN + struct cec_pin *pin; +#endif struct dentry *cec_dir; struct dentry *status_file; |