diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2023-04-28 15:58:42 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-07-28 10:53:41 +0200 |
commit | e74f7a96787c46e90b3c8519d4e0d127f5cc106d (patch) | |
tree | 41ed47290bd25b3b5f7124d512e69da4e442c601 /include/media/v4l2-async.h | |
parent | 765f60568f2904b2de3011a8de2fadba4e4de44f (diff) |
media: v4l: async: Support fwnode endpoint list matching for subdevs
Support matching V4L2 async sub-devices based on particular fwnode
endpoint. This makes it possible to instantiate multiple V4L2 sub-devices
based on given fwnode endpoints from a single device, based on driver
needs.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'include/media/v4l2-async.h')
-rw-r--r-- | include/media/v4l2-async.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h index 8670b8e44851..41a9c4bada8a 100644 --- a/include/media/v4l2-async.h +++ b/include/media/v4l2-async.h @@ -126,6 +126,18 @@ struct v4l2_async_notifier { }; /** + * struct v4l2_async_subdev_endpoint - Entry in sub-device's fwnode list + * + * @async_subdev_endpoint_entry: An entry in async_subdev_endpoint_list of + * &struct v4l2_subdev + * @endpoint: Endpoint fwnode agains which to match the sub-device + */ +struct v4l2_async_subdev_endpoint { + struct list_head async_subdev_endpoint_entry; + struct fwnode_handle *endpoint; +}; + +/** * v4l2_async_debug_init - Initialize debugging tools. * * @debugfs_dir: pointer to the parent debugfs &struct dentry @@ -216,6 +228,24 @@ __v4l2_async_nf_add_i2c(struct v4l2_async_notifier *notifier, sizeof(type))) /** + * v4l2_async_subdev_endpoint_add - Add an endpoint fwnode to async sub-device + * matching list + * + * @sd: the sub-device + * @fwnode: the endpoint fwnode to match + * + * Add a fwnode to the async sub-device's matching list. This allows registering + * multiple async sub-devices from a single device. + * + * Note that calling v4l2_subdev_cleanup() as part of the sub-device's cleanup + * if endpoints have been added to the sub-device's fwnode matching list. + * + * Returns an error on failure, 0 on success. + */ +int v4l2_async_subdev_endpoint_add(struct v4l2_subdev *sd, + struct fwnode_handle *fwnode); + +/** * v4l2_async_connection_unique - return a unique &struct v4l2_async_connection * for a sub-device * @sd: the sub-device |