From: Afonso Figuinha <afonso.figuinha@gmail.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Bingbu Cao <bingbu.cao@amd.com>,
Dan Scally <dan.scally@ideasonboard.com>,
Hans de Goede <hansg@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Tianshu Qiu <tian.shu.qiu@intel.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] media: i2c: ov9734: Support control events
Date: Thu, 5 Nov 2026 23:05:17 +0000 [thread overview]
Message-ID: <20261105230517.12782-1-afonso.figuinha@gmail.com> (raw)
In-Reply-To: <20261105230327.10852-1-afonso.figuinha@gmail.com>
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@gmail.com>
---
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
prev parent reply other threads:[~2026-11-05 23:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 23:03 [PATCH 0/4] media: ov9734: Support the Microsoft Surface Laptop 1 front camera Afonso Figuinha
2026-11-05 23:03 ` [PATCH 1/4] media: ipu-bridge: Add OV9734 to the supported sensors list Afonso Figuinha
2026-11-05 23:03 ` [PATCH 2/4] media: i2c: ov9734: Defer probe until the fwnode graph endpoint exists Afonso Figuinha
2026-11-05 23:04 ` [PATCH 3/4] media: i2c: ov9734: Add reset GPIO, supplies and PM callbacks Afonso Figuinha
2026-11-05 23:05 ` Afonso Figuinha [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261105230517.12782-1-afonso.figuinha@gmail.com \
--to=afonso.figuinha@gmail.com \
--cc=bingbu.cao@amd.com \
--cc=dan.scally@ideasonboard.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tian.shu.qiu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®