summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-12-21 11:18:43 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-01-22 09:35:33 +0100
commit17bb9bf819c542b41d7dbddd9fe1ec82ac509604 (patch)
tree7fe9701c1342d8b3951ad0d2f843b1fbf1d99ca5 /include/media
parent33c0ddbe56905c98b43d7141f2fe67ae69afba3c (diff)
downloadlwn-17bb9bf819c542b41d7dbddd9fe1ec82ac509604.tar.gz
lwn-17bb9bf819c542b41d7dbddd9fe1ec82ac509604.zip
media: subdev: add v4l2_subdev_set_routing helper()
Add a helper function to set the subdev routing. The helper can be used from subdev driver's set_routing op to store the routing table. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> 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 0bd674a8f84d..1d2a1a77bdb2 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -1424,6 +1424,22 @@ v4l2_subdev_lock_and_get_active_state(struct v4l2_subdev *sd)
int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state,
struct v4l2_subdev_format *format);
+/**
+ * v4l2_subdev_set_routing() - Set given routing to subdev state
+ * @sd: The subdevice
+ * @state: The subdevice state
+ * @routing: Routing that will be copied to subdev state
+ *
+ * This will release old routing table (if any) from the state, allocate
+ * enough space for the given routing, and copy the routing.
+ *
+ * This can be used from the subdev driver's set_routing op, after validating
+ * the routing.
+ */
+int v4l2_subdev_set_routing(struct v4l2_subdev *sd,
+ struct v4l2_subdev_state *state,
+ const struct v4l2_subdev_krouting *routing);
+
#endif /* CONFIG_VIDEO_V4L2_SUBDEV_API */
#endif /* CONFIG_MEDIA_CONTROLLER */