media: v4l: async: Rework internal lists

This patch re-arranges internal V4L2 async lists for preparation of
supporting multiple connections per sub-device as well as cleaning up used
lists.

The list of unbound V4L2 sub-devices shall be maintained for the purpose of
listing those sub-devices only, not for their bindin status. Also, the V4L2
async connections now have, instead of two list entries, a single list
entry in the notifier's list, be that either waiting or done lists, while
the notifier's asc_list is removed.

The one-to-one relation between a sub-device and a connection is still
maintained in this patch.

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>
This commit is contained in:
Sakari Ailus
2023-04-18 14:00:54 +02:00
committed by Mauro Carvalho Chehab
parent 393cfcc02d
commit 9bf19fbf0c
8 changed files with 68 additions and 65 deletions

View File

@@ -66,9 +66,8 @@ struct v4l2_async_match_desc {
*
* @match: struct of match type and per-bus type matching data sets
* @asc_entry: used to add struct v4l2_async_connection objects to the
* master notifier @asc_list
* @waiting_entry: used to link struct v4l2_async_connection objects, waiting to
* be probed, to a notifier->waiting_list list
* notifier @waiting_list or @done_list
* @sd: the related sub-device
*
* When this struct is used as a member in a driver specific struct,
* the driver specific struct shall contain the &struct
@@ -77,7 +76,7 @@ struct v4l2_async_match_desc {
struct v4l2_async_connection {
struct v4l2_async_match_desc match;
struct list_head asc_entry;
struct list_head waiting_entry;
struct v4l2_subdev *sd;
};
/**
@@ -106,7 +105,6 @@ struct v4l2_async_notifier_operations {
* @v4l2_dev: v4l2_device of the root notifier, NULL otherwise
* @sd: sub-device that registered the notifier, NULL otherwise
* @parent: parent notifier
* @asc_list: master list of struct v4l2_async_connection
* @waiting_list: list of struct v4l2_async_connection, waiting for their
* drivers
* @done_list: list of struct v4l2_subdev, already probed
@@ -117,7 +115,6 @@ struct v4l2_async_notifier {
struct v4l2_device *v4l2_dev;
struct v4l2_subdev *sd;
struct v4l2_async_notifier *parent;
struct list_head asc_list;
struct list_head waiting_list;
struct list_head done_list;
struct list_head notifier_entry;