summaryrefslogtreecommitdiffstats
path: root/drivers/media/cec/cec-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-08-15 10:07:25 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-09-23 07:43:04 -0400
commit333ef6bd10c3ffdaf6da94e34dc6cae675ed27fc (patch)
tree0f01c42950d43741dcac85bb4a31397cd3fb5e56 /drivers/media/cec/cec-core.c
parentda634f623e4879d7716029a84791fc596ebac24d (diff)
downloadop-kernel-dev-333ef6bd10c3ffdaf6da94e34dc6cae675ed27fc.zip
op-kernel-dev-333ef6bd10c3ffdaf6da94e34dc6cae675ed27fc.tar.gz
media: cec: add CEC_EVENT_PIN_HPD_LOW/HIGH events
Add support for two new low-level events: PIN_HPD_LOW and PIN_HPD_HIGH. This is specifically meant for use with the upcoming cec-gpio driver and makes it possible to trace when the HPD pin changes. Some HDMI sinks do strange things with the HPD and this makes it easy to debug this. Note that this also moves the initialization of a devnode mutex and list to the allocate_adapter function: if the HPD is high, then as soon as the HPD interrupt is created an interrupt occurs and cec_queue_pin_hpd_event() is called which requires that the devnode mutex and list are initialized. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/cec/cec-core.c')
-rw-r--r--drivers/media/cec/cec-core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c
index 648136e5..e3a1fb6 100644
--- a/drivers/media/cec/cec-core.c
+++ b/drivers/media/cec/cec-core.c
@@ -112,10 +112,6 @@ static int __must_check cec_devnode_register(struct cec_devnode *devnode,
int minor;
int ret;
- /* Initialization */
- INIT_LIST_HEAD(&devnode->fhs);
- mutex_init(&devnode->lock);
-
/* Part 1: Find a free minor number */
mutex_lock(&cec_devnode_lock);
minor = find_next_zero_bit(cec_devnode_nums, CEC_NUM_DEVICES, 0);
@@ -242,6 +238,10 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
INIT_LIST_HEAD(&adap->wait_queue);
init_waitqueue_head(&adap->kthread_waitq);
+ /* adap->devnode initialization */
+ INIT_LIST_HEAD(&adap->devnode.fhs);
+ mutex_init(&adap->devnode.lock);
+
adap->kthread = kthread_run(cec_thread_func, adap, "cec-%s", name);
if (IS_ERR(adap->kthread)) {
pr_err("cec-%s: kernel_thread() failed\n", name);
OpenPOWER on IntegriCloud