linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: [PATCH v2 2/6] drm: rcar-du: lvds: Don't fail probe if output is not connected on D3/E3
Date: Wed, 23 Jan 2019 00:54:01 +0200	[thread overview]
Message-ID: <20190122225405.7815-3-laurent.pinchart+renesas@ideasonboard.com> (raw)
In-Reply-To: <20190122225405.7815-1-laurent.pinchart+renesas@ideasonboard.com>

On the D3 and E3 SoCs the LVDS encoder has an extended internal PLL and
supplies a clock to the DU. That clock is used not only for the LVDS
outputs but also for the DPAD output. The LVDS encoder thus needs to be
available to the DU even when its output is disabled. Don't fail probe
in that case on D3 and E3.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
Changes since v1:

- Typo fix in the commit message
---
 drivers/gpu/drm/rcar-du/rcar_lvds.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index caea2c590b7a..b21906b81f10 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -544,7 +544,10 @@ static int rcar_lvds_attach(struct drm_bridge *bridge)
 		return drm_bridge_attach(bridge->encoder, lvds->next_bridge,
 					 bridge);
 
-	/* Otherwise we have a panel, create a connector. */
+	/* Otherwise if we have a panel, create a connector. */
+	if (!lvds->panel)
+		return 0;
+
 	ret = drm_connector_init(bridge->dev, connector, &rcar_lvds_conn_funcs,
 				 DRM_MODE_CONNECTOR_LVDS);
 	if (ret < 0)
@@ -592,7 +595,8 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
 	local_output = of_graph_get_endpoint_by_regs(lvds->dev->of_node, 1, 0);
 	if (!local_output) {
 		dev_dbg(lvds->dev, "unconnected port@1\n");
-		return -ENODEV;
+		ret = -ENODEV;
+		goto done;
 	}
 
 	/*
@@ -642,6 +646,15 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
 	of_node_put(remote_input);
 	of_node_put(remote);
 
+	/*
+	 * On D3/E3 the LVDS encoder provides a clock to the DU, which can be
+	 * used for the DPAD output even when the LVDS output is not connected.
+	 * Don't fail probe in that case as the DU will need the bridge to
+	 * control the clock.
+	 */
+	if (lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL)
+		return ret == -ENODEV ? 0 : ret;
+
 	return ret;
 }
 
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2019-01-22 22:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 22:53 [PATCH v2 0/6] R-Car DU DPAD support for D3 and E3 Laurent Pinchart
2019-01-22 22:54 ` [PATCH v2 1/6] drm: rcar-du: Simplify encoder registration Laurent Pinchart
2019-01-22 22:54 ` Laurent Pinchart [this message]
2019-01-22 22:54 ` [PATCH v2 3/6] drm: rcar-du: lvds: Add API to enable/disable clock output Laurent Pinchart
2019-01-22 22:54 ` [PATCH v2 4/6] drm: rcar-du: Turn LVDS clock output on/off for DPAD0 output on D3/E3 Laurent Pinchart
2019-01-22 22:54 ` [PATCH v2 5/6] arm64: dts: renesas: r8a77990: ebisu: Enable LVDS1 encoder Laurent Pinchart
2019-01-23  8:56   ` Simon Horman
2019-01-23  9:55     ` Laurent Pinchart
2019-01-23 10:03       ` Simon Horman
2019-02-15 11:44         ` Laurent Pinchart
2019-02-25  9:13           ` Simon Horman
2019-01-22 22:54 ` [PATCH v2 6/6] arm64: dts: renesas: r8a77995: draak: " Laurent Pinchart
2019-01-23  8:57   ` Simon Horman
2019-02-25  7:44 ` [PATCH v2 0/6] R-Car DU DPAD support for D3 and E3 Kuninori Morimoto
2019-02-25  8:30   ` Laurent Pinchart
2019-02-25  8:40     ` Kuninori Morimoto

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=20190122225405.7815-3-laurent.pinchart+renesas@ideasonboard.com \
    --to=laurent.pinchart+renesas@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kieran.bingham@ideasonboard.com \
    --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).