Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: daniel@ffwll.ch
Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	Neil Armstrong <narmstrong@baylibre.com>
Subject: [PATCH 5/6] drm/meson: remove useless recursive components matching
Date: Mon,  7 Sep 2020 10:18:24 +0200	[thread overview]
Message-ID: <20200907081825.1654-6-narmstrong@baylibre.com> (raw)
In-Reply-To: <20200907081825.1654-1-narmstrong@baylibre.com>

The initial design was recursive to cover all port/endpoints, but only the first layer
of endpoints should be covered by the components list.
This also breaks the MIPI-DSI init/bridge attach sequence, thus only parse the
first endpoints instead of recursing.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/gpu/drm/meson/meson_drv.c | 48 +++++--------------------------
 1 file changed, 7 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 92346653223f..1a4cf910c6a0 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -449,46 +449,6 @@ static int compare_of(struct device *dev, void *data)
 	return dev->of_node == data;
 }
 
-/* Possible connectors nodes to ignore */
-static const struct of_device_id connectors_match[] = {
-	{ .compatible = "composite-video-connector" },
-	{ .compatible = "svideo-connector" },
-	{ .compatible = "hdmi-connector" },
-	{ .compatible = "dvi-connector" },
-	{}
-};
-
-static int meson_probe_remote(struct platform_device *pdev,
-			      struct component_match **match,
-			      struct device_node *parent,
-			      struct device_node *remote)
-{
-	struct device_node *ep, *remote_node;
-	int count = 1;
-
-	/* If node is a connector, return and do not add to match table */
-	if (of_match_node(connectors_match, remote))
-		return 1;
-
-	component_match_add(&pdev->dev, match, compare_of, remote);
-
-	for_each_endpoint_of_node(remote, ep) {
-		remote_node = of_graph_get_remote_port_parent(ep);
-		if (!remote_node ||
-		    remote_node == parent || /* Ignore parent endpoint */
-		    !of_device_is_available(remote_node)) {
-			of_node_put(remote_node);
-			continue;
-		}
-
-		count += meson_probe_remote(pdev, match, remote, remote_node);
-
-		of_node_put(remote_node);
-	}
-
-	return count;
-}
-
 static int meson_drv_probe(struct platform_device *pdev)
 {
 	struct component_match *match = NULL;
@@ -503,8 +463,14 @@ static int meson_drv_probe(struct platform_device *pdev)
 			continue;
 		}
 
-		count += meson_probe_remote(pdev, &match, np, remote);
+		DRM_DEBUG_DRIVER("parent %pOF remote %pOF\n", np, remote);
+
+		DRM_DEBUG_DRIVER("match add %pOF parent %s\n", remote, dev_name(&pdev->dev));
+		component_match_add(&pdev->dev, &match, compare_of, remote);
+
 		of_node_put(remote);
+
+		++count;
 	}
 
 	if (count && !match)
-- 
2.22.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  parent reply	other threads:[~2020-09-07  8:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07  8:18 [PATCH 0/6] drm/meson: add support for AXG & MIPI-DSI Neil Armstrong
2020-09-07  8:18 ` [PATCH 1/6] dt-bindings: display: amlogic, meson-vpu: add bindings for VPU found in AXG SoCs Neil Armstrong
2020-09-15 15:34   ` [PATCH 1/6] dt-bindings: display: amlogic,meson-vpu: " Rob Herring
2020-09-07  8:18 ` [PATCH 2/6] dt-bindings: display: add Amlogic MIPI DSI Host Controller bindings Neil Armstrong
2020-09-15 15:41   ` Rob Herring
2020-09-15 16:28     ` Neil Armstrong
2020-09-07  8:18 ` [PATCH 3/6] drm/meson: add support for VPU found in AXG SoCs Neil Armstrong
2020-09-07  8:18 ` [PATCH 4/6] drm/meson: venc: add ENCL encoder setup for MIPI-DSI output Neil Armstrong
2020-09-07  8:18 ` Neil Armstrong [this message]
2020-09-07  8:18 ` [PATCH 6/6] drm/meson: add support for MIPI-DSI transceiver Neil Armstrong
2020-09-07  8:43   ` Daniel Vetter
2020-09-07  8:44     ` Daniel Vetter
2020-09-07  9:03       ` Neil Armstrong
2020-09-07 18:03         ` Daniel Vetter
2020-09-08  8:06           ` Neil Armstrong
2020-09-08  8:46             ` Daniel Vetter
2020-09-17  7:14               ` Neil Armstrong
2020-09-17 11:32                 ` Daniel Vetter
2022-01-12  7:24   ` Jagan Teki
2022-01-12  8:19     ` Neil Armstrong
2022-01-20 11:03       ` Jagan Teki
2022-01-20 13:28         ` Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200907081825.1654-6-narmstrong@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox