media: subdev: add "opposite" stream helper funcs
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tue, 21 Dec 2021 10:22:06 +0000 (11:22 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 22 Jan 2023 08:41:02 +0000 (09:41 +0100)
commitd00f1a075ce13c7d71ca00083be110877874a403
tree5cef1032c30e3b54b0c00edb8e23dec08ddbaecb
parenta6b995ed03ffeb36f06c4a46d8804c24d776de6f
media: subdev: add "opposite" stream helper funcs

Add two helper functions to make dealing with streams easier:

v4l2_subdev_routing_find_opposite_end - given a routing table and a pad
+ stream, return the pad + stream on the opposite side of the subdev.

v4l2_subdev_state_get_opposite_stream_format - return a pointer to the
format on the pad + stream on the opposite side from the given pad +
stream.

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>
drivers/media/v4l2-core/v4l2-subdev.c
include/media/v4l2-subdev.h