All of lore.kernel.org
 help / color / mirror / Atom feed
From: fabrizio.castro@bp.renesas.com (Fabrizio Castro)
To: cip-dev@lists.cip-project.org
Subject: [cip-dev] [PATCH 4.19.y-cip 13/32] drm: rcar-du: lvds: Don't fail probe if output is not connected on D3/E3
Date: Tue,  1 Oct 2019 09:25:12 +0100	[thread overview]
Message-ID: <1569918331-6990-14-git-send-email-fabrizio.castro@bp.renesas.com> (raw)
In-Reply-To: <1569918331-6990-1-git-send-email-fabrizio.castro@bp.renesas.com>

From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

commit 6e1f8557818f3c2476404ba1d4a5157b823b79f0 upstream.

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>
Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 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 694a627..8b08d61 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 at 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;
 }
 
-- 
2.7.4

  parent reply	other threads:[~2019-10-01  8:25 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  8:24 [cip-dev] [PATCH 4.19.y-cip 00/32] Add HDMI support to EK874 Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 01/32] media: vsp1: Add RZ/G support Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 02/32] media: dt-bindings: media: renesas-fcp: Add RZ/G2 support Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 03/32] dt-bindings: display: renesas: du: Document r8a774c0 bindings Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 04/32] dt-bindings: display: renesas: lvds: Add EXTAL and DU_DOTCLKIN clocks Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 05/32] dt-bindings: display: renesas: lvds: Document r8a774c0 bindings Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 06/32] drm: rcar-du: lvds: D3/E3 support Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 07/32] drm: rcar-du: Perform the initial CRTC setup from rcar_du_crtc_get() Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 08/32] drm: rcar-du: Use LVDS PLL clock as dot clock when possible Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 09/32] drm: rcar-du: Add r8a774c0 device support Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 10/32] drm: rcar-du: lvds: add R8A774C0 support Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 11/32] drm: rcar-du: Move CRTC outputs bitmask to private CRTC state Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 12/32] drm: rcar-du: Simplify encoder registration Fabrizio Castro
2019-10-01  8:25 ` Fabrizio Castro [this message]
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 14/32] drm: rcar-du: lvds: Add API to enable/disable clock output Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 15/32] drm: rcar-du: Turn LVDS clock output on/off for DPAD0 output on D3/E3 Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 16/32] drm: rcar-du: lvds: Fix post-DLL divider calculation Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 17/32] drm: rcar-du: lvds: Adjust operating frequency for D3 and E3 Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 18/32] drm: rcar-du: Improve non-DPLL clock selection Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 19/32] drm: rcar-du: Enable configurable DPAD0 routing on Gen3 Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 20/32] drm/rcar-du: Replace drm_dev_unref with drm_dev_put Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 21/32] drm: rcar-du: Fix the return value in case of error in 'rcar_du_crtc_set_crc_source()' Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 22/32] drm: rcar-du: Fix vblank initialization Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 23/32] drm: rcar-du: Fix external clock error checks Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 24/32] drm: rcar-du: Reject modes that fail CRTC timing requirements Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 25/32] drm/rcar-du: Use drm_fbdev_generic_setup() Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 26/32] drm: rcar-du: Disable unused DPAD outputs Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 27/32] drm: rcar-du: Replace EXT_CTRL_REGS feature flag with generation check Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 28/32] media: use strscpy() instead of strlcpy() Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 29/32] arm64: dts: renesas: r8a774c0: Add display output support Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 30/32] arm64: defconfig: Enable TDA19988 Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 31/32] arm64: dts: renesas: cat874: Add HDMI video support Fabrizio Castro
2019-10-01  8:25 ` [cip-dev] [PATCH 4.19.y-cip 32/32] arm64: dts: renesas: cat874: Add HDMI audio Fabrizio Castro
2019-10-01 12:55 ` [cip-dev] [PATCH 4.19.y-cip 00/32] Add HDMI support to EK874 nobuhiro1.iwamatsu at toshiba.co.jp
2019-10-02  6:55 ` nobuhiro1.iwamatsu at toshiba.co.jp

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=1569918331-6990-14-git-send-email-fabrizio.castro@bp.renesas.com \
    --to=fabrizio.castro@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.