dt-bindings: usb: richtek,rt1711h: remove .txt binding and fix schema
Subsystems (2)
v2 cover dt-bindings: usb: richtek,rt1711h: remove .txt binding and fix schema
The richtek,rt1711h binding has a legacy plain-text file that was superseded by the YAML schema. Remove it.
The YAML schema also declares 'additionalProperties: false' but omits the top-level 'port' property used by hi3660-hikey960.dts to describe the role-switch graph endpoint, causing dtbs_check to emit:
hi3660-hikey960.dtb: rt1711h@4e (richtek,rt1711h): 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
Add the missing property referencing /schemas/graph.yaml.
A separate dtbs_check warning on the same node is out of scope for this series:
hi3660-hikey960.dtb: rt1711h@4e (richtek,rt1711h):
connector:ports: 'port@0' is a required property
That one is in the connector subnode and is governed by usb-connector.yaml, not this binding.
---
Changes in v2:
- Patch 1: No changes.
- Patch 2: Fix port node indentation in example; port is now correctly placed as a sibling of connector under rt1711h@4e.
v1: https://lore.kernel.org/all/[email protected]/
Akash Sukhavasi (2):
dt-bindings: usb: richtek,rt1711h: remove deprecated .txt file
dt-bindings: usb: richtek,rt1711h: add missing 'port' property
.../bindings/usb/richtek,rt1711h.txt | 44 ------------------- .../bindings/usb/richtek,rt1711h.yaml | 13 ++++++ 2 files changed, 13 insertions(+), 44 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/richtek,rt1711h.txt
Signature · 1 line
2.54.0
PATCH v2 1/2 dt-bindings: usb: richtek,rt1711h: remove deprecated .txt file
Remove the deprecated .txt binding for richtek,rt1711h. It was superseded by the YAML schema added in commit a72095ed8e65 ("dt-bindings usb: typec: rt1711h: Add binding for Richtek RT1711H").
--- .../bindings/usb/richtek,rt1711h.txt | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/richtek,rt1711h.txt
Documentation/devicetree/bindings/usb/richtek,rt1711h.txt deleted +0 -44
@@ -1,44 +0,0 @@ -Richtek RT1711H TypeC PD Controller. - -Required properties: - - compatible : Must be "richtek,rt1711h". - - reg : Must be 0x4e, it's slave address of RT1711H. - - interrupts : <a b> where a is the interrupt number and b represents an - encoding of the sense and level information for the interrupt. - -Required sub-node: -- connector: The "usb-c-connector" attached to the tcpci chip, the bindings - of connector node are specified in - Documentation/devicetree/bindings/connector/usb-connector.yaml - -Example : -rt1711h@4e { - compatible = "richtek,rt1711h"; - reg = <0x4e>; - interrupt-parent = <&gpio26>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; - - usb_con: connector { - compatible = "usb-c-connector"; - label = "USB-C"; - data-role = "dual"; - power-role = "dual"; - try-power-role = "sink"; - source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>; - sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM) - PDO_VAR(5000, 12000, 2000)>; - op-sink-microwatt = <10000000>; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@1 { - reg = <1>; - usb_con_ss: endpoint { - remote-endpoint = <&usb3_data_ss>; - }; - }; - }; - }; -};
Signature · 1 line
2.54.0
Re: [PATCH v2 1/2] dt-bindings: usb: richtek,rt1711h: remove deprecated .txt file
Quoted 9 lines · Akash Sukhavasi
Remove the deprecated .txt binding for richtek,rt1711h. It was superseded by the YAML schema added in commit
a72095ed8e65("dt-bindings usb: typec: rt1711h: Add binding for Richtek RT1711H").Signed-off-by Akash Sukhavasi <[email protected]>--- .../bindings/usb/richtek,rt1711h.txt | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/richtek,rt1711h.txt
Best regards,
Krzysztof
PATCH v2 2/2 dt-bindings: usb: richtek,rt1711h: add missing 'port' property
In reply to Akash SukhavasiThe schema declares 'additionalProperties: false' but omits the top-level 'port' property, which hi3660-hikey960.dts uses to describe the role-switch graph endpoint. This causes dtbs_check to emit:
hi3660-hikey960.dtb: rt1711h@4e (richtek,rt1711h): 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
Add the missing property using /schemas/graph.yaml#/properties/port, following the pattern used by realtek,rts5411.yaml and other USB controller bindings.
Update the example accordingly.
--- .../devicetree/bindings/usb/richtek,rt1711h.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml +13 -0
@@ -52,6 +52,13 @@ properties: description: Properties for usb c connector. + port: + $ref: /schemas/graph.yaml#/properties/port + description: + OF graph port describing the connection to the USB role switch + consumer (e.g., a dwc3 controller with usb-role-switch), used to + convey type-C data-role changes signaled by the TCPC. + additionalProperties: false required:
@@ -108,6 +115,12 @@ examples: }; }; }; + + port { + endpoint { + remote-endpoint = <&usb_role_switch>; + }; + }; }; }; ...
Signature · 1 line
2.54.0
[email protected]
AI reviewRe: [PATCH v2 2/2] dt-bindings: usb: richtek,rt1711h: add missing 'port' property
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit modifies the device tree schema to legitimize a non-standard and semantically…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit modifies the device tree schema to legitimize a non-standard and semantically incorrect devicetree layout present in hi3660-hikey960.dts, instead of fixing the buggy devicetree file. --
commit eb001738f71c4e41754a143f37ed24b7c078d74d
Author: Akash Sukhavasi <[email protected]>
dt-bindings: usb: richtek,rt1711h: add missing 'port' property
This commit adds a top-level port property to the richtek,rt1711h binding to resolve a dtbs_check warning for hi3660-hikey960.dts. It also updates the example to show the role-switch endpoint connection.
Quoted 3 lines
Add the missing property using /schemas/graph.yaml#/properties/port, following the pattern used by realtek,rts5411.yaml and other USB controller bindings.
Is this comparison to realtek,rts5411.yaml accurate? The RTS5411 is a USB hub that physically routes data, while the RT1711H is a Type-C Port Controller (TCPC).
Quoted 5 lines
Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml +0
-0
Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml properties: · line 60
Quoted 9 lines
Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml +6
-0@@ -52,6 +52,13 @@ properties: description: Properties for usb c connector. + port: + $ref: /schemas/graph.yaml#/properties/port + description: + OF graph port describing the connection to the USB role switch + consumer (e.g., a dwc3 controller with usb-role-switch), used to + convey type-C data-role changes signaled by the TCPC.
Since the RT1711H is a TCPC, should this role switch endpoint logically belong to the physical port inside the connector child node instead?
According to the standard bindings in connector/usb-connector.yaml, the connection to the USB role switch is typically represented inside the usb-c-connector child node.
The Linux TCPM core also appears to expect the standard layout, as tcpci.c initializes tcpc->fwnode to the connector child node, and tcpm.c attempts fwnode_usb_role_switch_get(tcpc->fwnode) first.
Would it be more appropriate to update hi3660-hikey960.dts to move the port into the connector subnode rather than changing the schema to allow it at the top level?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH v2 2/2] dt-bindings: usb: richtek,rt1711h: add missing 'port' property
Quoted 3 lines
Is this comparison to realtek,rts5411.yaml accurate? The RTS5411 is a USB hub that physically routes data, while the RT1711H is a Type-C Port Controller (TCPC).
Fair point, rts5411 is a hub, not a TCPC. A better precedent is qcom,pmic-typec.yaml, which is also a Type-C controller and uses the same pattern: a top-level port for role-switch signaling as a sibling of the connector node.
Quoted 2 lines
Since the RT1711H is a TCPC, should this role switch endpoint logically belong to the physical port inside the connector child node instead?
The top level port describes a control-plane connection (role switch signaling from the TCPC to the USB controller), which is distinct from the data-path connections inside the connector. This separation is used by qcom,pmic-typec.yaml, and on the controller side by snps,dwc3-common.yaml, dwc2.yaml, and chipidea,usb2-common.yaml.
Quoted 3 lines
According to the standard bindings in
connector/usb-connector.yaml, the connection to the USB role switch is typically represented inside the usb-c-connector child node.
The connector ports describe physical data paths (HS, SS, alt-mode). The top-level port describes role-switch signaling between the TCPC device and the USB controller. Both patterns exist in-tree across multiple bindings.
Quoted 3 lines
The Linux TCPM core also appears to expect the standard layout, as
tcpci.cinitializestcpc->fwnodeto the connector child node, andtcpm.cattemptsfwnode_usb_role_switch_get(tcpc->fwnode)first.
The TCPM core handles both layouts. Multiple in-tree bindings and their corresponding DTS files already rely on the top-level port pattern.
Quoted 3 lines
Would it be more appropriate to update
hi3660-hikey960.dtsto move the port into the connector subnode rather than changing the schema to allow it at the top level?
No. The top-level port layout is an established pattern, not an anomaly in this one DTS. Moving it would be a functional change to a 6-year-old in-tree DTS (commit 47e2843f5e2e, 2020), and the schema should describe what exists in-tree.
Re: [PATCH v2 2/2] dt-bindings: usb: richtek,rt1711h: add missing 'port' property
In reply to Akash SukhavasiQuoted 24 lines · Akash Sukhavasi
The schema declares 'additionalProperties: false' but omits the top-level 'port' property, which
hi3660-hikey960.dtsuses to describe the role-switch graph endpoint. This causesdtbs_checkto emit:hi3660-hikey960.dtb: rt1711h@4e (richtek,rt1711h): 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
Add the missing property using /schemas/graph.yaml#/properties/port, following the pattern used by realtek,rts5411.yaml and other USB controller bindings.
Update the example accordingly.
Signed-off-by Akash Sukhavasi <[email protected]>--- .../devicetree/bindings/usb/richtek,rt1711h.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+)Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml +0
-0
Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml properties: · line 60
Quoted 9 lines
Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml +6
-0@@ -52,6 +52,13 @@ properties: description: Properties for usb c connector. + port: + $ref: /schemas/graph.yaml#/properties/port + description: + OF graph port describing the connection to the USB role switch + consumer (e.g., a dwc3 controller with usb-role-switch), used to + convey type-C data-role changes signaled by the TCPC.
I don't think this is right. There is no such data link for "role switch", so this should be part of standard connector ports.
And the only other binding (I found) having these two is qcom,pmic-typec, which in practice only uses connector in all of DTS files.
Best regards,
Krzysztof
Re: [PATCH v2 2/2] dt-bindings: usb: richtek,rt1711h: add missing 'port' property
Quoted 39 lines · Krzysztof Kozlowski
Quoted 24 lines · Akash Sukhavasi
The schema declares 'additionalProperties: false' but omits the top-level 'port' property, which
hi3660-hikey960.dtsuses to describe the role-switch graph endpoint. This causesdtbs_checkto emit:hi3660-hikey960.dtb: rt1711h@4e (richtek,rt1711h): 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
Add the missing property using /schemas/graph.yaml#/properties/port, following the pattern used by realtek,rts5411.yaml and other USB controller bindings.
Update the example accordingly.
Signed-off-by Akash Sukhavasi <[email protected]>--- .../devicetree/bindings/usb/richtek,rt1711h.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+)Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml +0
-0Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml properties: · line 60
Quoted 9 lines
Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml +6
-0@@ -52,6 +52,13 @@ properties: description: Properties for usb c connector. + port: + $ref: /schemas/graph.yaml#/properties/port + description: + OF graph port describing the connection to the USB role switch + consumer (e.g., a dwc3 controller with usb-role-switch), used to + convey type-C data-role changes signaled by the TCPC.I don't think this is right. There is no such data link for "role switch", so this should be part of standard connector ports.
Quoted 3 lines
And the only other binding (I found) having these two is qcom,pmic-typec, which in practice only uses connector in all of DTS files.
Hi Krzysztof,
Makes sense. I'll take a look at hi3660-hikey960.dts itself since it also has the port@0 required property warning on the same node. Will send a separate patch.
Dropping patch 2/2 from this series.
Can patch 1/2 (.txt removal) be applied independently with your Reviewed-by?
Thanks,
Akash
Re: [PATCH v2 2/2] dt-bindings: usb: richtek,rt1711h: add missing 'port' property
Quoted 5 lines · Akash Sukhavasi
Dropping patch 2/2 from this series.
Can patch 1/2 (.txt removal) be applied independently with your Reviewed-by?
You should rather send a v2, with only the first patch and with my tag.
Best regards,
Krzysztof