From patchwork Fri Oct 19 20:19:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10650139 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 8D4051750 for ; Fri, 19 Oct 2018 20:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DBDE2817F for ; Fri, 19 Oct 2018 20:20:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7203728306; Fri, 19 Oct 2018 20:20:31 +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 5DA9028173 for ; Fri, 19 Oct 2018 20:20:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F1A26E546; Fri, 19 Oct 2018 20:20:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9CDED6E546 for ; Fri, 19 Oct 2018 20:20:07 +0000 (UTC) Received: by mail-pl1-x644.google.com with SMTP id e67-v6so7339763plb.6 for ; Fri, 19 Oct 2018 13:20:07 -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:mime-version :content-transfer-encoding; bh=ypr1b3a+zTVdUsID9jpNzwdeEbE3kjN+Jye3j5dNozs=; b=mMgyw64t3HZwogEQcr4sKadAVxg2hP+DoZMoQazNwnc4MphbRFo6okWiLSQ541hi07 4wCsfmgExWqaT9txzHv1CuZXVogrn/M+LptnlbXdfMRblbQZHe/a8vLpshBw0VmMqSa9 wZYY7A4G5AZ3WFQGgeLFQ45Ztj1bqlIiy7hVU6T3nsZfBWyu+4ZsTaNqmD79s4Jm2e8S gm234AO21AY6hAjj9AKfkOustcLK3QzvD6JMOphgyzJsYc5cPal/7N6/pOweT20VWUzh OGT/ifMYlbFWXyrX/fZ0eIAMAcUueDJcJUIuWefxRgwJhCtk3Fxol93Kvu4dVEv/Rl0C Ll2g== X-Gm-Message-State: ABuFfohmWfgU6UONtSIB0HxbcOwBb0t/qpGst6PmDdU9pM/6DGqnDHR5 Z+YRTdHZ3jF+Gg5Annq2Mf+reA== X-Google-Smtp-Source: ACcGV63l9PCzkCFguh++1dbH5hO4c7VDo4aZTvkBcrQOxkODTpeNviy5w0TXpgWq04LfYELdrl9eAA== X-Received: by 2002:a17:902:8e8b:: with SMTP id bg11-v6mr34975271plb.219.1539980407151; Fri, 19 Oct 2018 13:20:07 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:c8e0:70d7:4be7:a36]) by smtp.gmail.com with ESMTPSA id i184-v6sm38281573pfg.88.2018.10.19.13.20.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Oct 2018 13:20:06 -0700 (PDT) From: Douglas Anderson To: Sandeep Panda , Sean Paul Subject: [PATCH 1/2] dt-bindings: drm/bridge: sn65dsi86: Add panel-hpd-delay Date: Fri, 19 Oct 2018 13:19:39 -0700 Message-Id: <20181019201940.138179-1-dianders@chromium.org> X-Mailer: git-send-email 2.19.1.568.g152ad8e336-goog 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: Mark Rutland , devicetree@vger.kernel.org, David Airlie , linux-arm-msm@vger.kernel.org, Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd , Rob Herring , ryandcase@chromium.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The timing diagram of some eDP panels says that you're supposed to wait for HPD to be asserted before the aux channel is operational. In some cases, however, it's better to just hardcode the max delay instead of trying to use HPD. Why? The sn65dsi86 datasheet says that it only reports the debounced HPD signal to software. It will tell software about HPD assertion as quickly as 100 ms after it's asserted, but sometimes it might take 400 ms because it's timed with a very inaccurate ring oscillator. In practice it was measured at 200 ms on at least one system. On a particular panel, HPD was asserted 84 ms after power was given. This same panel specified that HPD would always be asserted within 200 ms of applying power. Thus on this panel with the measured 84 ms to assert HPD + the 200 ms measured debounce we'd wait 284 ms which is 84 ms longer than just hardcoding the sleep. Let's allow boards to explicitly choose the hardcoded delay by adding a device tree attribute for it. A few notes: a) This delay can't easily be in the panel bindings because the delay wouldn't actually be needed if the same panel were hooked somewhere else (someplace with more sane HPD behavior). b) The nice thing about being able to set this delay is that it's also useful on boards where HPD wasn't hooked up at all (for whatever reason). Signed-off-by: Douglas Anderson --- .../bindings/display/bridge/ti,sn65dsi86.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.txt b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.txt index 0a3fbb53a16e..1a1ca0f7a1d8 100644 --- a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.txt +++ b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.txt @@ -33,6 +33,15 @@ Optional properties: - suspend-gpios: specification for GPIO1 pin on bridge (active low) +- ti,panel-hpd-delay-ms: Assume that HPD from the panel will be asserted within + this many milliseconds after giving power to the panel. + With this number we can ignore the HPD signal from + the panel and just hardcode a delay. This is useful + to do because the bridge chip only provides the + debounced HPD signal to software and the timing of the + debounce is very inaccurate so it's often faster to + hardcode the max from the panel spec. + Required nodes: This device has two video ports. Their connections are modelled using the OF graph bindings specified in Documentation/devicetree/bindings/graph.txt. @@ -62,6 +71,8 @@ edp-bridge@2d { clock-names = "refclk"; clocks = <&input_refclk>; + ti,panel-hpd-delay-ms = <200>; + ports { #address-cells = <1>; #size-cells = <0>;