]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: v4l2-fwnode: add endpoint id field to v4l2_fwnode_link
authorMarco Felsch <m.felsch@pengutronix.de>
Thu, 12 Mar 2020 10:31:41 +0000 (11:31 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 12 Mar 2020 15:31:38 +0000 (16:31 +0100)
A link is between two endpoints not between two ports to be more
precise. Add the local_id/remote_id field which stores the endpoint
reg/port property to the link. Now the link holds all necessary
information about a link.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/v4l2-core/v4l2-fwnode.c
include/media/v4l2-fwnode.h

index 316e19615d88ddefab5042367ac116d52ff2de5b..cd5325b752f8eb766a5d523b329959ceb402e052 100644 (file)
@@ -565,6 +565,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *fwnode,
        memset(link, 0, sizeof(*link));
 
        fwnode_graph_parse_endpoint(fwnode, &fwep);
+       link->local_id = fwep.id;
        link->local_port = fwep.port;
        link->local_node = fwnode_graph_get_port_parent(fwnode);
 
@@ -575,6 +576,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *fwnode,
        }
 
        fwnode_graph_parse_endpoint(fwnode, &fwep);
+       link->remote_id = fwep.id;
        link->remote_port = fwep.port;
        link->remote_node = fwnode_graph_get_port_parent(fwnode);
 
index f6a7bcd13197796cc08bc3cf6dd2f8854a31ffab..7bba6dfa3fd6265f7e0bf94441bef5e938131e9c 100644 (file)
@@ -113,14 +113,18 @@ struct v4l2_fwnode_endpoint {
  * struct v4l2_fwnode_link - a link between two endpoints
  * @local_node: pointer to device_node of this endpoint
  * @local_port: identifier of the port this endpoint belongs to
+ * @local_id: identifier of the id this endpoint belongs to
  * @remote_node: pointer to device_node of the remote endpoint
  * @remote_port: identifier of the port the remote endpoint belongs to
+ * @remote_id: identifier of the id the remote endpoint belongs to
  */
 struct v4l2_fwnode_link {
        struct fwnode_handle *local_node;
        unsigned int local_port;
+       unsigned int local_id;
        struct fwnode_handle *remote_node;
        unsigned int remote_port;
+       unsigned int remote_id;
 };
 
 /**