Skip to contentSkip to conversation

usb: dt-bindings: ti,twlxxxx-usb: convert to DT schema

PATCH Superseded Jihed Chaibi 2 participants 5 messages Aug 21, 2025 – Aug 22, 2025

Subsystems (2)

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v5 cover usb: dt-bindings: ti,twlxxxx-usb: convert to DT schema

This series converts the legacy TXT bindings for the TI TWL4030 and TWL6030 USB modules to the modern YAML DT schema format.

---
Changes in v5:
- Split combined twlxxxx-usb binding into two dedicated files for TWL4030 and TWL6030 per maintainer feedback.
- Used more accurate header file for interrupt macros.
- Improved formatting in the examples.

Changes in v4:
- This patch is split from larger series per maintainer feedback.
- v3 link:

    https://lore.kernel.org/all/[email protected]/

- Removed i2c node as it wasn't required by the old binding file.
- Updated node names to 'usb' and 'usb-phy' in the examples to follow generic naming conventions per the Device Tree specification.
- Replaced raw interrupt values with standard defines for clarity.
- Improved formatting in the examples for clarity and consistency.

Changes in v3:
- No changes.

Changes in v2:
- Added '#phy-cells' property to support PHY framework integration.

Jihed Chaibi (2):
usb: dt-bindings: ti,twl4030-usb: convert to DT schema
usb: dt-bindings: ti,twl6030-usb: convert to DT schema

 .../bindings/usb/ti,twl4030-usb.yaml          | 76 +++++++++++++++++++
 .../bindings/usb/ti,twl6030-usb.yaml          | 51 +++++++++++++
 .../devicetree/bindings/usb/twlxxxx-usb.txt   | 43 -----------
 3 files changed, 127 insertions(+), 43 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml
 create mode 100644 Documentation/devicetree/bindings/usb/ti,twl6030-usb.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
Signature · 1 line
2.39.5
#1 lore raw

PATCH v5 1/2 usb: dt-bindings: ti,twl4030-usb: convert to DT schema

Convert the legacy TXT binding for the TWL4030 USB module to the modern YAML DT schema format. This adds formal validation and improves documentation using a conditional schema.

---
Changes in v5:

- Split combined twlxxxx-usb binding into a dedicated file for twl4030-usb per maintainer feedback.
- Used more accurate header for interrupt macros.
- Improved formatting in the examples.

Changes in v4:
- This patch is split from larger series per maintainer feedback.
- v3 link:

    https://lore.kernel.org/all/[email protected]/

- Removed i2c node as it wasn't required by the old binding file.
- Updated node names to 'usb' and 'usb-phy' in the examples to follow generic naming conventions per the Device Tree specification.
- Replaced raw interrupt values with standard defines for clarity.
- Improved formatting in the examples for clarity and consistency.

Changes in v3:
- No changes.

Changes in v2:
- Added '#phy-cells' property to support PHY framework integration.

---
 .../bindings/usb/ti,twl4030-usb.yaml          | 76 +++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml
Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml new file +76 -0
new file mode 100644
index 000000000..a2d3c5f60
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,twl4030-usb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TWL4030 USB PHY and Comparator
+
+maintainers:
+  - Peter Ujfalusi <[email protected]>
+
+description:
+  Bindings for the USB PHY and comparator module found within the
+  TWL4030 family of companion chips. If a sibling node is compatible with
+  "ti,twl4030-bci", the driver for that node will query this device for
+  USB power status.
+
+properties:
+  compatible:
+    const: ti,twl4030-usb
+
+  interrupts:
+    description:
+      Interrupt numbers to the CPU for ID and VBUS events. The first interrupt
+      is the OTG interrupt for both ID and VBUS events. The second interrupt
+      is optional.
+    minItems: 1
+    maxItems: 2
+
+  usb1v5-supply:
+    description: Phandle to the vusb1v5 regulator.
+
+  usb1v8-supply:
+    description: Phandle to the vusb1v8 regulator.
+
+  usb3v1-supply:
+    description: Phandle to the vusb3v1 regulator.
+
+  usb_mode:
+    description: |
+      The mode used by the PHY to connect to the controller:
+        1: ULPI mode
+        2: CEA2011_3PIN mode
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [1, 2]
+
+  '#phy-cells':
+    const: 0
+
+required:
+  - compatible
+  - interrupts
+  - usb1v5-supply
+  - usb1v8-supply
+  - usb3v1-supply
+  - usb_mode
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    usb-phy {
+        compatible = "ti,twl4030-usb";
+
+        interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-parent = <&gic>;
+
+        usb1v5-supply = <&reg_vusb1v5>;
+        usb1v8-supply = <&reg_vusb1v8>;
+        usb3v1-supply  = <&reg_vusb3v1>;
+        usb_mode = <1>;
+
+        #phy-cells = <0>;
+    };
Signature · 1 line
2.39.5
#2 lore raw

Re: [PATCH v5 1/2] usb: dt-bindings: ti,twl4030-usb: convert to DT schema

Quoted 54 lines · Jihed Chaibi

Convert the legacy TXT binding for the TWL4030 USB module to the modern YAML DT schema format. This adds formal validation and improves documentation using a conditional schema.

---
Changes in v5:

- Split combined twlxxxx-usb binding into a dedicated file for twl4030-usb per maintainer feedback.
- Used more accurate header for interrupt macros.
- Improved formatting in the examples.

Changes in v4:
- This patch is split from larger series per maintainer feedback.
- v3 link:

    https://lore.kernel.org/all/[email protected]/

- Removed i2c node as it wasn't required by the old binding file.
- Updated node names to 'usb' and 'usb-phy' in the examples to follow generic naming conventions per the Device Tree specification.
- Replaced raw interrupt values with standard defines for clarity.
- Improved formatting in the examples for clarity and consistency.

Changes in v3:
- No changes.

Changes in v2:
- Added '#phy-cells' property to support PHY framework integration.

---
 .../bindings/usb/ti,twl4030-usb.yaml          | 76 +++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml
Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml new file +14 -0
new file mode 100644
index 000000000..a2d3c5f60
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,twl4030-usb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TWL4030 USB PHY and Comparator
+
+maintainers:
+  - Peter Ujfalusi <[email protected]>
+
+description:
+  Bindings for the USB PHY and comparator module found within the
+  TWL4030 family of companion chips. If a sibling node is compatible with

Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml line 24

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml new file +10 -0
+  "ti,twl4030-bci", the driver for that node will query this device for
+  USB power status.
+
+properties:
+  compatible:
+    const: ti,twl4030-usb
+
+  interrupts:
+    description:
+      Interrupt numbers to the CPU for ID and VBUS events. The first interrupt

Confusing. So first is CPU?

Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml line 25

Quoted 1 line
Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml new file +1 -0
+      is the OTG interrupt for both ID and VBUS events. The second interrupt

But furst is OTG?

Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml line 26

Quoted 1 line
Documentation/devicetree/bindings/usb/ti,twl4030-usb.yaml new file +1 -0
+      is optional.

After splitting the binding this should be rewritten. Drop description, no need for free form text.

minItems: 1
items:
- description: OTG for ...
- description: foo bar and do not say it is optional because it is obvious from schema

Missing also removal of this device from the TXT binding.

Best regards,
Krzysztof

#3 lore raw

PATCH v5 2/2 usb: dt-bindings: ti,twl6030-usb: convert to DT schema

In reply to Jihed Chaibi

Convert the legacy TXT binding for the TWL6030 USB module to the modern YAML DT schema format. This adds formal validation and improves documentation using a conditional schema.

---
Changes in v5:

- Split combined twlxxxx-usb binding into a dedicated file for twl6030-usb per maintainer feedback.
- Used more accurate header for interrupt macros.
- Improved formatting in the examples.

Changes in v4:
- This patch is split from larger series per maintainer feedback.
- v3 link:

    https://lore.kernel.org/all/[email protected]/

- Removed i2c node as it wasn't required by the old binding file.
- Updated node names to 'usb' and 'usb-phy' in the examples to follow generic naming conventions per the Device Tree specification.
- Replaced raw interrupt values with standard defines for clarity.
- Improved formatting in the examples for clarity and consistency.

Changes in v3:
- No changes.

Changes in v2:
- Added '#phy-cells' property to support PHY framework integration.

---
 .../bindings/usb/ti,twl6030-usb.yaml          | 51 +++++++++++++++++++
 .../devicetree/bindings/usb/twlxxxx-usb.txt   | 43 ----------------
 2 files changed, 51 insertions(+), 43 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ti,twl6030-usb.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
Documentation/devicetree/bindings/usb/ti,twl6030-usb.yaml new file +51 -0
new file mode 100644
index 000000000..76fef7911
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,twl6030-usb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TWL6030 USB Comparator
+
+maintainers:
+  - Peter Ujfalusi <[email protected]>
+
+description:
+  Bindings for the USB comparator module found within the TWL6030
+  family of companion chips.
+
+properties:
+  compatible:
+    const: ti,twl6030-usb
+
+  interrupts:
+    description:
+      Interrupts for ID and VBUS events, two interrupts must be specified,
+      the first is the OTG interrupt for ID events (host mode), the second
+      is the USB interrupt for VBUS events (device mode).
+    minItems: 2
+    maxItems: 2
+
+  usb-supply:
+    description:
+      Phandle to the VUSB regulator. For TWL6030, this should be the 'vusb'
+      regulator. For TWL6032 subclass, it should be the 'ldousb' regulator.
+
+required:
+  - compatible
+  - interrupts
+  - usb-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    usb {
+        compatible = "ti,twl6030-usb";
+
+        interrupts = <4 IRQ_TYPE_LEVEL_HIGH>, <10 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-parent = <&gic>;
+
+        usb-supply = <&reg_vusb>;
+    };
Documentation/devicetree/bindings/usb/twlxxxx-usb.txt deleted +0 -43

43 lines not on this page · raw message

Signature · 1 line
2.39.5
#4 lore raw

Re: [PATCH v5 2/2] usb: dt-bindings: ti,twl6030-usb: convert to DT schema

Documentation/devicetree/bindings/usb/ti,twl6030-usb.yaml line 26

Quoted 7 lines · Jihed Chaibi
Documentation/devicetree/bindings/usb/ti,twl6030-usb.yaml new file +7 -0
+  interrupts:
+    description:
+      Interrupts for ID and VBUS events, two interrupts must be specified,
+      the first is the OTG interrupt for ID events (host mode), the second
+      is the USB interrupt for VBUS events (device mode).
+    minItems: 2
+    maxItems: 2

Redundant constraints and description.

interrupts:
items:
- description: OTG for ID events in host mode
- description: USB device mode for VBUS events

Best regards,
Krzysztof