From 0d88a37edf54eede777befd0dc5cdd835d0b2b27 Mon Sep 17 00:00:00 2001 From: Tommaso Merciai Date: Thu, 12 Sep 2024 16:06:49 +0200 Subject: [PATCH] media: i2c: max96717: add HAS_EVENTS support Controls can be exposed to userspace via a v4l-subdevX device, and userspace has to be able to subscribe to control events so that it is notified when the control changes value. Add missing HAS_EVENTS support: flag and .(un)subscribe_event(). Signed-off-by: Tommaso Merciai Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/max96717.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/max96717.c b/drivers/media/i2c/max96717.c index 4e85b8eb1e77..755e27271b1b 100644 --- a/drivers/media/i2c/max96717.c +++ b/drivers/media/i2c/max96717.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -576,6 +577,8 @@ static const struct v4l2_subdev_pad_ops max96717_pad_ops = { static const struct v4l2_subdev_core_ops max96717_subdev_core_ops = { .log_status = max96717_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, }; static const struct v4l2_subdev_internal_ops max96717_internal_ops = { @@ -689,7 +692,8 @@ static int max96717_subdev_init(struct max96717_priv *priv) goto err_free_ctrl; } - priv->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_STREAMS; + priv->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_STREAMS; priv->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; priv->sd.entity.ops = &max96717_entity_ops; -- 2.51.0