[PATCH 4/4] media: i2c: ov9734: Support control events
From: Afonso Figuinha
Date: Thu Nov 05 2026 - 18:06:37 EST
The driver exposes V4L2 controls on its subdev node but does not
implement event subscription, so v4l2-compliance reports a failure for
VIDIOC_SUBSCRIBE_EVENT.
Set V4L2_SUBDEV_FL_HAS_EVENTS and use the control event helpers for
subscribe_event and unsubscribe_event.
The change and this description were drafted with an AI coding
assistant (Claude Code, model Claude Opus 5.5). The author reviewed
them and tested them on a Microsoft Surface Laptop 1.
Signed-off-by: Afonso Figuinha <afonso.figuinha@xxxxxxxxx>
---
drivers/media/i2c/ov9734.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c
index bf19ea56f..095dae964 100644
--- a/drivers/media/i2c/ov9734.c
+++ b/drivers/media/i2c/ov9734.c
@@ -13,6 +13,7 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#define OV9734_LINK_FREQ_180MHZ 180000000ULL
@@ -803,7 +804,13 @@ static const struct v4l2_subdev_pad_ops ov9734_pad_ops = {
.enum_frame_size = ov9734_enum_frame_size,
};
+static const struct v4l2_subdev_core_ops ov9734_core_ops = {
+ .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+ .unsubscribe_event = v4l2_event_subdev_unsubscribe,
+};
+
static const struct v4l2_subdev_ops ov9734_subdev_ops = {
+ .core = &ov9734_core_ops,
.video = &ov9734_video_ops,
.pad = &ov9734_pad_ops,
};
@@ -1013,7 +1020,8 @@ static int ov9734_probe(struct i2c_client *client)
}
ov9734->sd.internal_ops = &ov9734_internal_ops;
- ov9734->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+ ov9734->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+ V4L2_SUBDEV_FL_HAS_EVENTS;
ov9734->sd.entity.ops = &ov9734_subdev_entity_ops;
ov9734->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
ov9734->pad.flags = MEDIA_PAD_FL_SOURCE;
--
2.53.0