Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp757379ybz; Wed, 15 Apr 2020 18:17:29 -0700 (PDT) X-Google-Smtp-Source: APiQypJYU42522z/FkFT0kP8B4TZJxxrcKUEIM0Fp/Qnb81S8P7Q3rg3586EVaLxpQktXeyZ73jP X-Received: by 2002:a17:906:cc2:: with SMTP id l2mr7818079ejh.115.1586999849496; Wed, 15 Apr 2020 18:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999849; cv=none; d=google.com; s=arc-20160816; b=iDeoBbqlmU8xfVuWGJZIk7A4/SPp+C5HNDnW0KwXRqLH1YlNzoimQGGMSsp8dkBwCt liyB7TysDiQ/ASad6mNi3YChY0wbxvqmO7JyAg1ghtsB1vIlRnSKGLLrEqAjbEPvXAtW ajFW7Qco1ovFUByWQ+dN9iTu8lYRWqj1DlG1Y7CnOz3RlmZ5EtwtqAdOebztWOyPH3pu R2Bm2sayxT9hPww+vmQDpr4zPWeiwhBeQdacmNb2ohT77RAt4FRw6oRX1JodF0K0B2Iq QcRjiZSSQhevSsjIJ4cT9V1/yAQBPLwP/Gz+T+63L4fB+VoJhQpvvYoQbon/NFKfc/K2 BPkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gkf3HwHM+zXKC5BNl1bJfIsFs9FzPr4tJC1eUsuajAM=; b=dsMSGgCUT1+HyG9RDZNUeReN0vslrMnqUv4Pu26Vu9L2FPKVDB9dUPdqfvTo1k0h90 zyJ5kd1BGtuwYx+rwFJpDcqF2ZiiYUO0YeSrz7WCqRRcrTtJUKAw3AmaNOwic9svWjda dK0BT/3y4PwoBQouBhgR8sfPPxY+yanHbR5tfaVwXZJckfRK4s8cwVpE7Y5Ip2wElowv GwQxrxKLpRaRUaCsDRtFhPiRVkdu3FqZQxiBWLZotbsS6rfDvBBJKnymFdSnI0RueDWo NTj4jhTaR9Dc1GdENdWP2ezGjQxOcYVMjqEptQMwRXWrYQ1gLuCp9uL2TQqgajT9s4tm 4OLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=locygWHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm27si693879edb.49.2020.04.15.18.17.06; Wed, 15 Apr 2020 18:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=locygWHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405321AbgDPAyd (ORCPT + 99 others); Wed, 15 Apr 2020 20:54:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405170AbgDPAy0 (ORCPT ); Wed, 15 Apr 2020 20:54:26 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 900CFC061A0C; Wed, 15 Apr 2020 17:54:25 -0700 (PDT) Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1FE639CE; Thu, 16 Apr 2020 02:54:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1586998462; bh=dZMu091chEyqroFKiISuS3a3zyFSmf1eCaPuRd8WZVY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=locygWHL2WF1Ca6qoSa6yVUf3P0xH4QJioRzvG/rX2BlbeKwenhKLMB6syGrJAIYh 561P+rcQu4eJrG8FDeUW3A5XHYuOw3K+vfGhLgI0/MoeWeABHwQFwPTIZu4+Fg694D hlbQ9RnS3NKvnX8hMsjovvOtfdJ34+YTwwOogorU= Date: Thu, 16 Apr 2020 03:54:09 +0300 From: Laurent Pinchart To: Doug Anderson Cc: Stephen Boyd , Andrzej Hajda , David Airlie , Daniel Vetter , Neil Armstrong , Rob Herring , Sandeep Panda , Jonas Karlman , Bjorn Andersson , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Jeffrey Hugo , Jernej Skrabec , linux-arm-msm , Rob Clark , dri-devel , LKML Subject: Re: [PATCH 2/3] dt-bindings: drm/bridge: ti-sn65dsi86: Add hpd-gpios to the bindings Message-ID: <20200416005409.GR4758@pendragon.ideasonboard.com> References: <20200415084758.1.Ifcdc4ecb12742a27862744ee1e8753cb95a38a7f@changeid> <20200415084758.2.Ic98f6622c60a1aa547ed85781f2c3b9d3e56b734@changeid> <158698038289.105027.2860892334897893887@swboyd.mtv.corp.google.com> <20200415203256.GP4758@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Doug, On Wed, Apr 15, 2020 at 04:49:00PM -0700, Doug Anderson wrote: > On Wed, Apr 15, 2020 at 1:33 PM Laurent Pinchart wrote: > > On Wed, Apr 15, 2020 at 12:53:02PM -0700, Stephen Boyd wrote: > > > Quoting Douglas Anderson (2020-04-15 08:48:40) > > > > Allow people to specify to use a GPIO for hot-plug-detect. Add an > > > > example. > > > > > > > > NOTE: The current patch adding support for hpd-gpios to the Linux > > > > driver for hpd-gpios only adds enough support to the driver so that > > > > the bridge can use one of its own GPIOs. The bindings, however, are > > > > written generically. > > > > > > > > Signed-off-by: Douglas Anderson > > > > --- > > > > > > > > .../bindings/display/bridge/ti,sn65dsi86.yaml | 10 +++++++++- > > > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml > > > > index 8cacc6db33a9..554bfd003000 100644 > > > > --- a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml > > > > +++ b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml > > > > @@ -60,6 +60,10 @@ properties: > > > > const: 1 > > > > description: See ../../pwm/pwm.yaml for description of the cell formats. > > > > > > > > + hpd-gpios: > > > > + maxItems: 1 > > > > + description: If present use the given GPIO for hot-plug-detect. > > > > > > Shouldn't this go in the panel node? And the panel driver should get the > > > gpio and poll it after powering up the panel? Presumably that's why we > > > have the no-hpd property in the simple panel binding vs. putting it here > > > in the bridge. > > > > Same question really, I think this belongs to the panel (or connector) > > node indeed. > > Hrm. > > To me "no-hpd" feels OK in the panel because the lack of a connection > is somewhat symmetric. Thus it's OK to say either "HPD isn't hooked > up to the panel in this system" or "HPD isn't hooked up to the bridge > in this system" and both express the same thing (AKA that there is no > HPD connection between the bridge and the panel). In the case of > "no-hpd" it's more convenient to express it on the panel side because > the panel driver is the one whose behavior has to change if HPD isn't > hooked up. The panel datasheet is the one that says how long of a > delay we need if HPD isn't hooked up. > > ...but when you're talking about where the bridge driver should look > to find the HPD signal that it needs, that really feels like it should > be described as part of the bridge. Specifically imagine we were > using our bridge for DP, not for eDP. In that case simple-panel > wouldn't be involved because we could get any type of display plugged > in. Thus it couldn't go in the panel node. Here it feels clearer > that hpd-gpio needs to be a property of the bridge driver. If you were using it for DP, you would need a DT node for the DP connector (with bindings to be added to Documentation/devicetree/bindings/display/connector/, similar to the ones we already have for other connectors). That DT node should reference the HPD pin GPIO. The bridge driver for the connector (drivers/gpu/drm/bridge/display-connector.c) would then handle HPD. The good news is that it already does :-) > Looking at other usages of "hpd-gpio" in the kernel, it seems like the > usage I'm proposing is also common. Grepping for "hpd-gpios" shows > numerous examples of "hpd-gpios" being defined at the display > controller level and (effectively) I believe the bridge is at the > equivalent level. Bridge drivers should only implement support for features available from the corresponding hardware. If an HPD signal is connected to a dedicated pin of the bridge, and the bridge can generate an interrupt and expose the HPD status through I2C, then it should implement HPD-related operations. If the HPD pin from the connector is hooked up to a GPIO of the SoC, it should be handled by the connector bridge driver. -- Regards, Laurent Pinchart