summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/adv7604.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-06-24 19:50:27 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-07-17 15:44:18 +0300
commit0975626d08b623ad42c89a6294b7c2f8391c69af (patch)
tree6d1ea70ab1bc5530a95df3d50ec3cda41674e29c /drivers/media/i2c/adv7604.c
parentfb8dfda980bdaf178a7addb0a4f68574e390a9d9 (diff)
downloadlinux-0975626d08b623ad42c89a6294b7c2f8391c69af.tar.xz
[media] adv7604: 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/adv7604.c')
-rw-r--r--drivers/media/i2c/adv7604.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 21b549a8dc74..a7d47e079343 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -42,6 +42,7 @@
#include <media/adv7604.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
#include <media/v4l2-dv-timings.h>
#include <media/v4l2-of.h>
@@ -2362,6 +2363,8 @@ static const struct v4l2_ctrl_ops adv76xx_ctrl_ops = {
static const struct v4l2_subdev_core_ops adv76xx_core_ops = {
.log_status = adv76xx_log_status,
.interrupt_service_routine = adv76xx_isr,
+ .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+ .unsubscribe_event = v4l2_event_subdev_unsubscribe,
#ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = adv76xx_g_register,
.s_register = adv76xx_s_register,
@@ -3047,7 +3050,7 @@ static int adv76xx_probe(struct i2c_client *client,
snprintf(sd->name, sizeof(sd->name), "%s %d-%04x",
id->name, i2c_adapter_id(client->adapter),
client->addr);
- sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+ sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
/* Configure IO Regmap region */
err = configure_regmap(state, ADV76XX_PAGE_IO);