diff mbox series

[v11,02/10] dt-bindings: usb: Maxim type-c controller device tree binding document

Message ID 20201020093627.256885-3-badhri@google.com (mailing list archive)
State New, archived
Headers show
Series *** TCPM support for FRS and AutoDischarge Disconnect *** | expand

Commit Message

Badhri Jagan Sridharan Oct. 20, 2020, 9:36 a.m. UTC
Add device tree binding document for Maxim 33359 Type-C chip driver

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
---
Changes since v1:
- Changing patch version to v6 to fix version number confusion.

Changes since v6:
- Migrated to yaml format.

Changes since v7:
- Rebase on usb-next

Changes since v8:
- Fix errors from make dt_binding_check as suggested by
  Rob Herring.

Changes since v9:
- additionalProperties: false as suggested by Rob Herring.

Changes since v10:
- Added the chip number to the binding as suggested by Rob Herring.
- Renamed the filename as well.

---
 .../devicetree/bindings/usb/maxim,33359.yaml  | 75 +++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/maxim,33359.yaml

Comments

Rob Herring (Arm) Oct. 26, 2020, 2:03 p.m. UTC | #1
On Tue, Oct 20, 2020 at 02:36:19AM -0700, Badhri Jagan Sridharan wrote:
> Add device tree binding document for Maxim 33359 Type-C chip driver
> 
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
> ---
> Changes since v1:
> - Changing patch version to v6 to fix version number confusion.
> 
> Changes since v6:
> - Migrated to yaml format.
> 
> Changes since v7:
> - Rebase on usb-next
> 
> Changes since v8:
> - Fix errors from make dt_binding_check as suggested by
>   Rob Herring.
> 
> Changes since v9:
> - additionalProperties: false as suggested by Rob Herring.
> 
> Changes since v10:
> - Added the chip number to the binding as suggested by Rob Herring.
> - Renamed the filename as well.
> 
> ---
>  .../devicetree/bindings/usb/maxim,33359.yaml  | 75 +++++++++++++++++++
>  1 file changed, 75 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/maxim,33359.yaml
> 
> diff --git a/Documentation/devicetree/bindings/usb/maxim,33359.yaml b/Documentation/devicetree/bindings/usb/maxim,33359.yaml
> new file mode 100644
> index 000000000000..b02e7b228cde
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/maxim,33359.yaml
> @@ -0,0 +1,75 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/usb/maxim,33359.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Maxim TCPCI Type-C PD controller DT bindings
> +
> +maintainers:
> +  - Badhri Jagan Sridharan <badhri@google.com>
> +
> +description: Maxim TCPCI Type-C PD controller
> +
> +properties:
> +  compatible:
> +    enum:
> +      - maxim,33359

Maxim parts are generally named 'maxim,max[0-9]+'

With that,

Reviewed-by: Rob Herring <robh@kernel.org>

> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  connector:
> +    type: object
> +    $ref: ../connector/usb-connector.yaml#
> +    description:
> +      Properties for usb c connector.
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - connector
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/usb/pd.h>
> +    i2c0 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        maxtcpc@25 {
> +            compatible = "maxim,33359";
> +            reg = <0x25>;
> +            interrupt-parent = <&gpa8>;
> +            interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
> +
> +            connector {
> +                compatible = "usb-c-connector";
> +                label = "USB-C";
> +                data-role = "dual";
> +                power-role = "dual";
> +                try-power-role = "sink";
> +                self-powered;
> +                op-sink-microwatt = <2600000>;
> +                new-source-frs-typec-current = <FRS_5V_1P5A>;
> +                source-pdos = <PDO_FIXED(5000, 900,
> +                                         PDO_FIXED_SUSPEND |
> +                                         PDO_FIXED_USB_COMM |
> +                                         PDO_FIXED_DATA_SWAP |
> +                                         PDO_FIXED_DUAL_ROLE)>;
> +                sink-pdos = <PDO_FIXED(5000, 3000,
> +                                       PDO_FIXED_USB_COMM |
> +                                       PDO_FIXED_DATA_SWAP |
> +                                       PDO_FIXED_DUAL_ROLE)
> +                                       PDO_FIXED(9000, 2000, 0)>;
> +            };
> +        };
> +    };
> +...
> -- 
> 2.29.0.rc1.297.gfa9743e501-goog
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/maxim,33359.yaml b/Documentation/devicetree/bindings/usb/maxim,33359.yaml
new file mode 100644
index 000000000000..b02e7b228cde
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/maxim,33359.yaml
@@ -0,0 +1,75 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/usb/maxim,33359.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Maxim TCPCI Type-C PD controller DT bindings
+
+maintainers:
+  - Badhri Jagan Sridharan <badhri@google.com>
+
+description: Maxim TCPCI Type-C PD controller
+
+properties:
+  compatible:
+    enum:
+      - maxim,33359
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  connector:
+    type: object
+    $ref: ../connector/usb-connector.yaml#
+    description:
+      Properties for usb c connector.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - connector
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/usb/pd.h>
+    i2c0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        maxtcpc@25 {
+            compatible = "maxim,33359";
+            reg = <0x25>;
+            interrupt-parent = <&gpa8>;
+            interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+
+            connector {
+                compatible = "usb-c-connector";
+                label = "USB-C";
+                data-role = "dual";
+                power-role = "dual";
+                try-power-role = "sink";
+                self-powered;
+                op-sink-microwatt = <2600000>;
+                new-source-frs-typec-current = <FRS_5V_1P5A>;
+                source-pdos = <PDO_FIXED(5000, 900,
+                                         PDO_FIXED_SUSPEND |
+                                         PDO_FIXED_USB_COMM |
+                                         PDO_FIXED_DATA_SWAP |
+                                         PDO_FIXED_DUAL_ROLE)>;
+                sink-pdos = <PDO_FIXED(5000, 3000,
+                                       PDO_FIXED_USB_COMM |
+                                       PDO_FIXED_DATA_SWAP |
+                                       PDO_FIXED_DUAL_ROLE)
+                                       PDO_FIXED(9000, 2000, 0)>;
+            };
+        };
+    };
+...