]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: renesas: vsp1: Implement control events
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 18 Mar 2026 23:59:06 +0000 (01:59 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 25 Mar 2026 09:25:49 +0000 (10:25 +0100)
The V4L2 API requires drivers that expose controls to implement control
notification events. This is enforced by v4l2-compliance. Add event
handling to the VSP1 entities that create controls to fix the compliance
failures.

Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M
Link: https://patch.msgid.link/20260318235907.831556-13-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/renesas/vsp1/vsp1_brx.c
drivers/media/platform/renesas/vsp1/vsp1_clu.c
drivers/media/platform/renesas/vsp1/vsp1_entity.c
drivers/media/platform/renesas/vsp1/vsp1_entity.h
drivers/media/platform/renesas/vsp1/vsp1_histo.c
drivers/media/platform/renesas/vsp1/vsp1_lut.c
drivers/media/platform/renesas/vsp1/vsp1_rwpf.c
drivers/media/platform/renesas/vsp1/vsp1_sru.c

index 911359faa6000ea579fb581ae7b144e992f2dffd..b1a2c68e994462cfcad96a39e294b4357650c29c 100644 (file)
@@ -269,6 +269,7 @@ static const struct v4l2_subdev_pad_ops brx_pad_ops = {
 };
 
 static const struct v4l2_subdev_ops brx_ops = {
+       .core   = &vsp1_entity_core_ops,
        .pad    = &brx_pad_ops,
 };
 
index a56c038a2c71a68b87ab1f8c51964a50a0cfc48a..04c466c4da8149931ec38bd500a8b1f45979ff15 100644 (file)
@@ -130,6 +130,7 @@ static const struct v4l2_subdev_pad_ops clu_pad_ops = {
 };
 
 static const struct v4l2_subdev_ops clu_ops = {
+       .core   = &vsp1_entity_core_ops,
        .pad    = &clu_pad_ops,
 };
 
index 892a2adfdf3a7eb141cb1876940ac411f13c661b..839b75b62cebadd086a2b9d0a48698091cad011b 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <media/media-entity.h>
 #include <media/v4l2-ctrls.h>
+#include <media/v4l2-event.h>
 #include <media/v4l2-subdev.h>
 
 #include "vsp1.h"
@@ -396,6 +397,11 @@ static const struct v4l2_subdev_internal_ops vsp1_entity_internal_ops = {
        .init_state = vsp1_entity_init_state,
 };
 
+const struct v4l2_subdev_core_ops vsp1_entity_core_ops = {
+       .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+       .unsubscribe_event = v4l2_event_subdev_unsubscribe,
+};
+
 /* -----------------------------------------------------------------------------
  * Media Operations
  */
@@ -639,6 +645,9 @@ int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
        subdev->entity.ops = &vsp1->media_ops;
        subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
+       if (ops->core == &vsp1_entity_core_ops)
+               subdev->flags |= V4L2_SUBDEV_FL_HAS_EVENTS;
+
        snprintf(subdev->name, sizeof(subdev->name), "%s %s",
                 dev_name(vsp1->dev), name);
 
index 88daf83cd1ab7d6dbd16c98eaaf6cf9300423d68..c0c1fe7d3e406b937a62b0ea11c9ee4bf9d8ea77 100644 (file)
@@ -143,6 +143,8 @@ static inline struct vsp1_entity *to_vsp1_entity(struct v4l2_subdev *subdev)
        return container_of(subdev, struct vsp1_entity, subdev);
 }
 
+extern const struct v4l2_subdev_core_ops vsp1_entity_core_ops;
+
 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
                     const char *name, unsigned int num_pads,
                     const struct v4l2_subdev_ops *ops, u32 function);
index 79da56c456eb769d99907829f0e5f3a57ecc3c38..3f87a2c9df0ef2550d576c90412c0b57d9772667 100644 (file)
@@ -424,6 +424,7 @@ static const struct v4l2_subdev_pad_ops histo_pad_ops = {
 };
 
 static const struct v4l2_subdev_ops histo_ops = {
+       .core   = &vsp1_entity_core_ops,
        .pad    = &histo_pad_ops,
 };
 
index 2ec4d596465d67d73320b046a9b93039051ec040..94bdedcc5c9234aae5937cabae79d51a34448e9a 100644 (file)
@@ -106,6 +106,7 @@ static const struct v4l2_subdev_pad_ops lut_pad_ops = {
 };
 
 static const struct v4l2_subdev_ops lut_ops = {
+       .core   = &vsp1_entity_core_ops,
        .pad    = &lut_pad_ops,
 };
 
index c9e6fb98f863e53ff03df571f8cef33f9a8aec14..c72518b29f84b3577dd772e1595bf898531c4b81 100644 (file)
@@ -357,6 +357,7 @@ static const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = {
 };
 
 const struct v4l2_subdev_ops vsp1_rwpf_subdev_ops = {
+       .core   = &vsp1_entity_core_ops,
        .pad    = &vsp1_rwpf_pad_ops,
 };
 
index 37fd36d09045a221fb7a9fe252158818eb340d21..94149da0c90032ce6d526ec563f81c2e19701040 100644 (file)
@@ -252,6 +252,7 @@ static const struct v4l2_subdev_pad_ops sru_pad_ops = {
 };
 
 static const struct v4l2_subdev_ops sru_ops = {
+       .core   = &vsp1_entity_core_ops,
        .pad    = &sru_pad_ops,
 };