Skip to contentSkip to conversation

dt-bindings: display: bridge: nxp, tda998x: Json-schema conversion and fixes

PATCH Superseded Geert Uytterhoeven 4 participants 10 messages Oct 21, 2021 – Oct 29, 2021

Subsystems (5)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

cover dt-bindings: display: bridge: nxp, tda998x: Json-schema conversion and fixes

Hi all,

This patch series converts the NXP TDA998x HDMI transmitter Device Tree binding documentation to json-schema, after a few customary fixes.

Thanks for your comments!

Geert Uytterhoeven (3):
ARM: dts: am335x: Fix TDA998x ports addressing [RFC] arm64: dts: renesas: cat874: Drop bogus clocks property [RFC] dt-bindings: display: bridge: nxp,tda998x: Convert to
json-schema

 .../bindings/display/bridge/nxp,tda998x.yaml  | 108 ++++++++++++++++++
 .../bindings/display/bridge/tda998x.txt       |  54 ---------
 arch/arm/boot/dts/am335x-boneblack-hdmi.dtsi  |   7 +-
 arch/arm/boot/dts/am335x-myirtech-myd.dts     |   7 +-
 .../boot/dts/renesas/r8a774c0-cat874.dts      |   1 -
 5 files changed, 120 insertions(+), 57 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/bridge/tda998x.txt
Signature · 12 lines
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH 1/3 ARM: dts: am335x: Fix TDA998x ports addressing

Fix addressing in the NXP TDA998x HDMI transmitters' subnodes:
- Add missing #{address,size}-cells properties to ports capsule,
- Add missing reg properties to port child nodes,
- Drop bogus unit addresses from endpoint grandchildren nodes.

---
 arch/arm/boot/dts/am335x-boneblack-hdmi.dtsi | 7 ++++++-
 arch/arm/boot/dts/am335x-myirtech-myd.dts    | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
arch/arm/boot/dts/am335x-boneblack-hdmi.dtsi +6 -1
index 7cfddada934861bc..486f24deb875c688 100644
@@ -85,8 +85,13 @@ tda19988: tda19988@70 {
 		audio-ports = <	TDA998x_I2S	0x03>;
 
 		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
 			port@0 {
-				hdmi_0: endpoint@0 {
+				reg = <0>;
+
+				hdmi_0: endpoint {
 					remote-endpoint = <&lcdc_0>;
 				};
 			};
arch/arm/boot/dts/am335x-myirtech-myd.dts +6 -1
index 1479fd95dec2441c..4120bfb351bd9e69 100644
@@ -161,8 +161,13 @@ tda9988: tda9988@70 {
 		#sound-dai-cells = <0>;
 
 		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
 			port@0 {
-				hdmi_0: endpoint@0 {
+				reg = <0>;
+
+				hdmi_0: endpoint {
 					remote-endpoint = <&lcdc_0>;
 				};
 			};
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

RFC PATCH 2/3 arm64: dts: renesas: cat874: Drop bogus clocks property

In reply to Geert Uytterhoeven

The NXP TDA998x HDMI transmitter Device Tree binding documentation does not mention a clocks property.

---
Is this property just missing from the bindings?
The driver doesn't seem to use it.

---
 arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts | 1 -
 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts +0 -1
index 4e72e4f2bab055a5..c6fb684814bc290e 100644
@@ -239,7 +239,6 @@ tda19988: tda19988@70 {
 
 		#sound-dai-cells = <0>;
 		audio-ports = <TDA998x_I2S 0x03>;
-		clocks = <&rcar_sound 1>;
 
 		ports {
 			#address-cells = <1>;
Signature · 1 line
2.25.1
author maintainer
#3 lore raw

RFC PATCH 3/3 dt-bindings: display: bridge: nxp, tda998x: Convert to json-schema

In reply to Geert Uytterhoeven

Convert the NXP TDA998x HDMI transmitter Device Tree binding documentation to json-schema.

Add missing "#sound-dai-cells" property.
Add ports hierarchy, as an alternative to port. Drop pinctrl properties, as they do not belong here.

---
RFC as I do not know:
1. The correct value(s) for '#sound-dai-cells' (the example used 2, which was IMHO wrong, while all actual users use 0),
2. The meaning of the various ports subnodes.

---
 .../bindings/display/bridge/nxp,tda998x.yaml  | 108 ++++++++++++++++++
 .../bindings/display/bridge/tda998x.txt       |  54 ---------
 2 files changed, 108 insertions(+), 54 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/bridge/tda998x.txt
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +108 -0
new file mode 100644
index 0000000000000000..87c64edcf5d5617d
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/nxp,tda998x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP TDA998x HDMI transmitter
+
+maintainers:
+  - Russell King <[email protected]>
+
+properties:
+  compatible:
+    const: nxp,tda998x
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  video-ports:
+    default: 0x230145
+    description:
+      24 bits value which defines how the video controller output is wired to
+      the TDA998x input.
+
+  audio-ports:
+    description:
+      Array of 8-bit values, 2 values per DAI (Documentation/sound/soc/dai.rst).
+      The implementation allows one or two DAIs.
+      If two DAIs are defined, they must be of different type.
+    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+    items:
+      minItems: 1
+      maxItems: 2
+      items:
+        - description: |
+            The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S
+            (see include/dt-bindings/display/tda998x.h).
+        - description:
+            The second value defines the tda998x AP_ENA reg content when the
+            DAI in question is used.
+
+  '#sound-dai-cells':
+    enum: [ 0, 1 ]
+
+  nxp,calib-gpios:
+    maxItems: 1
+    description:
+      Calibration GPIO, which must correspond with the gpio used for the
+      TDA998x interrupt pin.
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        type: object
+        description: FIXME
+
+      port@1:
+        type: object
+        description: FIXME
+
+required:
+  - compatible
+  - reg
+
+oneOf:
+  - required:
+      - port
+  - required:
+      - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/display/tda998x.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        tda998x: hdmi-encoder@70 {
+            compatible = "nxp,tda998x";
+            reg = <0x70>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
+            video-ports = <0x230145>;
+
+            #sound-dai-cells = <1>;
+                         /* DAI-format / AP_ENA reg value */
+            audio-ports = <TDA998x_SPDIF 0x04>,
+                          <TDA998x_I2S 0x03>;
+
+            port {
+                tda998x_in: endpoint {
+                    remote-endpoint = <&lcdc_0>;
+                };
+            };
+        };
+    };
Documentation/devicetree/bindings/display/bridge/tda998x.txt deleted +0 -54

54 lines not on this page · raw message

Signature · 1 line
2.25.1
maintainer
#4 lore raw

Re: [PATCH 3/3] [RFC] dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema

Quoted 42 lines · Geert Uytterhoeven

Convert the NXP TDA998x HDMI transmitter Device Tree binding documentation to json-schema.

Add missing "#sound-dai-cells" property.
Add ports hierarchy, as an alternative to port. Drop pinctrl properties, as they do not belong here.

---
RFC as I do not know:
1. The correct value(s) for '#sound-dai-cells' (the example used 2, which was IMHO wrong, while all actual users use 0),
2. The meaning of the various ports subnodes.

---
 .../bindings/display/bridge/nxp,tda998x.yaml  | 108 ++++++++++++++++++
 .../bindings/display/bridge/tda998x.txt       |  54 ---------
 2 files changed, 108 insertions(+), 54 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/bridge/tda998x.txt
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +16 -0
new file mode 100644
index 0000000000000000..87c64edcf5d5617d
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/nxp,tda998x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP TDA998x HDMI transmitter
+
+maintainers:
+  - Russell King <[email protected]>
+
+properties:
+  compatible:
+    const: nxp,tda998x
+
+  reg:

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +10 -0
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  video-ports:
+    default: 0x230145
+    description:
+      24 bits value which defines how the video controller output is wired to
+      the TDA998x input.

maximum: 0xffffff

(at least...)

Quoted 27 lines
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +27 -0
+
+  audio-ports:
+    description:
+      Array of 8-bit values, 2 values per DAI (Documentation/sound/soc/dai.rst).
+      The implementation allows one or two DAIs.
+      If two DAIs are defined, they must be of different type.
+    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+    items:
+      minItems: 1
+      maxItems: 2
+      items:
+        - description: |
+            The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S
+            (see include/dt-bindings/display/tda998x.h).
+        - description:
+            The second value defines the tda998x AP_ENA reg content when the
+            DAI in question is used.
+
+  '#sound-dai-cells':
+    enum: [ 0, 1 ]
+
+  nxp,calib-gpios:
+    maxItems: 1
+    description:
+      Calibration GPIO, which must correspond with the gpio used for the
+      TDA998x interrupt pin.
+

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml line 63

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +10 -0
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        type: object
+        description: FIXME

Looks like the input from the example

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml line 67

Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +4 -0
+
+      port@1:
+        type: object
+        description: FIXME

Presumably the output to connector or another bridge.

Quoted 41 lines
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +41 -0
+
+required:
+  - compatible
+  - reg
+
+oneOf:
+  - required:
+      - port
+  - required:
+      - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/display/tda998x.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        tda998x: hdmi-encoder@70 {
+            compatible = "nxp,tda998x";
+            reg = <0x70>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
+            video-ports = <0x230145>;
+
+            #sound-dai-cells = <1>;
+                         /* DAI-format / AP_ENA reg value */
+            audio-ports = <TDA998x_SPDIF 0x04>,
+                          <TDA998x_I2S 0x03>;
+
+            port {
+                tda998x_in: endpoint {
+                    remote-endpoint = <&lcdc_0>;
+                };
+            };
+        };
+    };
#5 lore raw

Re: [PATCH 3/3] [RFC] dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema

Quoted 6 lines · Rob Herring

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml line 63

Quoted 4 lines · Geert Uytterhoeven
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +4 -0
+    properties:
+      port@0:
+        type: object
+        description: FIXME
Quoted 8 lines

Looks like the input from the example

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml line 67

Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +4 -0
+
+      port@1:
+        type: object
+        description: FIXME

Presumably the output to connector or another bridge.

This is changing the binding. The original had:

Required node:
- port: Input port node with endpoint definition, as described in Documentation/devicetree/bindings/graph.txt

The above change appears to require that tda998x now has two ports. This goes against current usage in DT and the example.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#6 lore raw

Re: [PATCH 3/3] [RFC] dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema

Hi Russell,

Thanks for your comments!

Quoted 14 lines · Russell King (Oracle)
Quoted 13 lines · Rob Herring

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml line 63

Quoted 4 lines · Geert Uytterhoeven
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +4 -0
+    properties:
+      port@0:
+        type: object
+        description: FIXME

Looks like the input from the example

Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +4 -0
+
+      port@1:
+        type: object
+        description: FIXME
Quoted 7 lines
Quoted 1 line

Presumably the output to connector or another bridge.

This is changing the binding. The original had:

Required node:
- port: Input port node with endpoint definition, as described in Documentation/devicetree/bindings/graph.txt

Indeed, cfr. "Add ports hierarchy, as an alternative to port." in the patch description. Some users use port, other use ports with one or two port subnodes.

Quoted 1 line

The above change appears to require that tda998x now has two ports.

No, you can still use port:

+oneOf:
+ - required:
+ - port
+ - required:
+ - ports

When using ports, no further requirements are set, but perhaps port@0 should be made required in that case?

Quoted 1 line

This goes against current usage in DT and the example.

The original example didn't even have the original required input port node, so it was incomplete.

arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts has two port subnodes. Is that wrong?

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#7 lore raw

Re: [PATCH 3/3] [RFC] dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema

Quoted 12 lines · Geert Uytterhoeven

Hi Russell,

Thanks for your comments!

No, you can still use port:

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +5 -0
+oneOf:
+  - required:
+      - port
+  - required:
+      - ports
Quoted 2 lines

When using ports, no further requirements are set, but perhaps port@0 should be made required in that case?

Maybe I don't understand the binding description then, but to me it looks like you require both port@0 and port@1.

The reality of the driver is that it makes almost no use of the graph itself, except via drm_of_find_possible_crtcs() to find the connected CRTCs. If it is connected to an I2S source, then it probably needs a port specification for that. If someone wants to describe the HDMI connector (which I don't see any point in) then they likely need a port specification for that too. However, the driver itself doesn't care about any of those.

So, describing the port nodes makes no sense.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#8 lore raw

Re: [PATCH 3/3] [RFC] dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema

Hi Russell,

Quoted 9 lines · Russell King (Oracle)
Quoted 8 lines · Geert Uytterhoeven

No, you can still use port:

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +5 -0
+oneOf:
+  - required:
+      - port
+  - required:
+      - ports
Quoted 5 lines
Quoted 2 lines

When using ports, no further requirements are set, but perhaps port@0 should be made required in that case?

Maybe I don't understand the binding description then, but to me it looks like you require both port@0 and port@1.

"make dtbs_check" disagrees.

Quoted 5 lines

The reality of the driver is that it makes almost no use of the graph itself, except via drm_of_find_possible_crtcs() to find the connected CRTCs. If it is connected to an I2S source, then it probably needs a port specification for that. If someone wants to describe the HDMI connector (which I don't see any point in) then they likely need a

I can't comment on the point of describing the HDMI connector.

Quoted 2 lines

port specification for that too. However, the driver itself doesn't care about any of those.

DT describes hardware, not software limitations.

Quoted 1 line

So, describing the port nodes makes no sense.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#9 lore raw

Re: [PATCH 3/3] [RFC] dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema

Quoted 27 lines · Geert Uytterhoeven

Hi Russell,

Quoted 9 lines · Russell King (Oracle)
Quoted 8 lines · Geert Uytterhoeven

No, you can still use port:

Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml new file +5 -0
+oneOf:
+  - required:
+      - port
+  - required:
+      - ports
Quoted 5 lines
Quoted 2 lines

When using ports, no further requirements are set, but perhaps port@0 should be made required in that case?

Maybe I don't understand the binding description then, but to me it looks like you require both port@0 and port@1.

"make dtbs_check" disagrees.

Quoted 5 lines

The reality of the driver is that it makes almost no use of the graph itself, except via drm_of_find_possible_crtcs() to find the connected CRTCs. If it is connected to an I2S source, then it probably needs a port specification for that. If someone wants to describe the HDMI connector (which I don't see any point in) then they likely need a

Quoted 6 lines

I can't comment on the point of describing the HDMI connector.

Quoted 2 lines

port specification for that too. However, the driver itself doesn't care about any of those.

DT describes hardware, not software limitations.

Sigh. There's no point discussing this further, my replies seem to be interpreted out of context.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!