From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm: dts: atmel: graph_child_address warning fixes
Date: Tue, 8 May 2018 22:50:00 +0200 [thread overview]
Message-ID: <20180508225000.15c04b69@bbrezillon> (raw)
In-Reply-To: <20180508221819.6b70d5c7@bbrezillon>
On Tue, 8 May 2018 22:18:19 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:
> On Tue, 8 May 2018 08:59:25 -0500
> Rob Herring <robh@kernel.org> 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);
}
next prev parent reply other threads:[~2018-05-08 20:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 13:59 [PATCH] arm: dts: atmel: graph_child_address warning fixes Rob Herring
2018-05-08 13:59 ` [PATCH] arm: dts: imx: fix IPU OF graph endpoint node names Rob Herring
2018-05-08 14:06 ` Fabio Estevam
2018-05-08 15:22 ` Rob Herring
2018-05-11 8:35 ` Shawn Guo
2018-05-08 14:19 ` Philipp Zabel
2018-05-08 15:26 ` Rob Herring
2018-05-08 13:59 ` [PATCH] arm: dts: imx53: Fix LDB OF graph warning Rob Herring
2018-05-08 14:16 ` Philipp Zabel
2018-05-11 8:47 ` Shawn Guo
2018-05-08 13:59 ` [PATCH] arm: dts: imx7: Fix error in coresight TPIU graph connection Rob Herring
2018-05-08 13:59 ` [PATCH] arm: dts: omap: fix OF graph in omap3-devkit8000 Rob Herring
2018-05-15 18:11 ` Tony Lindgren
2018-05-08 13:59 ` [PATCH] arm: dts: omap: fix OMAP3 CM-T3x OF graph video connectors Rob Herring
2018-05-15 18:11 ` Tony Lindgren
2018-05-08 20:18 ` [PATCH] arm: dts: atmel: graph_child_address warning fixes Boris Brezillon
2018-05-08 20:41 ` Rob Herring
2018-05-08 21:00 ` Boris Brezillon
2018-05-08 20:50 ` Boris Brezillon [this message]
2018-05-08 21:04 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180508225000.15c04b69@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).