Re: [PATCH v2 2/2] media: i2c: vd55g1: Support control events

From: Sakari Ailus

Date: Mon Nov 02 2026 - 07:15:29 EST


Hi Fernando,

Thanks for the set.

On Sun, Nov 01, 2026 at 07:50:05PM +0000, Fernando Rimoli 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(1108): 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: Fernando Rimoli <fernandorimoli11@xxxxxxxxx>
> ---
> drivers/media/i2c/vd55g1.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
> index 69ffb3a..162c2d5 100644
> --- a/drivers/media/i2c/vd55g1.c
> +++ b/drivers/media/i2c/vd55g1.c
> @@ -1447,7 +1447,13 @@ static const struct v4l2_subdev_video_ops vd55g1_video_ops = {
> .s_stream = v4l2_subdev_s_stream_helper,
> };
>
> +static const struct v4l2_subdev_core_ops vd55g1_core_ops = {
> + .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
> + .unsubscribe_event = v4l2_event_subdev_unsubscribe,
> +};

Instead of doing this, can you make v4l2_subdev_init_finalize() the last
step of the sub-device initialisation? It enables events if the control
handler has been initialised for the sub-device.

--
Regards,

Sakari Ailus