From: Lars-Peter Clausen Date: Wed, 24 Jun 2015 16:50:27 +0000 (-0300) Subject: [media] adv7604: Add support for control event notifications X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0975626d08b623ad42c89a6294b7c2f8391c69af;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- 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 #include #include +#include #include #include @@ -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);