From patchwork Mon Oct 22 20:46:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10652519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 880705BB5 for ; Mon, 22 Oct 2018 20:48:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCD7928CA4 for ; Mon, 22 Oct 2018 20:48:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0A9428CA6; Mon, 22 Oct 2018 20:48:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 72E3228CAC for ; Mon, 22 Oct 2018 20:48:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F397E89C0D; Mon, 22 Oct 2018 20:48:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 041B689BF8 for ; Mon, 22 Oct 2018 20:48:42 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id l17-v6so20501813pff.2 for ; Mon, 22 Oct 2018 13:48:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f4oR4ZDStg+E8v2cNbJRHjDjC6miXn++j6pN4qN/OJI=; b=lldCODBfYRHe9z+Rm5glnXWrGh4s5bNZRLOGQYNpJ3os5wDr217n1fyxCf2TNrhKYj ymcZveT9G5h0RJYq1RAGWmB6Jp1qQTu9GcexH8zEnojMOGSQ3hWtRJoZwKanRE8QuF4l jFPrFjObaDqcWcB41p1mAZy+en1MBsI+OuSfjBd65IejVqHK0UYRSijMKYIzp39xGsTP 7xIMOoGpSF1L8hbsjjhbqdkY0KDXDbNdoJLqelEKmIOLfTPDnvFxTxiyMIg4ozLKN2SD mjI/Q0U9p2153uR71NepBsdKO+Y1T1ooUVQh4wR6+hvEFvECJbnsQRoFW6Z9kXgBrb/P STIg== X-Gm-Message-State: ABuFfojgMHS9jF01A43SovTmbOWX95o9+jKOI49mXNE1Y/J8amrvwVc0 hJz/K5NVQ3xevDFbS/YzmmSe4w== X-Google-Smtp-Source: ACcGV63u11X6gLB9SFur48dm4ZHAR463bY0tjVxvEDCR4idABHAPtyeTVUOGrN34Y4N7CbIYt2JyAA== X-Received: by 2002:a62:8685:: with SMTP id x127-v6mr24358904pfd.252.1540241321478; Mon, 22 Oct 2018 13:48:41 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:c8e0:70d7:4be7:a36]) by smtp.gmail.com with ESMTPSA id y144-v6sm47483001pfb.81.2018.10.22.13.48.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 13:48:40 -0700 (PDT) From: Douglas Anderson To: Sean Paul , Thierry Reding , Sandeep Panda 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 Message-Id: <20181022204639.8558-2-dianders@chromium.org> X-Mailer: git-send-email 2.19.1.568.g152ad8e336-goog In-Reply-To: <20181022204639.8558-1-dianders@chromium.org> References: <20181022204639.8558-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, ryandcase@chromium.org, Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);