diff mbox

[1/7] Documentation: of: add type property

Message ID 87eg7nxr00.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto June 24, 2016, 2:32 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

OF graph is used mainly from V4L2, but ALSA needs to use it too.
Then, ALSA needs to know each port/endpoint type, otherwise it
can't detect ALSA port/endpoint correctly.
This patch enables to use type property on OF graph.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 Documentation/devicetree/bindings/graph.txt | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

Rob Herring June 24, 2016, 5:41 p.m. UTC | #1
On Thu, Jun 23, 2016 at 9:32 PM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> OF graph is used mainly from V4L2, but ALSA needs to use it too.
> Then, ALSA needs to know each port/endpoint type, otherwise it
> can't detect ALSA port/endpoint correctly.

Bindings should be defined in terms of hardware, not Linux subsystems.

> This patch enables to use type property on OF graph.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  Documentation/devicetree/bindings/graph.txt | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/graph.txt b/Documentation/devicetree/bindings/graph.txt
> index fcb1c6a..b5b9040 100644
> --- a/Documentation/devicetree/bindings/graph.txt
> +++ b/Documentation/devicetree/bindings/graph.txt
> @@ -110,6 +110,32 @@ device-2 {
>          };
>  };
>
> +port / endpoint type
> +--------------------
> +
> +Each ports / port / endpoint can have its type if needed.

I think type should only apply to a port. ports is only a grouping for
multiple ports. endpoints are just the connection. A port is a single
data flow, so 2 endpoints on a port reflect 2 possible connections for
that data flow.

> +child node can take over parent node type. below example indicates
> +device0 type is "typeA" && "typeB",
> +device1 type is "typeA" && "typeB" && "typeC".

This does not make sense to me. A concrete example perhaps using HDMI
audio would be helpful.

> +
> +device {
> +       ports {
> +               type = "typeA";
> +
> +               port@0 {
> +                       type = "typeB";
> +
> +                       device0: endpoint@0 {
> +                       };
> +
> +                       device1: endpoint@1 {
> +                               type = "typeC";
> +                       };
> +               };
> +               ...
> +       };
> +};
> +
>
>  Required properties
>  -------------------
> --
> 1.9.1
>
Kuninori Morimoto June 27, 2016, 12:09 a.m. UTC | #2
Hi Rob

Thank you for your review

> > +Each ports / port / endpoint can have its type if needed.
> 
> I think type should only apply to a port. ports is only a grouping for
> multiple ports. endpoints are just the connection. A port is a single
> data flow, so 2 endpoints on a port reflect 2 possible connections for
> that data flow.
> 
> > +child node can take over parent node type. below example indicates
> > +device0 type is "typeA" && "typeB",
> > +device1 type is "typeA" && "typeB" && "typeC".
> 
> This does not make sense to me. A concrete example perhaps using HDMI
> audio would be helpful.

"type" on "port" only is OK. I will fix that.

Multi type feature (= take over from parent) and type on "endpoint"
is not urgent at this point, so I will drop these in v2.
I just thought that it will be necessary in the future.
Kuninori Morimoto June 27, 2016, 1:14 a.m. UTC | #3
Hi Rob, Laurent

> > > +Each ports / port / endpoint can have its type if needed.
> > 
> > I think type should only apply to a port. ports is only a grouping for
> > multiple ports. endpoints are just the connection. A port is a single
> > data flow, so 2 endpoints on a port reflect 2 possible connections for
> > that data flow.
> > 
> > > +child node can take over parent node type. below example indicates
> > > +device0 type is "typeA" && "typeB",
> > > +device1 type is "typeA" && "typeB" && "typeC".
> > 
> > This does not make sense to me. A concrete example perhaps using HDMI
> > audio would be helpful.
> 
> "type" on "port" only is OK. I will fix that.
> 
> Multi type feature (= take over from parent) and type on "endpoint"
> is not urgent at this point, so I will drop these in v2.
> I just thought that it will be necessary in the future.

In HDMI case, which one is better DT ?

	port@0 {
		type = "video";
                endpoint {
                        remote-endpoint = <&xxx>;
                };
	};
	port@1 {
		type = "sound";
                endpoint {
                        remote-endpoint = <&xxx>;
                };
	};

or

	port {
                endpoint {
			type = "video";
                        remote-endpoint = <&xxx>;
                };
                endpoint {
			type = "sound";
                        remote-endpoint = <&xxx>;
                };
	};

If 2nd one is better, type on endpoint is needed.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/graph.txt b/Documentation/devicetree/bindings/graph.txt
index fcb1c6a..b5b9040 100644
--- a/Documentation/devicetree/bindings/graph.txt
+++ b/Documentation/devicetree/bindings/graph.txt
@@ -110,6 +110,32 @@  device-2 {
         };
 };
 
+port / endpoint type
+--------------------
+
+Each ports / port / endpoint can have its type if needed.
+child node can take over parent node type. below example indicates
+device0 type is "typeA" && "typeB",
+device1 type is "typeA" && "typeB" && "typeC".
+
+device {
+	ports {
+		type = "typeA";
+
+		port@0 {
+			type = "typeB";
+
+			device0: endpoint@0 {
+			};
+
+			device1: endpoint@1 {
+				type = "typeC";
+			};
+		};
+		...
+	};
+};
+
 
 Required properties
 -------------------