mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: i2c: ov5693: Support control events
@ 2026-10-10 14:20 Simon Kruse
  2026-10-25 15:43 ` Fernando Rimoli
  2026-10-26 11:43 ` Sakari Ailus
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Kruse @ 2026-10-10 14:20 UTC (permalink / raw)
  To: Daniel Scally
  Cc: Sakari Ailus, Mauro Carvalho Chehab, linux-media, linux-kernel

The sensor subdev exposes controls but does not implement the control
event operations, so VIDIOC_SUBSCRIBE_EVENT fails and v4l2-compliance
reports:

  fail: v4l2-test-controls.cpp(1128): subscribe event for control 'User Controls' failed
  test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL

Add the standard control event subdev operations and set
V4L2_SUBDEV_FL_HAS_EVENTS.

Signed-off-by: Simon Kruse <simon0x+git@proton.me>
---
Tested on a Microsoft Surface Pro 9 (Intel Alder Lake, IPU6, OVTI5693) with
media-committers next at d7e7bca71. v4l2-compliance 1.32.0 on the sensor
subdev node: 45/46 without this patch, 46/46 with it.

 drivers/media/i2c/ov5693.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
index 56599f9ca..5cddd46b3 100644
--- a/drivers/media/i2c/ov5693.c
+++ b/drivers/media/i2c/ov5693.c
@@ -26,6 +26,7 @@
 #include <media/v4l2-cci.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
 #include <media/v4l2-fwnode.h>
 
 /* System Control */
@@ -1095,7 +1096,13 @@ static const struct v4l2_subdev_pad_ops ov5693_pad_ops = {
 	.get_frame_interval = ov5693_get_frame_interval,
 };
 
+static const struct v4l2_subdev_core_ops ov5693_core_ops = {
+	.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+	.unsubscribe_event = v4l2_event_subdev_unsubscribe,
+};
+
 static const struct v4l2_subdev_ops ov5693_ops = {
+	.core = &ov5693_core_ops,
 	.video = &ov5693_video_ops,
 	.pad = &ov5693_pad_ops,
 };
@@ -1336,7 +1343,8 @@ static int ov5693_probe(struct i2c_client *client)
 		return dev_err_probe(&client->dev, ret,
 				     "Error fetching regulators\n");
 
-	ov5693->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	ov5693->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+			     V4L2_SUBDEV_FL_HAS_EVENTS;
 	ov5693->pad.flags = MEDIA_PAD_FL_SOURCE;
 	ov5693->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 

base-commit: d7e7bca7169873b46e857c025c10f3336c1258d8
-- 
2.53.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: i2c: ov5693: Support control events
  2026-10-10 14:20 [PATCH] media: i2c: ov5693: Support control events Simon Kruse
@ 2026-10-25 15:43 ` Fernando Rimoli
  2026-10-26 11:43 ` Sakari Ailus
  1 sibling, 0 replies; 4+ messages in thread
From: Fernando Rimoli @ 2026-10-25 15:43 UTC (permalink / raw)
  To: Simon Kruse
  Cc: Fernando Rimoli, Daniel Scally, Sakari Ailus,
	Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Simon,

On Sat, Oct 10, 2026 at 02:20:54PM +0000, Simon Kruse wrote:
> Tested on a Microsoft Surface Pro 9 (Intel Alder Lake, IPU6, OVTI5693) with
> media-committers next at d7e7bca71. v4l2-compliance 1.32.0 on the sensor
> subdev node: 45/46 without this patch, 46/46 with it.

Same result on a second Surface Pro 9. With v4l2-compliance 1.26.1 on
the sensor subdev the one failure is the same subscribe-event test:

  without:  43/44  fail: subscribe event for control 'User Controls' failed
  with:     44/44  VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK

The front camera still streams at 28.64 fps, as without the patch. This
machine runs a 6.19-based build of the driver, and your patch applied to
it with offsets only.

Tested-by: Fernando Rimoli <fernandorimoli11@gmail.com> # Surface Pro 9, IPU6 Alder Lake-P (8086:465d)

Fernando

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: i2c: ov5693: Support control events
  2026-10-10 14:20 [PATCH] media: i2c: ov5693: Support control events Simon Kruse
  2026-10-25 15:43 ` Fernando Rimoli
@ 2026-10-26 11:43 ` Sakari Ailus
  2026-10-27  8:12   ` Simon Kruse
  1 sibling, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2026-10-26 11:43 UTC (permalink / raw)
  To: Simon Kruse
  Cc: Daniel Scally, Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Simon,

On Sat, Oct 10, 2026 at 02:20:54PM +0000, Simon Kruse wrote:
> The sensor subdev exposes controls but does not implement the control
> event operations, so VIDIOC_SUBSCRIBE_EVENT fails and v4l2-compliance
> reports:
> 
>   fail: v4l2-test-controls.cpp(1128): subscribe event for control 'User Controls' failed
>   test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> 
> Add the standard control event subdev operations and set
> V4L2_SUBDEV_FL_HAS_EVENTS.
> 
> Signed-off-by: Simon Kruse <simon0x+git@proton.me>

Could you instead move the driver to use sub-device state? See an example
in commit e8a5b1df000e1a23c04dadbe99621441e0889f88 . You'll get control
events as a bonus. :-)

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: i2c: ov5693: Support control events
  2026-10-26 11:43 ` Sakari Ailus
@ 2026-10-27  8:12   ` Simon Kruse
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Kruse @ 2026-10-27  8:12 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Daniel Scally, Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Sakari,

On Mon, Oct 26, 2026 at 11:43:52AM +0000, Sakari Ailus wrote:
> Could you instead move the driver to use sub-device state? See an example
> in commit e8a5b1df000e1a23c04dadbe99621441e0889f88 . You'll get control
> events as a bonus. :-)

Thanks, done. The conversion is posted as a new patch that replaces this
one:

https://lore.kernel.org/all/20261027074933.21921-1-simon0x+git@proton.me/

Regards,
Simon


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-27  8:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-10 14:20 [PATCH] media: i2c: ov5693: Support control events Simon Kruse
2026-10-25 15:43 ` Fernando Rimoli
2026-10-26 11:43 ` Sakari Ailus
2026-10-27  8:12   ` Simon Kruse

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®