[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220203175009.558868-10-jeanmichel.hautbois@ideasonboard.com>
Date: Thu, 3 Feb 2022 18:50:06 +0100
From: Jean-Michel Hautbois <jeanmichel.hautbois@...asonboard.com>
To: jeanmichel.hautbois@...asonboard.com
Cc: dave.stevenson@...pberrypi.com, devicetree@...r.kernel.org,
kernel-list@...pberrypi.com, laurent.pinchart@...asonboard.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
lukasz@...y.st, mchehab@...nel.org, naush@...pberrypi.com,
robh@...nel.org, tomi.valkeinen@...asonboard.com,
nsaenz@...nel.org, bcm-kernel-feedback-list@...adcom.com
Subject: [RFC PATCH v4 09/12] media: imx219: Introduce the set_routing operation
As we want to use multiplexed streams API, we need to be able to set the
pad routing. Introduce the set_routing operation.
As this operation is required for a multiplexed able sensor, add the
V4L2_SUBDEV_FL_MULTIPLEXED flag.
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@...asonboard.com>
---
drivers/media/i2c/imx219.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index b68d35046725..7d29cf2b06f8 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -817,6 +817,25 @@ static int _imx219_set_routing(struct v4l2_subdev *sd,
return 0;
}
+static int imx219_set_routing(struct v4l2_subdev *sd,
+ struct v4l2_subdev_state *state,
+ enum v4l2_subdev_format_whence which,
+ struct v4l2_subdev_krouting *routing)
+{
+ int ret;
+
+ if (routing->num_routes == 0 || routing->num_routes > 2)
+ return -EINVAL;
+
+ v4l2_subdev_lock_state(state);
+
+ ret = _imx219_set_routing(sd, state);
+
+ v4l2_subdev_unlock_state(state);
+
+ return ret;
+}
+
static int imx219_init_cfg(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state)
{
@@ -1289,6 +1308,7 @@ static const struct v4l2_subdev_pad_ops imx219_pad_ops = {
.get_fmt = imx219_get_pad_format,
.set_fmt = imx219_set_pad_format,
.get_selection = imx219_get_selection,
+ .set_routing = imx219_set_routing,
.enum_frame_size = imx219_enum_frame_size,
};
@@ -1547,7 +1567,8 @@ static int imx219_probe(struct i2c_client *client)
/* Initialize subdev */
imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
- V4L2_SUBDEV_FL_HAS_EVENTS;
+ V4L2_SUBDEV_FL_HAS_EVENTS |
+ V4L2_SUBDEV_FL_MULTIPLEXED;
imx219->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
/* Initialize source pad */
--
2.32.0
Powered by blists - more mailing lists