Skip to contentSkip to conversation

Convert Rockchip CDN DP binding to yaml

PATCH Superseded Chaoyi Chen 5 participants 9 messages May 9, 2025

Subsystems (5)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover Convert Rockchip CDN DP binding to yaml

From: Chaoyi Chen <[email protected]>

This series convert cdn-dp-rockchip.txt to yaml.

PATCH 1 try to improve coding style on the existing rk3399 cdn-dp node.
PATCH 2 try to convert cdn-dp-rockchip.txt to yaml.

Changes in v2:
- Link to V1: https://lore.kernel.org/all/[email protected]/
- Rename binding file name to match compatible
- Add more description about grf/phy/extcon
- Fix coding style

Chaoyi Chen (2):
arm64: dts: rockchip: Improve coding style for rk3399 cdn_dp
dt-bindings: display: rockchip: Convert cdn-dp-rockchip.txt to yaml

 .../display/rockchip/cdn-dp-rockchip.txt      |  74 --------
 .../rockchip/rockchip,rk3399-cdn-dp.yaml      | 158 ++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3399-base.dtsi |  10 +-
 3 files changed, 167 insertions(+), 75 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt
 create mode 100644 Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml

--
2.49.0

#1 lore raw

PATCH v2 1/2 arm64: dts: rockchip: Improve coding style for rk3399 cdn_dp

From: Chaoyi Chen <[email protected]>

Let's make the ports nodes of cdn_dp in the same style as the other display interface, and match the style of ports's yaml.

---

(no changes since v1)

 arch/arm64/boot/dts/rockchip/rk3399-base.dtsi | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-base.dtsi +9 -1
index 9d5f5b083e3c..e340b6df7445 100644
@@ -618,7 +618,11 @@ cdn_dp: dp@fec00000 {
 		status = "disabled";
 
 		ports {
-			dp_in: port {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			dp_in: port@0 {
+				reg = <0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 
@@ -632,6 +636,10 @@ dp_in_vopl: endpoint@1 {
 					remote-endpoint = <&vopl_out_dp>;
 				};
 			};
+
+			dp_out: port@1 {
+				reg = <1>;
+			};
 		};
 	};
 

--
2.49.0

#2 lore raw

PATCH v2 2/2 dt-bindings: display: rockchip: Convert cdn-dp-rockchip.txt to yaml

In reply to Chaoyi Chen

From: Chaoyi Chen <[email protected]>

Convert cdn-dp-rockchip.txt to yaml.

---

Changes in v2:
- Rename binding file name to match compatible
- Add more description about grf/phy/extcon
- Fix coding style

 .../display/rockchip/cdn-dp-rockchip.txt      |  74 --------
 .../rockchip/rockchip,rk3399-cdn-dp.yaml      | 158 ++++++++++++++++++
 2 files changed, 158 insertions(+), 74 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt
 create mode 100644 Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml
Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt deleted +0 -74
deleted file mode 100644
index 8df7d2e393d6..000000000000
@@ -1,74 +0,0 @@
-Rockchip RK3399 specific extensions to the cdn Display Port
-================================
-
-Required properties:
-- compatible: must be "rockchip,rk3399-cdn-dp"
-
-- reg: physical base address of the controller and length
-
-- clocks: from common clock binding: handle to dp clock.
-
-- clock-names: from common clock binding:
-	       Required elements: "core-clk" "pclk" "spdif" "grf"
-
-- resets : a list of phandle + reset specifier pairs
-- reset-names : string of reset names
-		Required elements: "apb", "core", "dptx", "spdif"
-- power-domains : power-domain property defined with a phandle
-		  to respective power domain.
-- assigned-clocks: main clock, should be <&cru SCLK_DP_CORE>
-- assigned-clock-rates : the DP core clk frequency, shall be: 100000000
-
-- rockchip,grf: this soc should set GRF regs, so need get grf here.
-
-- ports: contain a port nodes with endpoint definitions as defined in
-	 Documentation/devicetree/bindings/media/video-interfaces.txt.
-	 contained 2 endpoints, connecting to the output of vop.
-
-- phys: from general PHY binding: the phandle for the PHY device.
-
-- extcon: extcon specifier for the Power Delivery
-
-- #sound-dai-cells = it must be 1 if your system is using 2 DAIs: I2S, SPDIF
-
--------------------------------------------------------------------------------
-
-Example:
-	cdn_dp: dp@fec00000 {
-		compatible = "rockchip,rk3399-cdn-dp";
-		reg = <0x0 0xfec00000 0x0 0x100000>;
-		interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-		clocks = <&cru SCLK_DP_CORE>, <&cru PCLK_DP_CTRL>,
-			 <&cru SCLK_SPDIF_REC_DPTX>, <&cru PCLK_VIO_GRF>;
-		clock-names = "core-clk", "pclk", "spdif", "grf";
-		assigned-clocks = <&cru SCLK_DP_CORE>;
-		assigned-clock-rates = <100000000>;
-		power-domains = <&power RK3399_PD_HDCP>;
-		phys = <&tcphy0_dp>, <&tcphy1_dp>;
-		resets = <&cru SRST_DPTX_SPDIF_REC>;
-		reset-names = "spdif";
-		extcon = <&fusb0>, <&fusb1>;
-		rockchip,grf = <&grf>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		#sound-dai-cells = <1>;
-
-		ports {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			dp_in: port {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				dp_in_vopb: endpoint@0 {
-					reg = <0>;
-					remote-endpoint = <&vopb_out_dp>;
-				};
-
-				dp_in_vopl: endpoint@1 {
-					reg = <1>;
-					remote-endpoint = <&vopl_out_dp>;
-				};
-			};
-		};
-	};
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +158 -0

158 lines not on this page · raw message

--
2.49.0

#3 lore raw

Re: [PATCH v2 2/2] dt-bindings: display: rockchip: Convert cdn-dp-rockchip.txt to yaml

Quoted 8 lines · Chaoyi Chen
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +8 -0
+
+  clock-names:
+    items:
+      - const: core-clk
+      - const: pclk
+      - const: spdif
+      - const: grf
+

Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml line 48

Quoted 10 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +10 -0
+  extcon:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Phandle to the extcon device providing the cable state for the DP PHY.
+
+  interrupts:
+    maxItems: 1
+
+  phys:
+    $ref: /schemas/types.yaml#/definitions/phandle-array

Just phandle. If this is an array (but why?), you need maxItems for outer and inner dimensions.

Quoted 47 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +47 -0
+    description:
+      Phandle to the PHY device for DP output.
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Input of the CDN DP
+        properties:
+          endpoint@0:
+            description: Connection to the VOPB
+          endpoint@1:
+            description: Connection to the VOPL
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Output of the CDN DP
+
+    required:
+      - port@0
+      - port@1
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 4
+
+  reset-names:
+    items:
+      - const: spdif
+      - const: dptx
+      - const: apb
+      - const: core
+
+  rockchip,grf:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to GRF register to control HPD.
+
+  "#sound-dai-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg

Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml line 105

Quoted 10 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +10 -0
+  - clocks
+  - clock-names
+  - interrupts
+  - phys
+  - ports
+  - resets
+  - reset-names
+  - rockchip,grf
+
+additionalProperties: false

Well, if you added dai-common $ref then this could have stayed as unevaluatedProperties, so you will allow names for the DAI as well.

Quoted 1 line

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH v2 2/2] dt-bindings: display: rockchip: Convert cdn-dp-rockchip.txt to yaml

Hi Krzysztof,

Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Chaoyi Chen
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +12 -0
+
+  clock-names:
+    items:
+      - const: core-clk
+      - const: pclk
+      - const: spdif
+      - const: grf
+
+  extcon:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Phandle to the extcon device providing the cable state for the DP PHY.
Quoted 8 lines

Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml line 48

Quoted 6 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +6 -0
+
+  interrupts:
+    maxItems: 1
+
+  phys:
+    $ref: /schemas/types.yaml#/definitions/phandle-array

Just phandle. If this is an array (but why?), you need maxItems for outer and inner dimensions.

I think it could be phandle or phandle-array. Since the RK3399 DP has two PHYs, if we put in two PHYs here, the driver will pick one PHY port that is already plugged into the DP for output. If we fill in only one PHY here, then output is only allowed on the corresponding PHY.

Will add restrictions and add more descriptions in v3.

Quoted 52 lines
Quoted 52 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +51 -0
+    description:
+      Phandle to the PHY device for DP output.
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Input of the CDN DP
+        properties:
+          endpoint@0:
+            description: Connection to the VOPB
+          endpoint@1:
+            description: Connection to the VOPL
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Output of the CDN DP
+
+    required:
+      - port@0
+      - port@1
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 4
+
+  reset-names:
+    items:
+      - const: spdif
+      - const: dptx
+      - const: apb
+      - const: core
+
+  rockchip,grf:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to GRF register to control HPD.
+
+  "#sound-dai-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - phys
Quoted 8 lines

Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml line 105

Quoted 6 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +6 -0
+  - ports
+  - resets
+  - reset-names
+  - rockchip,grf
+
+additionalProperties: false

Well, if you added dai-common $ref then this could have stayed as unevaluatedProperties, so you will allow names for the DAI as well.

Thanks for your clarification. Will fix in v3.

Quoted 6 lines

Best regards,
Krzysztof

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

maintainer
#5 lore raw

Re: [PATCH v2 2/2] dt-bindings: display: rockchip: Convert cdn-dp-rockchip.txt to yaml

Am Freitag, 9. Mai 2025, 09:34:47 Mitteleuropäische Sommerzeit schrieb Chaoyi Chen:

Quoted 25 lines

Hi Krzysztof,

Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Chaoyi Chen
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +12 -0
+
+  clock-names:
+    items:
+      - const: core-clk
+      - const: pclk
+      - const: spdif
+      - const: grf
+
+  extcon:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Phandle to the extcon device providing the cable state for the DP PHY.
Quoted 8 lines

Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml line 48

Quoted 6 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +6 -0
+
+  interrupts:
+    maxItems: 1
+
+  phys:
+    $ref: /schemas/types.yaml#/definitions/phandle-array

Just phandle. If this is an array (but why?), you need maxItems for outer and inner dimensions.

Quoted 6 lines

I think it could be phandle or phandle-array. Since the RK3399 DP has two PHYs, if we put in two PHYs here, the driver will pick one PHY port that is already plugged into the DP for output. If we fill in only one PHY here, then output is only allowed on the corresponding PHY.

Will add restrictions and add more descriptions in v3.

Just looked that up in the documentation.

Only the rk3399 has used this controller at all so far. There is one cdn-dp controller on it, but two phys for the two type-c blocks on the soc.

The controller can then select which one to drive. So yep, there are two phys.

Heiko

#6 lore raw

Re: [PATCH v2 2/2] dt-bindings: display: rockchip: Convert cdn-dp-rockchip.txt to yaml

In reply to Chaoyi Chen
Quoted 24 lines · Chaoyi Chen

Hi Krzysztof,

Quoted 21 lines · Krzysztof Kozlowski
Quoted 8 lines · Chaoyi Chen
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +8 -0
+
+  clock-names:
+    items:
+      - const: core-clk
+      - const: pclk
+      - const: spdif
+      - const: grf
+

Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml line 48

Quoted 10 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +10 -0
+  extcon:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Phandle to the extcon device providing the cable state for the DP PHY.
+
+  interrupts:
+    maxItems: 1
+
+  phys:
+    $ref: /schemas/types.yaml#/definitions/phandle-array

Just phandle. If this is an array (but why?), you need maxItems for outer and inner dimensions.

Uh, sorry, that was supposed to be under extcon.

Quoted 2 lines

I think it could be phandle or phandle-array. Since the RK3399 DP has

Here it is obviously not needed, that's a dtschema type.

Quoted 10 lines

two PHYs, if we put in two PHYs here, the driver will pick one PHY port that is already plugged into the DP for output. If we fill in only one PHY here, then output is only allowed on the corresponding PHY.

Will add restrictions and add more descriptions in v3.

Quoted 3 lines
Quoted 3 lines
(quoted diff) +2 -0
+    description:
+      Phandle to the PHY device for DP output.

You need to list the items with description iinstead.

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH v2 2/2] dt-bindings: display: rockchip: Convert cdn-dp-rockchip.txt to yaml

Hi Krzysztof,

Quoted 25 lines · Krzysztof Kozlowski
Quoted 24 lines · Chaoyi Chen

Hi Krzysztof,

Quoted 21 lines · Krzysztof Kozlowski
Quoted 8 lines · Chaoyi Chen
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +8 -0
+
+  clock-names:
+    items:
+      - const: core-clk
+      - const: pclk
+      - const: spdif
+      - const: grf
+

Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml line 48

Quoted 10 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml new file +10 -0
+  extcon:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Phandle to the extcon device providing the cable state for the DP PHY.
+
+  interrupts:
+    maxItems: 1
+
+  phys:
+    $ref: /schemas/types.yaml#/definitions/phandle-array

Just phandle. If this is an array (but why?), you need maxItems for outer and inner dimensions.

Quoted 1 line

Uh, sorry, that was supposed to be under extcon.

Oh, this also applies to extcon. Each extcon is used to indicate the status of the PHY.

Quoted 3 lines
Quoted 2 lines

I think it could be phandle or phandle-array. Since the RK3399 DP has

Here it is obviously not needed, that's a dtschema type.

Do you mean that there is no need to explicitly specify something like "$ref: /schemas/types.yaml#/definitions/phandle" ?

Quoted 11 lines
Quoted 10 lines

two PHYs, if we put in two PHYs here, the driver will pick one PHY port that is already plugged into the DP for output. If we fill in only one PHY here, then output is only allowed on the corresponding PHY.

Will add restrictions and add more descriptions in v3.

Quoted 2 lines
Quoted 2 lines
(quoted diff) +2 -0
+    description:
+      Phandle to the PHY device for DP output.

You need to list the items with description iinstead.

Okay, will fix in v3.

Quoted 7 lines

Best regards,
Krzysztof

#8 lore raw

Re: [PATCH v2 2/2] dt-bindings: display: rockchip: Convert cdn-dp-rockchip.txt to yaml

In reply to Chaoyi Chen
Quoted 13 lines · Chaoyi Chen

From: Chaoyi Chen <[email protected]>

Convert cdn-dp-rockchip.txt to yaml.

---

Changes in v2:
- Rename binding file name to match compatible
- Add more description about grf/phy/extcon
- Fix coding style

Quoted 6 lines
 .../display/rockchip/cdn-dp-rockchip.txt      |  74 --------
 .../rockchip/rockchip,rk3399-cdn-dp.yaml      | 158 ++++++++++++++++++
 2 files changed, 158 insertions(+), 74 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt
 create mode 100644 Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml: $id: Cannot determine base path from $id, relative path/filename doesn't match actual path or filename
$id: http://devicetree.org/schemas/display/rockchip/rockchip,cdn-dp.yaml
file: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.