summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2020-03-04 18:03:56 +0100
committerMarco Felsch <m.felsch@pengutronix.de>2020-03-06 15:50:58 +0100
commitd9c3e517380a01255339c556c6f40fb921e1800e (patch)
tree1bf99abf4b7e3234b58b9548d580053d7e7fc0c8
parentc20c3dcc211da04086189ef9ffa5c967ea0326db (diff)
downloadlinux-0-day-d9c3e517380a01255339c556c6f40fb921e1800e.tar.gz
linux-0-day-d9c3e517380a01255339c556c6f40fb921e1800e.tar.xz
media: v4l2-fwnode: add endpoint id field to v4l2_fwnode_link
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>
-rw-r--r--drivers/media/v4l2-core/v4l2-fwnode.c2
-rw-r--r--include/media/v4l2-fwnode.h4
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 6ece4320e1d2a..78c32aebbe035 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -565,6 +565,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode,
memset(link, 0, sizeof(*link));
+ fwnode_property_read_u32(__fwnode, "reg", &link->local_id);
fwnode = fwnode_get_parent(__fwnode);
fwnode_property_read_u32(fwnode, port_prop, &link->local_port);
fwnode = fwnode_get_next_parent(fwnode);
@@ -578,6 +579,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode,
return -ENOLINK;
}
+ fwnode_property_read_u32(fwnode, "reg", &link->remote_id);
fwnode = fwnode_get_parent(fwnode);
fwnode_property_read_u32(fwnode, port_prop, &link->remote_port);
fwnode = fwnode_get_next_parent(fwnode);
diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index f6a7bcd131977..7bba6dfa3fd62 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -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;
};
/**