From: Dave Stevenson <dave.stevenson@raspberrypi.com>
To: Manivannan Sadhasivam <mani@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org,
Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Subject: [PATCH v2 03/13] media: i2c: imx290: Add V4L2_SUBDEV_FL_HAS_EVENTS and subscribe hooks
Date: Fri, 3 Feb 2023 19:18:01 +0000 [thread overview]
Message-ID: <20230203191811.947697-4-dave.stevenson@raspberrypi.com> (raw)
In-Reply-To: <20230203191811.947697-1-dave.stevenson@raspberrypi.com>
Any V4L2 subdevice that implements controls and declares
V4L2_SUBDEV_FL_HAS_DEVNODE should also declare V4L2_SUBDEV_FL_HAS_EVENTS
and implement subscribe_event and unsubscribe_event hooks.
This driver didn't and would therefore fail v4l2-compliance
testing.
Add the relevant hooks.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
drivers/media/i2c/imx290.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
index 827c0804792f..22faa9b54810 100644
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -20,6 +20,7 @@
#include <media/media-entity.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
+#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
@@ -993,6 +994,11 @@ static int imx290_entity_init_cfg(struct v4l2_subdev *subdev,
return 0;
}
+static const struct v4l2_subdev_core_ops imx290_core_ops = {
+ .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+ .unsubscribe_event = v4l2_event_subdev_unsubscribe,
+};
+
static const struct v4l2_subdev_video_ops imx290_video_ops = {
.s_stream = imx290_set_stream,
};
@@ -1007,6 +1013,7 @@ static const struct v4l2_subdev_pad_ops imx290_pad_ops = {
};
static const struct v4l2_subdev_ops imx290_subdev_ops = {
+ .core = &imx290_core_ops,
.video = &imx290_video_ops,
.pad = &imx290_pad_ops,
};
@@ -1025,7 +1032,8 @@ static int imx290_subdev_init(struct imx290 *imx290)
imx290->current_mode = &imx290_modes_ptr(imx290)[0];
v4l2_i2c_subdev_init(&imx290->sd, client, &imx290_subdev_ops);
- imx290->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+ imx290->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
+ V4L2_SUBDEV_FL_HAS_EVENTS;
imx290->sd.dev = imx290->dev;
imx290->sd.entity.ops = &imx290_subdev_entity_ops;
imx290->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
--
2.34.1
next prev parent reply other threads:[~2023-02-03 19:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 19:17 [PATCH v2 00/13] imx290: Minor fixes, support for alternate INCK, and more ctrls Dave Stevenson
2023-02-03 19:17 ` [PATCH v2 01/13] media: i2c: imx290: Match kernel coding style on whitespace Dave Stevenson
2023-02-03 19:18 ` [PATCH v2 02/13] media: i2c: imx290: Set the colorspace fields in the format Dave Stevenson
2023-02-07 1:34 ` Laurent Pinchart
2023-02-03 19:18 ` Dave Stevenson [this message]
2023-02-03 19:18 ` [PATCH v2 04/13] media: i2c: imx290: Fix the pixel rate at 148.5Mpix/s Dave Stevenson
2023-02-03 19:18 ` [PATCH v2 05/13] media: i2c: imx290: Support 60fps in 2 lane operation Dave Stevenson
2023-02-03 19:18 ` [PATCH v2 06/13] media: i2c: imx290: Use CSI timings as per datasheet Dave Stevenson
2023-02-06 7:48 ` Alexander Stein
2023-02-03 19:18 ` [PATCH v2 07/13] media: i2c: imx290: Convert V4L2_CID_HBLANK to read/write Dave Stevenson
2023-02-06 7:59 ` Alexander Stein
2023-02-03 19:18 ` [PATCH v2 08/13] media: i2c: imx290: Convert V4L2_CID_VBLANK " Dave Stevenson
2023-02-03 19:18 ` [PATCH v2 09/13] media: i2c: imx290: VMAX is mode dependent Dave Stevenson
2023-02-07 1:46 ` Laurent Pinchart
2023-02-03 19:18 ` [PATCH v2 10/13] media: i2c: imx290: Remove duplicated write to IMX290_CTRL_07 Dave Stevenson
2023-02-03 19:18 ` [PATCH v2 11/13] media: i2c: imx290: Add support for 74.25MHz external clock Dave Stevenson
2023-02-06 8:24 ` Alexander Stein
2023-02-07 1:50 ` Laurent Pinchart
2023-02-03 19:18 ` [PATCH v2 12/13] media: i2c: imx290: Add support for H & V Flips Dave Stevenson
2023-02-07 1:52 ` Laurent Pinchart
2023-02-03 19:18 ` [PATCH v2 13/13] media: i2c: imx290: Add the error code to logs in start_streaming Dave Stevenson
2023-02-06 8:27 ` Alexander Stein
2023-02-07 1:53 ` Laurent Pinchart
2023-02-07 1:55 ` [PATCH v2 00/13] imx290: Minor fixes, support for alternate INCK, and more ctrls Laurent Pinchart
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=20230203191811.947697-4-dave.stevenson@raspberrypi.com \
--to=dave.stevenson@raspberrypi.com \
--cc=alexander.stein@ew.tq-group.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mchehab@kernel.org \
/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