From patchwork Fri Jan 15 22:44:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12024275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96A8FC433DB for ; Fri, 15 Jan 2021 22:44:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C143221E2 for ; Fri, 15 Jan 2021 22:44:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C143221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D238E6E4AB; Fri, 15 Jan 2021 22:44:50 +0000 (UTC) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF9D16E4AB for ; Fri, 15 Jan 2021 22:44:48 +0000 (UTC) Received: by mail-pj1-x1032.google.com with SMTP id y12so5894707pji.1 for ; Fri, 15 Jan 2021 14:44:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oDHPk7JANOuofXo//uyQamPz+seSLXpO5Xv0qoPNlbw=; b=Qc+B5q9O+2fWa+TSZw8zhoS5aVrF5nF4tujkRDTi6eOOhWaqdFNj6G5xRR2TY4v5Un qs/Q/uUaoq+bsv26QmjXezvSrDrO0Vc1bRd+OrM75YX5OTgtnWNkV85c4VvAE0ae870O 0S0ZtYPvbdeJHdIU2/7hM1BgVWgnH5t81hOZ8= 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=oDHPk7JANOuofXo//uyQamPz+seSLXpO5Xv0qoPNlbw=; b=h/AVKF1SMpe0k1gwHlqlbeDUKTGeQBZlsUgVkKZD8lRh0qv0HPDdIv+BrjGTOY0kM2 uFj/qNitxxyrRMw2sK2aaczvQmHKUStvDfn8/5br/TZGKZxSFBhrobGjFgz5bYKD/JWE H2xsb1waMu1HzKmnaDBAKRIVLTsJ1TBeUutfPviVpVe0rivAY2rIq+l97MV3dMb1Cze2 xOJSMMh7meqI33ak2XWN9YBNt4Gabr1tS1FQqFWd+k6YFhW4G7G39Vvem5AG8L5RhZat K3J6tMSB9Wi2Osge9wugVuMIU1TqupCpUEBA4Wnz5xKy9ptavlvpd1c5xAZ1crJdEuyp 8BRQ== X-Gm-Message-State: AOAM5301YtYl1QzaJPlgDs7jsJ64Z1snBtYfQV9BSHCfXndlm9z9PCRq rqot/4CA7TCPESlCuZRDw9sSxA== X-Google-Smtp-Source: ABdhPJw8Oi8GnQQgpwj7t/wOBKjCGXLyC2Rv6QWB2CfwV4PvIFvHUjuWJuKEjD1ugabirHxb7MBU1A== X-Received: by 2002:a17:90a:c902:: with SMTP id v2mr13141654pjt.108.1610750688320; Fri, 15 Jan 2021 14:44:48 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:42b0:34ff:fe3d:58e6]) by smtp.gmail.com with ESMTPSA id q16sm9131100pfg.139.2021.01.15.14.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:44:47 -0800 (PST) From: Douglas Anderson To: Thierry Reding , Sam Ravnborg Subject: [PATCH v2 1/5] drm/panel-simple: Undo enable if HPD never asserts Date: Fri, 15 Jan 2021 14:44:16 -0800 Message-Id: <20210115144345.v2.1.I33fcbd64ab409cfe4f9491bf449f51925a4d3281@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210115224420.1635017-1-dianders@chromium.org> References: <20210115224420.1635017-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If the HPD signal never asserts in panel_simple_prepare() and we return an error, we should unset the enable GPIO and disable the regulator to make it consistent for the caller. At the moment I have some hardware where HPD sometimes doesn't assert. Obviously that needs to be debugged, but this patch makes it so that if I add a retry that I can make things work. Fixes: 48834e6084f1 ("drm/panel-simple: Support hpd-gpios for delaying prepare()") Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd --- Stephen: I didn't take your Reviewed-by tag since I made a small change. If you're OK with this change please re-add. Changes in v2: - Set the "unprepared_time" so if we retry we give the proper delay. drivers/gpu/drm/panel/panel-simple.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 71ae200ac48a..581ab6810b70 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -406,7 +406,7 @@ static int panel_simple_prepare(struct drm_panel *panel) if (IS_ERR(p->hpd_gpio)) { err = panel_simple_get_hpd_gpio(panel->dev, p, false); if (err) - return err; + goto error; } err = readx_poll_timeout(gpiod_get_value_cansleep, p->hpd_gpio, @@ -418,13 +418,20 @@ static int panel_simple_prepare(struct drm_panel *panel) if (err) { dev_err(panel->dev, "error waiting for hpd GPIO: %d\n", err); - return err; + goto error; } } p->prepared_time = ktime_get(); return 0; + +error: + gpiod_set_value_cansleep(p->enable_gpio, 0); + regulator_disable(p->supply); + p->unprepared_time = ktime_get(); + + return err; } static int panel_simple_enable(struct drm_panel *panel) From patchwork Fri Jan 15 22:44:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12024277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9515BC433E0 for ; Fri, 15 Jan 2021 22:44:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 618E8221E2 for ; Fri, 15 Jan 2021 22:44:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 618E8221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 227A96E4AD; Fri, 15 Jan 2021 22:44:53 +0000 (UTC) Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by gabe.freedesktop.org (Postfix) with ESMTPS id 03D556E4AB for ; Fri, 15 Jan 2021 22:44:49 +0000 (UTC) Received: by mail-pj1-x1029.google.com with SMTP id l23so6061031pjg.1 for ; Fri, 15 Jan 2021 14:44:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=esnObWpP9J8bOo0IUsOKjdAe7AetAYNnvTwxBtu8gOA=; b=m/ZeZRnI+jQ6T7gJRoAmph4QjmtbXaB9Mbos68yxQkKgbx+Up5eC7p8aAQt9cs7pl2 byxwu0qKaXYWP4qvIkI5v61Bj/DB8PiExypu9QmGcofaWULqGMlB92lYCiIM8ZLAwLwh Yj5E92BfnpRxATnWZh/H0DVg0dYVFe0sB/H94= 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=esnObWpP9J8bOo0IUsOKjdAe7AetAYNnvTwxBtu8gOA=; b=nZ2zFMF7LIoYF5tssQK4Dpkjhc7rAwDSdnihkEKYkv+mNEBOfNqI94IGpc5sH5eZ+o o9LcS7JGzqJyTy74H5rWbd2tlIud9SlD3vUl6YThjf/CIEXIcnULKi36t7TVr8WOOcXR U8JolL3+4SBkQDBTldOKTzBFUQYelOQPV9zl7mCHcnLvoGfnH6h2OnDhnKjC/uMpgaht wP19cBtbgZ8um7LXk0dTs3mmeSnvJxc3xu6KuK0/OntgGtzkalOLPtNAqI7HzFvTiZLk gYgna/o6/FoKwyIuvc0MmKAg8UCRx1i0s0FHLXvhJywGED+jMVoXBOqE+C3lBDw7Bhng OinQ== X-Gm-Message-State: AOAM532sFZFemMM43MMtcyidwboVLSVmJbKcJJHvC9x6GZbJC44C9fpv un/J28nnTe5N7DlcXY2B7+qiUA== X-Google-Smtp-Source: ABdhPJzhOlOz+MZXZQUM93OIlpGcdb90a+r5o5I+V3QxmNZQ2p4sp1C9wAK28TrCHGgtcB+uRZ8pag== X-Received: by 2002:a17:90a:5993:: with SMTP id l19mr12779129pji.203.1610750689678; Fri, 15 Jan 2021 14:44:49 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:42b0:34ff:fe3d:58e6]) by smtp.gmail.com with ESMTPSA id q16sm9131100pfg.139.2021.01.15.14.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:44:49 -0800 (PST) From: Douglas Anderson To: Thierry Reding , Sam Ravnborg Subject: [PATCH v2 2/5] drm/panel-simple: Don't wait longer for HPD than hpd_absent_delay Date: Fri, 15 Jan 2021 14:44:17 -0800 Message-Id: <20210115144345.v2.2.I183b1817610d7a82fdd3bc852e96d2985df9623f@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210115224420.1635017-1-dianders@chromium.org> References: <20210115224420.1635017-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If a panel has an hpd_absent_delay specified then we know exactly how long the maximum time is before HPD must be asserted. That means we can use it as a timeout for polling the HPD pin instead of using an arbitrary timeout. This is especially useful for dealing with panels that periodically fail to power on and need to be retried. We can detect the problem sooner. Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd --- Changes in v2: - ("drm/panel-simple: Don't wait longer for HPD...") new for v2. drivers/gpu/drm/panel/panel-simple.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 581ab6810b70..30842cf6d414 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -382,6 +382,7 @@ static int panel_simple_prepare(struct drm_panel *panel) unsigned int delay; int err; int hpd_asserted; + unsigned long hpd_wait_us; if (p->prepared_time != 0) return 0; @@ -409,9 +410,14 @@ static int panel_simple_prepare(struct drm_panel *panel) goto error; } + if (p->desc->delay.hpd_absent_delay) + hpd_wait_us = p->desc->delay.hpd_absent_delay * 1000UL; + else + hpd_wait_us = 2000000; + err = readx_poll_timeout(gpiod_get_value_cansleep, p->hpd_gpio, hpd_asserted, hpd_asserted, - 1000, 2000000); + 1000, hpd_wait_us); if (hpd_asserted < 0) err = hpd_asserted; From patchwork Fri Jan 15 22:44:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12024279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E65D1C433DB for ; Fri, 15 Jan 2021 22:44:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0452221E2 for ; Fri, 15 Jan 2021 22:44:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0452221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 037DF6E4AE; Fri, 15 Jan 2021 22:44:53 +0000 (UTC) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D3246E4AD for ; Fri, 15 Jan 2021 22:44:51 +0000 (UTC) Received: by mail-pf1-x42b.google.com with SMTP id t29so1284841pfg.11 for ; Fri, 15 Jan 2021 14:44:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i6Pt2T+moXOluPwTG075i+/xaDz4gJsnvkS14avcQFI=; b=c0GZ3s1oOTDja47NPFLVziyxh5BFbEBRpCpy0pc1SDTQlJOgmoO5w5VFUKRK+rucm3 dwGTZdsg3Afg5sVTGxta3YVN3cUa47W4shyBGEuFkXsqNT7iEGjOwFts7HC8z0K9RWnW x9xkhQWhn2tM95JSe5A9cu8ag6cWljeTRqpRE= 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=i6Pt2T+moXOluPwTG075i+/xaDz4gJsnvkS14avcQFI=; b=h6JNPi4tgiZXazMDQ5QatjVDERTjhX9Op5DzEHa9cwNDwe+pjWb3vs9es447nh4ZJn ZnPwEwDddePqtjMvcdoBu+Zohb3Rwx/149hdf8ex/B/mPS1IyBT6tlTauJeQTHoqKvLD eEp0dYZWk7rCVLrmddOaSp7QBnHSTv792Ce/yJOiKQTU/zWvD3BPUdkHKivePw6fH28U pb0oUJU5ffOvLgE7a6l6rF1qcTRziXn3k6veABa/qq97c6yhXV6lFdo1jX70gQqfsXqy W75UZqRXts0nVRYVNUmUzv2eVpSmsHTo1uQXRUEwtl2799YCiQmD5h3ITwaGFevZhvF/ 3exQ== X-Gm-Message-State: AOAM530l4i5QUCV/QRS6vOyOYuqUzWbQPsk5LUJ07rvPitcLbRH86x++ SezQl8MhnEeDjhL0845nSg0s3w== X-Google-Smtp-Source: ABdhPJxM9ZU/ClJ9p7dKBQzIK0Me1DJnv9HnNDHUPT1N+V3eZkVciWLx8AilmJ4PpupEX1oqJQe23w== X-Received: by 2002:a63:464a:: with SMTP id v10mr15010409pgk.393.1610750690991; Fri, 15 Jan 2021 14:44:50 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:42b0:34ff:fe3d:58e6]) by smtp.gmail.com with ESMTPSA id q16sm9131100pfg.139.2021.01.15.14.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:44:50 -0800 (PST) From: Douglas Anderson To: Thierry Reding , Sam Ravnborg Subject: [PATCH v2 3/5] drm/panel-simple: Retry if we timeout waiting for HPD Date: Fri, 15 Jan 2021 14:44:18 -0800 Message-Id: <20210115144345.v2.3.I6916959daa7c5c915e889442268d23338de17923@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210115224420.1635017-1-dianders@chromium.org> References: <20210115224420.1635017-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On an Innolux N116BCA panel that I have in front of me, sometimes HPD simply doesn't assert no matter how long you wait for it. As per the very wise advice of The IT Crowd ("Have you tried turning it off and on again?") it appears that power cycling is enough to kick this panel back into a sane state. From tests on this panel, it appears that leaving it powered off for a while stimulates the problem. Adding a 6 second sleep at the start of panel_simple_prepare_once() makes it happen fairly reliably and, with this delay, I saw up to 3 retries needed sometimes. Without the 6 second sleep, however, the panel came up much more reliably the first time or after only 1 retry. While it's unknown what the problems are with this panel (and probably the hardware should be debugged), adding a few retries to the power on routine doesn't seem insane. Even if this panel's problems are attributed to the fact that it's pre-production and/or can be fixed, retries clearly can help in some cases and really don't hurt. Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd --- Changes in v2: - ("drm/panel-simple: Retry if we timeout waiting for HPD") new for v2. drivers/gpu/drm/panel/panel-simple.c | 32 +++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 30842cf6d414..823177d89d1b 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -376,7 +376,7 @@ static int panel_simple_get_hpd_gpio(struct device *dev, return 0; } -static int panel_simple_prepare(struct drm_panel *panel) +static int panel_simple_prepare_once(struct drm_panel *panel) { struct panel_simple *p = to_panel_simple(panel); unsigned int delay; @@ -422,8 +422,9 @@ static int panel_simple_prepare(struct drm_panel *panel) err = hpd_asserted; if (err) { - dev_err(panel->dev, - "error waiting for hpd GPIO: %d\n", err); + if (err != -ETIMEDOUT) + dev_err(panel->dev, + "error waiting for hpd GPIO: %d\n", err); goto error; } } @@ -440,6 +441,31 @@ static int panel_simple_prepare(struct drm_panel *panel) return err; } +/* + * Some panels simply don't always come up and need to be power cycled to + * work properly. We'll allow for a handful of retries. + */ +#define MAX_PANEL_PREPARE_TRIES 5 + +static int panel_simple_prepare(struct drm_panel *panel) +{ + int ret; + int try; + + for (try = 0; try < MAX_PANEL_PREPARE_TRIES; try++) { + ret = panel_simple_prepare_once(panel); + if (ret != -ETIMEDOUT) + break; + } + + if (ret == -ETIMEDOUT) + dev_err(panel->dev, "Prepare timeout after %d tries\n", try); + else if (try) + dev_warn(panel->dev, "Prepare needed %d retries\n", try); + + return ret; +} + static int panel_simple_enable(struct drm_panel *panel) { struct panel_simple *p = to_panel_simple(panel); From patchwork Fri Jan 15 22:44:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12024283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 425EAC433E6 for ; Fri, 15 Jan 2021 22:45:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 062BC221E2 for ; Fri, 15 Jan 2021 22:45:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 062BC221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8823B8935B; Fri, 15 Jan 2021 22:44:57 +0000 (UTC) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC0876E4AD for ; Fri, 15 Jan 2021 22:44:52 +0000 (UTC) Received: by mail-pg1-x536.google.com with SMTP id n7so6954365pgg.2 for ; Fri, 15 Jan 2021 14:44:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FEhRjbUNCR1Hk02j8Xf/vg8e/9gEkRjaydiv70kLOXo=; b=WtVSiq1xRJf/azOoRgkZu0P+6BgKHV3frEFxWd4je9YJyusVNv13pnUz3hhXDuRGJn /SRt98VRKQnSIBPJO4m7J26UDOsfyCfmsfaLC8NaC4j1M7BpDB3SnUdg8s2+Kz970sAn qSdjRtw4AvTloiTj1OmxODP7o3c3wmo9xiug8= 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=FEhRjbUNCR1Hk02j8Xf/vg8e/9gEkRjaydiv70kLOXo=; b=mAqlrP3MLGgCD1+IEmA1ok5CIob6754NWdA7Z680PIeGqPnxoJZOMSbS+OdCZwuaQ0 OT04wWfmlPCmkLSaonR9ZwoeDt94mEnETF49cSMINU1MYz6hd3x2kcCU2yLliBp/+Ey/ UadQSLvXrIAWekRjmig8CNa67wT3T5pKTH4ffPhU6POTrXnrxBRb4ThlifqjldSsp88+ eg7qOeiyBvQzP5JaKVMjDvNCnQoel1RyckMxL2XsZ4xb8cvaI13ybiQVGH7fPUFIX5FC 6vcNTT6TOwnur3DHXUWasH5RqJ/oXqMxD+WmTVtS54U54Aa0dQ/AwXDayAkBouR4UWyM fu0A== X-Gm-Message-State: AOAM530TzEX/hdD0NJ8OqdX3z7uDhlxrYANCGEGaOv718LPzDtDeRwdv YkCJMzDVyCLz2Ux0hsIRUINxvg== X-Google-Smtp-Source: ABdhPJyKVdXbmgrldR0ZGLdeKMcYo4sYZP34Sje2L0pdmwZnmj3LCoFn7nX19ZSe2u2WkkD81f2X9A== X-Received: by 2002:a63:9811:: with SMTP id q17mr15175105pgd.238.1610750692473; Fri, 15 Jan 2021 14:44:52 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:42b0:34ff:fe3d:58e6]) by smtp.gmail.com with ESMTPSA id q16sm9131100pfg.139.2021.01.15.14.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:44:52 -0800 (PST) From: Douglas Anderson To: Thierry Reding , Sam Ravnborg Subject: [PATCH v2 4/5] dt-bindings: dt-bindings: display: simple: Add N116BCA-EA1 Date: Fri, 15 Jan 2021 14:44:19 -0800 Message-Id: <20210115144345.v2.4.I6889e21811df6adaff5c5b8a8c80fda0669ab3a5@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210115224420.1635017-1-dianders@chromium.org> References: <20210115224420.1635017-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , devicetree@vger.kernel.org, David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd , Rob Herring Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Another simple eDP panel. Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Acked-by: Rob Herring --- Changes in v2: - ("dt-bindings: dt-bindings: display: simple: Add N116BCA-EA1") new for v2. .../devicetree/bindings/display/panel/panel-simple.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml index 35b42ee4ed1d..a2db2a8def15 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml @@ -160,6 +160,8 @@ properties: # Innolux Corporation 12.1" G121X1-L03 XGA (1024x768) TFT LCD panel - innolux,g121x1-l03 # Innolux Corporation 11.6" WXGA (1366x768) TFT LCD panel + - innolux,n116bca-ea1 + # Innolux Corporation 11.6" WXGA (1366x768) TFT LCD panel - innolux,n116bge # InnoLux 13.3" FHD (1920x1080) eDP TFT LCD panel - innolux,n125hce-gn1 From patchwork Fri Jan 15 22:44:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12024281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E1FEC433E0 for ; Fri, 15 Jan 2021 22:45:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FDF1221E2 for ; Fri, 15 Jan 2021 22:45:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FDF1221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9203D893E8; Fri, 15 Jan 2021 22:44:57 +0000 (UTC) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A65189113 for ; Fri, 15 Jan 2021 22:44:54 +0000 (UTC) Received: by mail-pf1-x42a.google.com with SMTP id m6so6412550pfk.1 for ; Fri, 15 Jan 2021 14:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qS78FZ4W8rqLJokNq5ZcTTS18dyO2G9lo8sgbVdLz2w=; b=YBoV0cjHnLMdT8Whco1/3fv7OBbHNm2k319MX/R0wLJYhD6YFdhLQsB5q+WF7XBDXm hRpxkUOt7zqvot1S5epP5UBkcggBnmlR9sN3rudAptlzzphIIuA5m0rOrE7BmI2bsSWd c54c8vQ6mXLKQ73Ela+dyd8ne2TvUqkDhwPjo= 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=qS78FZ4W8rqLJokNq5ZcTTS18dyO2G9lo8sgbVdLz2w=; b=bx2FnPRpbymGCewz62dSBLNUr0+/ex1dAmcU9i0KmC63oV5emcw1urc5VW2yExf1LU K7Fhqq9bsITR3HC77lDR8trhkRjCqIiEOLkyXYpT6DzY5JpnmO6ePxtL82kpRRFJQNtZ 8BUE+OeZ1Xm4gRklVfs4tldZbCb8iuXbwrkuScgQHBItyQ3VY8iuaKESR7c8TtTpp/X/ 6IsGjsI8qWAnm3CV1O3C46td8bFjXJQvxISJ6u7XFdUaxdtE3GiWSUq0LgLhyYngwytw ZQSxFTi11jzVxKOK0RXiAqJGUAWeJdZ6ffiaqyE5egQnMkD9Rrn7IPngmCm72cHDnvcC dfdQ== X-Gm-Message-State: AOAM532Vzz42XwleK44mS66dWoFJEJ1i1OlcNyeB6ekdUmi7IjeSOujU 10ufUevPxlgzqJlIVDJMsdWb6A== X-Google-Smtp-Source: ABdhPJxz7VaGdPquJIeid3tc9J3bmDjLmTag/CY/rmobwMCbN3MNqeLjfBLTBQKNukUJtNI3d/d02Q== X-Received: by 2002:a63:d446:: with SMTP id i6mr15023966pgj.446.1610750693977; Fri, 15 Jan 2021 14:44:53 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:42b0:34ff:fe3d:58e6]) by smtp.gmail.com with ESMTPSA id q16sm9131100pfg.139.2021.01.15.14.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:44:53 -0800 (PST) From: Douglas Anderson To: Thierry Reding , Sam Ravnborg Subject: [PATCH v2 5/5] drm/panel-simple: Add N116BCA-EA1 Date: Fri, 15 Jan 2021 14:44:20 -0800 Message-Id: <20210115144345.v2.5.I3c01f3aab8335cb509da7009d8938c1a27a266dc@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210115224420.1635017-1-dianders@chromium.org> References: <20210115224420.1635017-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This panel is quite similar to the similarly named N116BGE panel (the nominal timings are, in fact identical). However, let's add a new entry because the full range of clocks listed for N116BGE aren't supported for N116BCA-EA1, at least according to the datasheet. Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd --- Changes in v2: - ("drm/panel-simple: Add N116BCA-EA1") new for v2. drivers/gpu/drm/panel/panel-simple.c | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 823177d89d1b..76a1bebaaaf9 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2407,6 +2407,36 @@ static const struct panel_desc innolux_g121x1_l03 = { }, }; +static const struct drm_display_mode innolux_n116bca_ea1_mode = { + .clock = 76420, + .hdisplay = 1366, + .hsync_start = 1366 + 136, + .hsync_end = 1366 + 136 + 30, + .htotal = 1366 + 136 + 30 + 60, + .vdisplay = 768, + .vsync_start = 768 + 8, + .vsync_end = 768 + 8 + 12, + .vtotal = 768 + 8 + 12 + 12, + .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, +}; + +static const struct panel_desc innolux_n116bca_ea1 = { + .modes = &innolux_n116bca_ea1_mode, + .num_modes = 1, + .bpc = 6, + .size = { + .width = 256, + .height = 144, + }, + .delay = { + .hpd_absent_delay = 200, + .prepare_to_enable = 80, + .unprepare = 500, + }, + .bus_format = MEDIA_BUS_FMT_RGB666_1X18, + .connector_type = DRM_MODE_CONNECTOR_eDP, +}; + /* * Datasheet specifies that at 60 Hz refresh rate: * - total horizontal time: { 1506, 1592, 1716 } @@ -4320,6 +4350,9 @@ static const struct of_device_id platform_of_match[] = { }, { .compatible = "innolux,g121x1-l03", .data = &innolux_g121x1_l03, + }, { + .compatible = "innolux,n116bca-ea1", + .data = &innolux_n116bca_ea1, }, { .compatible = "innolux,n116bge", .data = &innolux_n116bge,