From patchwork Tue Apr 29 23:53:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 885958 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BDF42D81B4; Tue, 29 Apr 2025 23:53:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745970831; cv=none; b=fM0wp9cCcEcr3SGOFT7hFcK2k7sebTtKbFFCz/TthfjFmDf2enaaB/M88gnYU8feeq39eWtWePoxSrSRE6Y8mcxslKTIiuzAvLXZSi+ZSmuN2+TGzAlTkjFcwHXBieccnDzxUbqjMkAE69mxkQxD24tKSF78T0XAx1ongKWgdmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745970831; c=relaxed/simple; bh=sLqtEne9eurWr8oSinTn0V2+KBfKYwojlJKu9hT6sFE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uuP7jD2xZztbeO3r9kfJW3GpR8gmVv6Yl7LzQGI3M4kJjmHCrrruKLMl0wPbT0HAlhqgPvWp4sNzT26z9zES1PP8SjhfU4XCxSsWDbPtuFe5HfC6MfHBM53mLBnnz2Rzu1gneH7h74xM67bk+JqE3ljKwHslw5m3BpRkJN/ZNS0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=A/0fzA4/; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="A/0fzA4/" Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 698361961; Wed, 30 Apr 2025 01:53:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745970813; bh=sLqtEne9eurWr8oSinTn0V2+KBfKYwojlJKu9hT6sFE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A/0fzA4/y3+UQlVb7KFOekopTZYFJJcfuwyM0kKSzYK5jgLuh9bkItScITcb7NZiF d7WBSaPT317QqwXzTiduGfpNyFtZs18MmsoCmgTJxCKbBsZ3y4FXqIkqhMDnOfCQF+ XjROy8ve4QKN25O3R/jSYTx+5wEbe586OEY6y2O4= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Kieran Bingham , Jacopo Mondi , Tomi Valkeinen Subject: [PATCH 7/7] media: renesas: vsp1: Implement control events Date: Wed, 30 Apr 2025 02:53:22 +0300 Message-ID: <20250429235322.29826-8-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429235322.29826-1-laurent.pinchart+renesas@ideasonboard.com> References: <20250429235322.29826-1-laurent.pinchart+renesas@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Signed-off-by: Laurent Pinchart --- drivers/media/platform/renesas/vsp1/vsp1_brx.c | 1 + drivers/media/platform/renesas/vsp1/vsp1_clu.c | 1 + drivers/media/platform/renesas/vsp1/vsp1_entity.c | 9 +++++++++ drivers/media/platform/renesas/vsp1/vsp1_entity.h | 2 ++ drivers/media/platform/renesas/vsp1/vsp1_histo.c | 1 + drivers/media/platform/renesas/vsp1/vsp1_lut.c | 1 + drivers/media/platform/renesas/vsp1/vsp1_rwpf.c | 1 + drivers/media/platform/renesas/vsp1/vsp1_sru.c | 1 + 8 files changed, 17 insertions(+) diff --git a/drivers/media/platform/renesas/vsp1/vsp1_brx.c b/drivers/media/platform/renesas/vsp1/vsp1_brx.c index 911359faa600..b1a2c68e9944 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_brx.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_brx.c @@ -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, }; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_clu.c b/drivers/media/platform/renesas/vsp1/vsp1_clu.c index a56c038a2c71..04c466c4da81 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_clu.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_clu.c @@ -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, }; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_entity.c b/drivers/media/platform/renesas/vsp1/vsp1_entity.c index a3d4bf2887ec..27c172788621 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_entity.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_entity.c @@ -12,6 +12,7 @@ #include #include +#include #include #include "vsp1.h" @@ -389,6 +390,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 */ @@ -629,6 +635,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); diff --git a/drivers/media/platform/renesas/vsp1/vsp1_entity.h b/drivers/media/platform/renesas/vsp1/vsp1_entity.h index 5542f6446b16..626fb1d5d470 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_entity.h +++ b/drivers/media/platform/renesas/vsp1/vsp1_entity.h @@ -142,6 +142,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); diff --git a/drivers/media/platform/renesas/vsp1/vsp1_histo.c b/drivers/media/platform/renesas/vsp1/vsp1_histo.c index a1b3671a0873..158d01aa5e81 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_histo.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_histo.c @@ -370,6 +370,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, }; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_lut.c b/drivers/media/platform/renesas/vsp1/vsp1_lut.c index 2ec4d596465d..94bdedcc5c92 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_lut.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_lut.c @@ -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, }; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c index bd97fc75eb5b..32b018e21f57 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c @@ -351,6 +351,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, }; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_sru.c b/drivers/media/platform/renesas/vsp1/vsp1_sru.c index e821eac1cbc2..30b482a160c2 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_sru.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_sru.c @@ -250,6 +250,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, };