aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/adv7842.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-06-24 13:50:28 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-07-17 09:44:45 -0300
commitaef5159ffc6bbf65d77af3a2e5b3d377c7c4f37a (patch)
treebcb010e90f6353cfa6f47bdbc270d33bea27e3f0 /drivers/media/i2c/adv7842.c
parent[media] adv7604: Add support for control event notifications (diff)
downloadlinux-dev-aef5159ffc6bbf65d77af3a2e5b3d377c7c4f37a.tar.xz
linux-dev-aef5159ffc6bbf65d77af3a2e5b3d377c7c4f37a.zip
[media] adv7842: Add support for control event notifications
Allow userspace applications to subscribe to control change events. This can e.g. be used to monitor the 5V detect control to be notified when a source is connected or disconnected. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c/adv7842.c')
-rw-r--r--drivers/media/i2c/adv7842.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index aa0d1a04543b..0535463d2fed 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -40,6 +40,7 @@
#include <linux/v4l2-dv-timings.h>
#include <linux/hdmi.h>
#include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-dv-timings.h>
#include <media/adv7842.h>
@@ -3015,6 +3016,8 @@ static const struct v4l2_subdev_core_ops adv7842_core_ops = {
.log_status = adv7842_log_status,
.ioctl = adv7842_ioctl,
.interrupt_service_routine = adv7842_isr,
+ .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+ .unsubscribe_event = v4l2_event_subdev_unsubscribe,
#ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = adv7842_g_register,
.s_register = adv7842_s_register,
@@ -3210,7 +3213,7 @@ static int adv7842_probe(struct i2c_client *client,
sd = &state->sd;
v4l2_i2c_subdev_init(sd, client, &adv7842_ops);
- sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+ sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
state->mode = pdata->mode;
state->hdmi_port_a = pdata->input == ADV7842_SELECT_HDMI_PORT_A;