diff mbox series

[v5,05/12] dt-bindings: usb: convert fcs,fusb302.txt to yaml

Message ID fc68bedc-ff93-13bc-aa06-7920f5e53de6@gmail.com (mailing list archive)
State Superseded
Headers show
Series [v5,01/12] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML | expand

Commit Message

Johan Jonker Dec. 21, 2022, 6:23 p.m. UTC
Convert fcs,fusb302.txt to yaml.

Changed:
  Add vbus-supply property

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 .../devicetree/bindings/usb/fcs,fusb302.txt   | 34 ----------
 .../devicetree/bindings/usb/fcs,fusb302.yaml  | 66 +++++++++++++++++++
 2 files changed, 66 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.txt
 create mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.yaml

--
2.20.1

Comments

Rob Herring Dec. 21, 2022, 10:35 p.m. UTC | #1
On Wed, Dec 21, 2022 at 12:23 PM Johan Jonker <jbx6244@gmail.com> wrote:
>
> Convert fcs,fusb302.txt to yaml.
>
> Changed:
>   Add vbus-supply property
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  .../devicetree/bindings/usb/fcs,fusb302.txt   | 34 ----------
>  .../devicetree/bindings/usb/fcs,fusb302.yaml  | 66 +++++++++++++++++++
>  2 files changed, 66 insertions(+), 34 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.txt
>  create mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
>
> diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
> deleted file mode 100644
> index 60e465429..000000000
> --- a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -Fairchild FUSB302 Type-C Port controllers
> -
> -Required properties :
> -- compatible             : "fcs,fusb302"
> -- reg                    : I2C slave address
> -- interrupts             : Interrupt specifier
> -
> -Required sub-node:
> -- connector : The "usb-c-connector" attached to the FUSB302 IC. The bindings
> -  of the connector node are specified in:
> -
> -       Documentation/devicetree/bindings/connector/usb-connector.yaml
> -
> -
> -Example:
> -
> -fusb302: typec-portc@54 {
> -       compatible = "fcs,fusb302";
> -       reg = <0x54>;
> -       interrupt-parent = <&nmi_intc>;
> -       interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
> -
> -       usb_con: connector {
> -               compatible = "usb-c-connector";
> -               label = "USB-C";
> -               power-role = "dual";
> -               try-power-role = "sink";
> -               source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
> -               sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
> -                            PDO_VAR(3000, 12000, 3000)
> -                            PDO_PPS_APDO(3000, 11000, 3000)>;
> -               op-sink-microwatt = <10000000>;
> -       };
> -};
> diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml b/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
> new file mode 100644
> index 000000000..9b172fda9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/fcs,fusb302.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Fairchild FUSB302 Type-C Port controller
> +
> +maintainers:
> +  - Rob Herring <robh@kernel.org>

Why me? I don't care, but that's kind of the default.

> +
> +properties:
> +  compatible:
> +    const: fcs,fusb302
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  vbus-supply:
> +    description: VBUS power supply
> +
> +  connector:
> +    type: object
> +    $ref: /schemas/connector/usb-connector.yaml#

       unevaluatedProperties: false

> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - vbus-supply
> +  - connector
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/usb/pd.h>
> +
> +    i2c {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      fusb302: typec-portc@54 {

Drop unused labels.

> +        compatible = "fcs,fusb302";
> +        reg = <0x54>;
> +        interrupt-parent = <&nmi_intc>;
> +        interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
> +        vbus-supply = <&vbus_typec>;
> +
> +        usb_con: connector {
> +          compatible = "usb-c-connector";
> +          label = "USB-C";
> +          power-role = "dual";
> +          try-power-role = "sink";
> +          source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
> +          sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
> +                       PDO_VAR(3000, 12000, 3000)
> +                       PDO_PPS_APDO(3000, 11000, 3000)>;
> +          op-sink-microwatt = <10000000>;
> +        };
> +      };
> +    };
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
deleted file mode 100644
index 60e465429..000000000
--- a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
+++ /dev/null
@@ -1,34 +0,0 @@ 
-Fairchild FUSB302 Type-C Port controllers
-
-Required properties :
-- compatible             : "fcs,fusb302"
-- reg                    : I2C slave address
-- interrupts             : Interrupt specifier
-
-Required sub-node:
-- connector : The "usb-c-connector" attached to the FUSB302 IC. The bindings
-  of the connector node are specified in:
-
-	Documentation/devicetree/bindings/connector/usb-connector.yaml
-
-
-Example:
-
-fusb302: typec-portc@54 {
-	compatible = "fcs,fusb302";
-	reg = <0x54>;
-	interrupt-parent = <&nmi_intc>;
-	interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-	usb_con: connector {
-		compatible = "usb-c-connector";
-		label = "USB-C";
-		power-role = "dual";
-		try-power-role = "sink";
-		source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
-		sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
-			     PDO_VAR(3000, 12000, 3000)
-			     PDO_PPS_APDO(3000, 11000, 3000)>;
-		op-sink-microwatt = <10000000>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml b/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
new file mode 100644
index 000000000..9b172fda9
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
@@ -0,0 +1,66 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/fcs,fusb302.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Fairchild FUSB302 Type-C Port controller
+
+maintainers:
+  - Rob Herring <robh@kernel.org>
+
+properties:
+  compatible:
+    const: fcs,fusb302
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vbus-supply:
+    description: VBUS power supply
+
+  connector:
+    type: object
+    $ref: /schemas/connector/usb-connector.yaml#
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - vbus-supply
+  - connector
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/usb/pd.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      fusb302: typec-portc@54 {
+        compatible = "fcs,fusb302";
+        reg = <0x54>;
+        interrupt-parent = <&nmi_intc>;
+        interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+        vbus-supply = <&vbus_typec>;
+
+        usb_con: connector {
+          compatible = "usb-c-connector";
+          label = "USB-C";
+          power-role = "dual";
+          try-power-role = "sink";
+          source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+          sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
+                       PDO_VAR(3000, 12000, 3000)
+                       PDO_PPS_APDO(3000, 11000, 3000)>;
+          op-sink-microwatt = <10000000>;
+        };
+      };
+    };