summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-08-25 12:24:09 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-01-22 09:41:49 +0100
commit5b0d85b379747b09d8b4630fdb5c8a8d74122f0f (patch)
tree108914d782e98baac0fb7a5cbe0af13471d65f5d /include/media
parentmedia: subdev: add streams to v4l2_subdev_get_fmt() helper function (diff)
downloadlinux-5b0d85b379747b09d8b4630fdb5c8a8d74122f0f.tar.xz
linux-5b0d85b379747b09d8b4630fdb5c8a8d74122f0f.zip
media: subdev: add v4l2_subdev_set_routing_with_fmt() helper
v4l2_subdev_set_routing_with_fmt() is the same as v4l2_subdev_set_routing(), but additionally initializes all the streams with the given format. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-subdev.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index cf8cbbf3b772..0055211a579a 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -1487,6 +1487,22 @@ __v4l2_subdev_next_active_route(const struct v4l2_subdev_krouting *routing,
((route) = __v4l2_subdev_next_active_route((routing), (route)));)
/**
+ * v4l2_subdev_set_routing_with_fmt() - Set given routing and format to subdev
+ * state
+ * @sd: The subdevice
+ * @state: The subdevice state
+ * @routing: Routing that will be copied to subdev state
+ * @fmt: Format used to initialize all the streams
+ *
+ * This is the same as v4l2_subdev_set_routing, but additionally initializes
+ * all the streams using the given format.
+ */
+int v4l2_subdev_set_routing_with_fmt(struct v4l2_subdev *sd,
+ struct v4l2_subdev_state *state,
+ struct v4l2_subdev_krouting *routing,
+ const struct v4l2_mbus_framefmt *fmt);
+
+/**
* v4l2_subdev_state_get_stream_format() - Get pointer to a stream format
* @state: subdevice state
* @pad: pad id