summaryrefslogtreecommitdiffstats
path: root/drivers/media/cec/cec-api.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-06-28 07:43:46 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-25 07:11:48 -0400
commit4786b0d6f3ca6da8db02b0a58cd2b785cb0b80ab (patch)
tree81105439c95a742d86411de731972f12faf20659 /drivers/media/cec/cec-api.c
parentf48a534adbd321362c3199140008c9e2f2a81b3a (diff)
downloadlinux-4786b0d6f3ca6da8db02b0a58cd2b785cb0b80ab.tar.bz2
media: cec: add support for 5V signal testing
Add support for the new 5V CEC events Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/cec/cec-api.c')
-rw-r--r--drivers/media/cec/cec-api.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/cec/cec-api.c b/drivers/media/cec/cec-api.c
index 10b67fc40318..b6536bbad530 100644
--- a/drivers/media/cec/cec-api.c
+++ b/drivers/media/cec/cec-api.c
@@ -579,6 +579,14 @@ static int cec_open(struct inode *inode, struct file *filp)
cec_queue_event_fh(fh, &ev, 0);
}
}
+ if (adap->pin && adap->pin->ops->read_5v) {
+ err = adap->pin->ops->read_5v(adap);
+ if (err >= 0) {
+ ev.event = err ? CEC_EVENT_PIN_5V_HIGH :
+ CEC_EVENT_PIN_5V_LOW;
+ cec_queue_event_fh(fh, &ev, 0);
+ }
+ }
#endif
list_add(&fh->list, &devnode->fhs);