linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Anderson <dianders@chromium.org>
To: Sean Paul <seanpaul@chromium.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Sandeep Panda <spanda@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	jsanka@codeaurora.org, ryandcase@chromium.org,
	Douglas Anderson <dianders@chromium.org>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] drm/panel: simple: Support panels with HPD where HPD isn't connected
Date: Mon, 22 Oct 2018 13:46:35 -0700	[thread overview]
Message-ID: <20181022204639.8558-2-dianders@chromium.org> (raw)
In-Reply-To: <20181022204639.8558-1-dianders@chromium.org>

Some eDP panels that are designed to be always connected to a board
use their HPD signal to signal that they've finished powering on and
they're ready to be talked to.

However, for various reasons it's possible that the HPD signal from
the panel isn't actually hooked up.  In the case where the HPD isn't
hooked up you can look at the timing diagram on the panel datasheet
and insert a delay for the maximum amount of time that the HPD might
take to come up.

Let's add support in simple-panel for this concept.

At the moment we will co-opt the existing "prepare" delay to keep
track of the delay and we'll use a boolean to specify that a given
panel should only apply the delay if the "no-hpd" property was
specified.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/gpu/drm/panel/panel-simple.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 97964f7f2ace..38c646fb55fd 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -63,12 +63,15 @@ struct panel_desc {
 	 *           turn the display off (no content is visible)
 	 * @unprepare: the time (in milliseconds) that it takes for the panel
 	 *             to power itself down completely
+	 * @prepare_delay_only_if_no_hpd: The prepare delay should only be done
+	 *                                if we know Hot Plug Detect isn't used.
 	 */
 	struct {
 		unsigned int prepare;
 		unsigned int enable;
 		unsigned int disable;
 		unsigned int unprepare;
+		bool prepare_delay_only_if_no_hpd;
 	} delay;
 
 	u32 bus_format;
@@ -79,6 +82,7 @@ struct panel_simple {
 	struct drm_panel base;
 	bool prepared;
 	bool enabled;
+	bool no_hpd;
 
 	const struct panel_desc *desc;
 
@@ -215,7 +219,8 @@ static int panel_simple_prepare(struct drm_panel *panel)
 
 	gpiod_set_value_cansleep(p->enable_gpio, 1);
 
-	if (p->desc->delay.prepare)
+	if (p->desc->delay.prepare &&
+	    (!p->desc->delay.prepare_delay_only_if_no_hpd || p->no_hpd))
 		msleep(p->desc->delay.prepare);
 
 	p->prepared = true;
@@ -305,6 +310,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
 	panel->prepared = false;
 	panel->desc = desc;
 
+	panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd");
+
 	panel->supply = devm_regulator_get(dev, "power");
 	if (IS_ERR(panel->supply))
 		return PTR_ERR(panel->supply);
-- 
2.19.1.568.g152ad8e336-goog


  reply	other threads:[~2018-10-22 20:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 20:46 [PATCH 1/6] dt-bindings: drm/panel: simple: Add no-hpd property Douglas Anderson
2018-10-22 20:46 ` Douglas Anderson [this message]
2018-10-25 18:08   ` [PATCH 2/6] drm/panel: simple: Support panels with HPD where HPD isn't connected Sean Paul
2018-10-22 20:46 ` [PATCH 3/6] drm/panel: simple: Add "no-hpd" delay for Innolux TV123WAM Douglas Anderson
2018-10-22 20:46 ` [PATCH 4/6] drm/bridge: ti-sn65dsi86: Remove the mystery delay Douglas Anderson
2018-10-25 18:10   ` Sean Paul
2018-10-22 20:46 ` [PATCH 5/6] drm/panel: simple: Innolux TV123WAM is actually P120ZDG-BF1 Douglas Anderson
2018-10-25 18:13   ` Sean Paul
2018-10-25 18:45     ` Doug Anderson
2018-10-25 19:25       ` Abhinav Kumar
2018-10-25 22:24     ` Doug Anderson
2018-10-26 14:38       ` Sean Paul
2018-10-22 20:46 ` [PATCH 6/6] dt-bindings: " Douglas Anderson
2018-10-25 18:15   ` Sean Paul
2018-10-25 19:49   ` Rob Herring
2018-10-25 18:06 ` [PATCH 1/6] dt-bindings: drm/panel: simple: Add no-hpd property Sean Paul
2018-10-25 19:28 ` Rob Herring

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=20181022204639.8558-2-dianders@chromium.org \
    --to=dianders@chromium.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsanka@codeaurora.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ryandcase@chromium.org \
    --cc=seanpaul@chromium.org \
    --cc=spanda@codeaurora.org \
    --cc=thierry.reding@gmail.com \
    --subject='Re: [PATCH 2/6] drm/panel: simple: Support panels with HPD where HPD isn'\''t connected' \
    /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

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).