From: Tommaso Merciai Date: Thu, 12 Sep 2024 14:06:48 +0000 (+0200) Subject: media: i2c: max96714: add HAS_EVENTS support X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d95fdc0408a8fc759e2685f2b68f3ab3f5d7561f;p=users%2Fjedix%2Flinux-maple.git media: i2c: max96714: 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 --- diff --git a/drivers/media/i2c/max96714.c b/drivers/media/i2c/max96714.c index 159753b13777c..2257b6b807eac 100644 --- a/drivers/media/i2c/max96714.c +++ b/drivers/media/i2c/max96714.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -488,6 +489,8 @@ static int max96714_log_status(struct v4l2_subdev *sd) static const struct v4l2_subdev_core_ops max96714_subdev_core_ops = { .log_status = max96714_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, }; static const struct v4l2_subdev_video_ops max96714_video_ops = { @@ -602,7 +605,8 @@ static int max96714_create_subdev(struct max96714_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 = &max96714_entity_ops;