[RFC PATCH v2 4/4] rcar-csi2: Map to fwnode endpoints rather than port parents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kieran Bingham <kieran.bingham+renesas@xxxxxxxxxxxxxxxx>

To support multiple async subdevices on a single device, we need to
identify which subdevice maps directly for each connection.

Instead of mapping the port parent to the async notifier, use the fwnode
of the direct endpoint node. This will use a DT path which includes the
port, and allow correct matching of the correct subdevice.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@xxxxxxxxxxxxxxxx>
---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
index 3400c0783c8e..0ddb25cb661b 100644
--- a/drivers/media/platform/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
@@ -648,7 +648,7 @@ static const struct v4l2_subdev_internal_ops rcar_csi2_internal_ops = {
 
 static int rcar_csi2_parse_dt_subdevice(struct rcar_csi2 *priv)
 {
-	struct device_node *remote, *ep, *rp;
+	struct device_node *ep, *rp;
 	struct v4l2_fwnode_endpoint v4l2_ep;
 	int ret;
 
@@ -675,18 +675,10 @@ static int rcar_csi2_parse_dt_subdevice(struct rcar_csi2 *priv)
 	rp = of_parse_phandle(ep, "remote-endpoint", 0);
 	of_graph_parse_endpoint(rp, &priv->remote.endpoint);
 
-	remote = of_graph_get_remote_port_parent(ep);
-	of_node_put(ep);
-	if (!remote) {
-		dev_err(priv->dev, "No subdevice found for endpoint '%s'\n",
-			of_node_full_name(ep));
-		return -EINVAL;
-	}
-
-	priv->remote.asd.match.fwnode.fwnode = of_fwnode_handle(remote);
+	priv->remote.asd.match.fwnode.fwnode = of_fwnode_handle(rp);
 	priv->remote.asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
 
-	dev_dbg(priv->dev, "Found '%s'\n", of_node_full_name(remote));
+	dev_dbg(priv->dev, "Found '%s'\n", of_node_full_name(rp));
 
 	return 0;
 }
-- 
git-series 0.9.1



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux