From patchwork Tue May 8 20:50:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 10387495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 994BF6037F for ; Tue, 8 May 2018 20:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 888A529051 for ; Tue, 8 May 2018 20:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B32F29056; Tue, 8 May 2018 20:51:05 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D87FA29051 for ; Tue, 8 May 2018 20:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KVQEZZ5SX08UAhhSuCOBfzszV1+ukA3dV9Tic9YKymQ=; b=SBFsgmTzKZyOJO S38Xu+MbEdvgiydoq8gE/dJTl1SCERPPEjRZjo65N9vDZl6cPS1AYivBo8Nehd+E8oKPjxVenuHTz jui6LzA/4wNf+otCzB+3+D663EQMNRyEuNrKIUHpzkPRoRatCARCurcforYCy/UKxXjOLoeiru31W OPEZKGC0EKG8kb7M4hTIXUo66PZnUzgjYzEq/kwNBHcnBLE4vfj0kwBIuCMlDhR8WZfq2ttYJsy+t ezuILhNIfSLVC+AKz9rjpdJIs83qGR+mv3Sm9VcOo2L5tljJyR7iI8mM1MNxY1elF9FAPzP+hy7ow e7RGoNLL9iyNIXQVA1ww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fG9ZY-00072P-KW; Tue, 08 May 2018 20:50:56 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fG9Z5-00064d-OQ for linux-arm-kernel@lists.infradead.org; Tue, 08 May 2018 20:50:41 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id E7D7F207CC; Tue, 8 May 2018 22:50:15 +0200 (CEST) Received: from bbrezillon (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id B9A2A20650; Tue, 8 May 2018 22:49:59 +0200 (CEST) Date: Tue, 8 May 2018 22:50:00 +0200 From: Boris Brezillon To: Rob Herring Subject: Re: [PATCH] arm: dts: atmel: graph_child_address warning fixes Message-ID: <20180508225000.15c04b69@bbrezillon> In-Reply-To: <20180508221819.6b70d5c7@bbrezillon> References: <20180508135930.5768-1-robh@kernel.org> <20180508221819.6b70d5c7@bbrezillon> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180508_135028_239971_411A6EBC X-CRM114-Status: GOOD ( 20.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 8 May 2018 22:18:19 +0200 Boris Brezillon wrote: > On Tue, 8 May 2018 08:59:25 -0500 > Rob Herring wrote: > > > Addresses for graph ports and endpoints are not necessary when > > there's only a single child. Fix the following warnings removing > > unnecessary addresses on OF graph nodes: > > > > Warning (graph_child_address): /ahb/apb/hlcdc@f0030000/hlcdc-display-controller: graph node has single child node 'port@0', #address-cells/#size-cells are not necessary > > Warning (graph_child_address): /ahb/apb/hlcdc@f0030000/hlcdc-display-controller/port@0: graph node has single child node 'endpoint', #address-cells/#size-cells are not necessary > > Warning (graph_child_address): /ahb/apb/isi@f0034000/port: graph node has single child node 'endpoint', #address-cells/#size-cells are not necessary > > Warning (graph_child_address): /panel/port@0: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary > > Unfortunately that's not going to work, because the driver calls > drm_of_find_panel_or_bridge() with a positive port and endpoint, > not -1. While we could switch port arg from 0 to -1, that's not that > simple for the endpoint arg, because we don't know in advance how many > devices will be connected to the RGB/DPI port. > > [1]https://elixir.bootlin.com/linux/v4.17-rc3/source/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c#L41 > I can prepare patches containing the following changes, but I need to test them first. To be honest, I still don't see the problem with the "single child having a reg" case. Sure, it's not required, but it's also not an invalid representation. Also note that, depending on the board, we'll have to define addresses in endpoints if there's more than one endpoint, which IMO makes things even harder to follow, because in some cases endpoints will be numbered and in the others they won't. --->8--- diff --git a/Documentation/devicetree/bindings/display/atmel/hlcdc-dc.txt b/Documentation/devicetree/bindings/display/atmel/hlcdc-dc.txt index 82f2acb3d374..bc01c431d624 100644 --- a/Documentation/devicetree/bindings/display/atmel/hlcdc-dc.txt +++ b/Documentation/devicetree/bindings/display/atmel/hlcdc-dc.txt @@ -7,13 +7,12 @@ Required properties: - compatible: value should be "atmel,hlcdc-display-controller" - pinctrl-names: the pin control state names. Should contain "default". - pinctrl-0: should contain the default pinctrl states. - - #address-cells: should be set to 1. - - #size-cells: should be set to 0. Required children nodes: - Children nodes are encoding available output ports and their connections - to external devices using the OF graph reprensentation (see ../graph.txt). - At least one port node is required. + The port node represent the RGB/DPI output and can contain 0 to N endpoints + which encode connections to devices present on the RGB/DPI bus. + These connections are represented using the OF graph representation (see + ../graph.txt). Example: @@ -28,16 +27,9 @@ Example: compatible = "atmel,hlcdc-display-controller"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb888>; - #address-cells = <1>; - #size-cells = <0>; - port@0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - hlcdc_panel_output: endpoint@0 { - reg = <0>; + port { + hlcdc_panel_output: endpoint { remote-endpoint = <&panel_input>; }; }; diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c index 8db51fb131db..0dc8f124a95e 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c @@ -38,7 +38,7 @@ static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint) struct drm_bridge *bridge; int ret; - ret = drm_of_find_panel_or_bridge(dev->dev->of_node, 0, endpoint, + ret = drm_of_find_panel_or_bridge(dev->dev->of_node, -1, endpoint, &panel, &bridge); if (ret) return ret; @@ -86,5 +86,10 @@ int atmel_hlcdc_create_outputs(struct drm_device *dev) if (ret == -ENODEV && endpoint) return 0; - return ret; + /* + * If there's only one endpoint, the reg field will not be specified + * and no specific ID will be attached to this endpoint. Try with + * endpoint = -1 to handle this case. + */ + return atmel_hlcdc_attach_endpoint(dev, -1); }