From 6be6a97d1c574e8ca63b11ce8c6dbe7ab9a43f85 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 3 Apr 2019 13:01:39 -0700 Subject: [PATCH] v4l: xilinx: vipp: Support entity matching on DT subnodes When the video IP pipeline is parsed in DT, the composite device stores all entities found in the graph, along with their corresponding DT node. Later on the DT nodes pointers are used to locate the corresponding V4L2 subdevs by matching them against subdev->dev->of_node. This mechanism works fine for devices that register a single subdev. For devices that register multiple subdevs, subdev->dev->of_node points to the DT node of the device, while the entities parsed from the pipeline point to child nodes of the device DT node. The v4l2_subdev structure has a fwnode field that is set to point to the fwnode corresponding to the device DT node. Drivers that register multiple subdevs must set the fwnode field manually to the associated child node of the device DT node. We can thus fix this issue by locating V4L2 subdevs for an entity based on the subdev fwnode instead of the dev->of_node. Signed-off-by: Laurent Pinchart Reviewed-by: Hyun Kwon --- drivers/media/platform/xilinx/xilinx-vipp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c index 83241713f206..7daa846ad729 100644 --- a/drivers/media/platform/xilinx/xilinx-vipp.c +++ b/drivers/media/platform/xilinx/xilinx-vipp.c @@ -213,7 +213,7 @@ bool xvip_subdev_set_streaming(struct xvip_composite_device *xdev, struct xvip_graph_entity *entity; list_for_each_entry(entity, &xdev->entities, list) - if (entity->node == subdev->dev->of_node) { + if (of_fwnode_handle(entity->node) == subdev->fwnode) { bool status = entity->streaming; entity->streaming = enable; @@ -362,7 +362,7 @@ static int xvip_graph_notify_bound(struct v4l2_async_notifier *notifier, * subdev pointer. */ list_for_each_entry(entity, &xdev->entities, list) { - if (entity->node != subdev->dev->of_node) + if (of_fwnode_handle(entity->node) != subdev->fwnode) continue; if (entity->subdev) { -- 2.39.2