Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp228905imd; Fri, 26 Oct 2018 07:42:21 -0700 (PDT) X-Google-Smtp-Source: AJdET5efvyPG56OEK8dy2V57xUzZOpqVgkYuh24iGhWiwQ1phqrzBq/I/sNR5roGQkMv2/94pNnp X-Received: by 2002:a17:902:187:: with SMTP id b7-v6mr3819979plb.150.1540564941573; Fri, 26 Oct 2018 07:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540564941; cv=none; d=google.com; s=arc-20160816; b=eCwGgDxUypy3fVIH81VnuQvojOk/FRSsp2HuFzlqUx6QparWKn5rBP258objHKKI2d 1LYfscmsyYg6AopBSQLaFxQKt6V3mCA7Er6RUTRWieIGOkpdwuhD4HRmMLRB96JA2cV4 1eUaDk6elExr3nWFxviGxls4+D95GH81xMDXsmEhEPamo6z6V3J9zXwarGtQSabGOslF 7k4WYugBGuvx0kA2Hme0xx/VEwGTFd+DQwdnhN1x7a4ezAgFIKlnMU2hJ7tmR0BIcpuT eL2n4Cf9X6Tbp12j065xYgiCeVc12qezs98Nh3H27bEPCMuIUvMOvaPf8nqfjoRFMe8w LphA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4rWocgZUZH13alrf4EYBNLvZ2MHFKWSIWjZQCH2V3n4=; b=zQ2zjwW0i7XjjfbGTBWPsgGWEL7/zuz1FmAyFMJiWOtoOGZArLOlh3XFilALbCmeIB +PAZjPSmKEQ0udz9CZVrWYwtd7OUdX2lks0vrlmMj8XUFBlXIWlQo9xhicn6iJlZmhxP i54BRG3FNco+RUUD3ude6qtzO+GeJrV0AZeZ4PtiQ84003IBBK6Z/sdUs/1bm4ZBJC6a cEyRUwRKTmetigWR/P9eFSaYubhZ1flb17lUjR6Ak/CbTx27sZ3CDmEfpCxwmurh+tPy 6W54Mf25ze4O3EgIoAn7SWpjauQsfLaDVdkcZPnupP9oGTBUZw1uQPEDELAZt6R+pY7w qZwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b="KQ/NiBdC"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si12045452pfx.105.2018.10.26.07.42.05; Fri, 26 Oct 2018 07:42:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b="KQ/NiBdC"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727580AbeJZXSd (ORCPT + 99 others); Fri, 26 Oct 2018 19:18:33 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:45930 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726113AbeJZXSd (ORCPT ); Fri, 26 Oct 2018 19:18:33 -0400 Received: by mail-yb1-f193.google.com with SMTP id 131-v6so544152ybe.12 for ; Fri, 26 Oct 2018 07:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4rWocgZUZH13alrf4EYBNLvZ2MHFKWSIWjZQCH2V3n4=; b=KQ/NiBdCk9OiBO+oXy5jpCPo9jJK7y7MTMsjJDZscX/qvIjIBm3ZtEnD21WMz5fksw 7i3Z4MV4kM+BVW5xfSYWjNN3vKGkJpeWVKqz1pbBXscKgnzCJcy37bLQ7soEfdmzziyv okDjvui8Z4SrPxGLJDCT+D/mcQyfN76rftx/wM25B9eDX+LZy5ILWhYk/DHpsgk7Xih0 +L69enI2U4Tc1/1AacAMiVsRFAUO6Fo+UsoluG7TqgJklixAnFuZDAd7QApDjDgGk21+ VlrXpncf9/Bi3wT2dZ9EeVPPp8QmW80FD5PSdho+qZzc+8tA1CesJTDWBan52ufEBnof ehog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4rWocgZUZH13alrf4EYBNLvZ2MHFKWSIWjZQCH2V3n4=; b=O6+wzakwlo9FDQt95uK1d5qqYhnE00FPRtSzBAYd3NyEzVleSdVebuo/D4jWokkuzG G62Otx0yYyWX3c7xVhnQ3iUV9XC35bsUWGhWk+IhVEgst6d+Iqr1cSfCN9mq1VVvfUnR cW3NXWuHue+KYNvUdSeT/WFEatbxIQoD0RFHYdMSfOf19bmZAli33swLwtZJ3ZNM6R34 ZE2l+ZLP6Y2AM3La3+KetgIpadlX4+Dwo9N9AB1P9Y97wKumA3ZFxoaFJfgBTHWl0XLa sufHBdwpQiTX7LCLfdHj6v6zYuPoGf5AMw1LYi7Hk0jb9Gcpuo3Xs9zAuL0pUhtlMwLe ASVA== X-Gm-Message-State: AGRZ1gIfKmVepUs9p39N+D31tay/z1sAMnu/wXSQxtMzyrAllv329Wo6 cQ5oqTHjATSot7WfNXJsuVb0/g== X-Received: by 2002:a25:bb09:: with SMTP id z9-v6mr3639853ybg.87.1540564873335; Fri, 26 Oct 2018 07:41:13 -0700 (PDT) Received: from localhost ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id t81-v6sm3085017ywb.90.2018.10.26.07.41.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Oct 2018 07:41:12 -0700 (PDT) Date: Fri, 26 Oct 2018 10:41:11 -0400 From: Sean Paul To: Douglas Anderson Cc: Sean Paul , Thierry Reding , Sandeep Panda , linux-arm-msm@vger.kernel.org, Laurent Pinchart , jsanka@codeaurora.org, ryandcase@chromium.org, David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/6] drm/panel: simple: Support panels with HPD where HPD isn't connected Message-ID: <20181026144111.GQ154160@art_vandelay> References: <20181025222134.174583-1-dianders@chromium.org> <20181025222134.174583-2-dianders@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181025222134.174583-2-dianders@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 25, 2018 at 03:21:30PM -0700, Douglas Anderson wrote: > 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 Reviewed-by: Sean Paul > --- > > Changes in v2: > - Use "hpd_absent_delay" property instead of a bool + prepare delay > > drivers/gpu/drm/panel/panel-simple.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c > index 97964f7f2ace..687fd087b9fc 100644 > --- a/drivers/gpu/drm/panel/panel-simple.c > +++ b/drivers/gpu/drm/panel/panel-simple.c > @@ -56,6 +56,8 @@ struct panel_desc { > /** > * @prepare: the time (in milliseconds) that it takes for the panel to > * become ready and start receiving video data > + * @hpd_absent_delay: Add this to the prepare delay if we know Hot > + * Plug Detect isn't used. > * @enable: the time (in milliseconds) that it takes for the panel to > * display the first valid frame after starting to receive > * video data > @@ -66,6 +68,7 @@ struct panel_desc { > */ > struct { > unsigned int prepare; > + unsigned int hpd_absent_delay; > unsigned int enable; > unsigned int disable; > unsigned int unprepare; > @@ -79,6 +82,7 @@ struct panel_simple { > struct drm_panel base; > bool prepared; > bool enabled; > + bool no_hpd; > > const struct panel_desc *desc; > > @@ -202,6 +206,7 @@ static int panel_simple_unprepare(struct drm_panel *panel) > static int panel_simple_prepare(struct drm_panel *panel) > { > struct panel_simple *p = to_panel_simple(panel); > + unsigned int delay; > int err; > > if (p->prepared) > @@ -215,8 +220,11 @@ static int panel_simple_prepare(struct drm_panel *panel) > > gpiod_set_value_cansleep(p->enable_gpio, 1); > > - if (p->desc->delay.prepare) > - msleep(p->desc->delay.prepare); > + delay = p->desc->delay.prepare; > + if (p->no_hpd) > + delay += p->desc->delay.hpd_absent_delay; > + if (delay) > + msleep(delay); > > p->prepared = true; > > @@ -305,6 +313,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 > -- Sean Paul, Software Engineer, Google / Chromium OS