linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Cc: Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
	dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Simon Horman <horms@verge.net.au>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>
Subject: [PATCH/RFC 06/12] drm: rcar-du: lvds: Do not look at ports for identifying bridges
Date: Fri,  2 Aug 2019 08:34:03 +0100	[thread overview]
Message-ID: <1564731249-22671-7-git-send-email-fabrizio.castro@bp.renesas.com> (raw)
In-Reply-To: <1564731249-22671-1-git-send-email-fabrizio.castro@bp.renesas.com>

We may be connected to a dual LVDS display, therefore checking
if node != remote_input for identifying bridges is not going to
work anymore.
We could try to match the ports on the remote end to the LVDS
encoders, however the companion LVDS encoder instance doesn't
hold a reference to the primary LVDS encoder instance.
We know we could be connected to either a bridge, or a panel,
therefore look through the registered bridges and panels, until
we have a match.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 drivers/gpu/drm/rcar-du/rcar_lvds.c | 29 +++--------------------------
 1 file changed, 3 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index c306fab..2d54ae5 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -711,10 +711,7 @@ static int rcar_lvds_parse_dt_companion(struct rcar_lvds *lvds)
 static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
 {
 	struct device_node *local_output = NULL;
-	struct device_node *remote_input = NULL;
 	struct device_node *remote = NULL;
-	struct device_node *node;
-	bool is_bridge = false;
 	int ret = 0;
 
 	local_output = of_graph_get_endpoint_by_regs(lvds->dev->of_node, 1, 0);
@@ -742,27 +739,8 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
 		goto done;
 	}
 
-	remote_input = of_graph_get_remote_endpoint(local_output);
-
-	for_each_endpoint_of_node(remote, node) {
-		if (node != remote_input) {
-			/*
-			 * We've found one endpoint other than the input, this
-			 * must be a bridge.
-			 */
-			is_bridge = true;
-			of_node_put(node);
-			break;
-		}
-	}
-
-	if (is_bridge) {
-		lvds->next_bridge = of_drm_find_bridge(remote);
-		if (!lvds->next_bridge) {
-			ret = -EPROBE_DEFER;
-			goto done;
-		}
-
+	lvds->next_bridge = of_drm_find_bridge(remote);
+	if (lvds->next_bridge) {
 		if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK)
 			lvds->dual_link = lvds->next_bridge->timings
 					? lvds->next_bridge->timings->dual_link
@@ -770,7 +748,7 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
 	} else {
 		lvds->panel = of_drm_find_panel(remote);
 		if (IS_ERR(lvds->panel)) {
-			ret = PTR_ERR(lvds->panel);
+			ret = -EPROBE_DEFER;
 			goto done;
 		}
 	}
@@ -784,7 +762,6 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
 
 done:
 	of_node_put(local_output);
-	of_node_put(remote_input);
 	of_node_put(remote);
 
 	switch (ret) {
-- 
2.7.4


  parent reply	other threads:[~2019-08-02  7:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02  7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
2019-08-02  7:33 ` [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too Fabrizio Castro
2019-08-02  7:48   ` Laurent Pinchart
2019-08-02  7:33 ` [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data Fabrizio Castro
2019-08-02  7:44   ` Laurent Pinchart
2019-08-05  8:59     ` Fabrizio Castro
2019-08-05  9:35       ` Laurent Pinchart
2019-08-05 10:07         ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support Fabrizio Castro
2019-08-02  8:00   ` Laurent Pinchart
2019-08-05  9:02     ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR Fabrizio Castro
2019-08-02  8:03   ` Laurent Pinchart
2019-08-05  9:04     ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 05/12] drm: rcar-du: lvds: Add data swap support Fabrizio Castro
2019-08-02  8:06   ` Laurent Pinchart
2019-08-02  9:01     ` Geert Uytterhoeven
2019-08-05  9:32     ` Fabrizio Castro
2019-08-05 10:17       ` Laurent Pinchart
2019-08-02  7:34 ` Fabrizio Castro [this message]
2019-08-02  8:08   ` [PATCH/RFC 06/12] drm: rcar-du: lvds: Do not look at ports for identifying bridges Laurent Pinchart
2019-08-05  9:06     ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 07/12] drm: rcar-du: lvds: Add support for dual link panels Fabrizio Castro
2019-08-02  8:20   ` Laurent Pinchart
2019-08-05  9:12     ` Fabrizio Castro
2019-08-05  9:48       ` Laurent Pinchart
2019-08-05 10:07         ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 08/12] drm: rcar-du: lvds: Fix bridge_to_rcar_lvds Fabrizio Castro
2019-08-02  8:22   ` Laurent Pinchart
2019-08-05  9:13     ` Fabrizio Castro
2019-08-02  7:34 ` [PATCH/RFC 09/12] drm: rcar-du: lvds: Fix companion's mode Fabrizio Castro
2019-08-02  8:26   ` Laurent Pinchart
2019-08-05  9:15     ` Fabrizio Castro

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=1564731249-22671-7-git-send-email-fabrizio.castro@bp.renesas.com \
    --to=fabrizio.castro@bp.renesas.com \
    --cc=Chris.Paterson2@renesas.com \
    --cc=airlied@linux.ie \
    --cc=biju.das@bp.renesas.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@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;
as well as URLs for NNTP newsgroup(s).