diff mbox series

[v1,2/2] dt-bindings: usb: Add bindings doc for Sunplus EHCI driver

Message ID 1644827562-17244-3-git-send-email-vincent.sunplus@gmail.com
State New
Headers show
Series Add driver for ehci in Sunplus SP7021 | expand

Commit Message

Vincent Shih Feb. 14, 2022, 8:32 a.m. UTC
Add bindings doc for Sunplus EHCI driver

Signed-off-by: Vincent Shih <vincent.sunplus@gmail.com>
---
 .../bindings/usb/sunplus,sp7021-usb-ehci.yaml      | 69 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/sunplus,sp7021-usb-ehci.yaml

Comments

Rob Herring (Arm) Feb. 22, 2022, 9:37 p.m. UTC | #1
On Mon, Feb 14, 2022 at 04:32:42PM +0800, Vincent Shih wrote:
> Add bindings doc for Sunplus EHCI driver
> 
> Signed-off-by: Vincent Shih <vincent.sunplus@gmail.com>
> ---
>  .../bindings/usb/sunplus,sp7021-usb-ehci.yaml      | 69 ++++++++++++++++++++++
>  MAINTAINERS                                        |  1 +
>  2 files changed, 70 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/sunplus,sp7021-usb-ehci.yaml
> 
> diff --git a/Documentation/devicetree/bindings/usb/sunplus,sp7021-usb-ehci.yaml b/Documentation/devicetree/bindings/usb/sunplus,sp7021-usb-ehci.yaml
> new file mode 100644
> index 0000000..299f7b7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/sunplus,sp7021-usb-ehci.yaml
> @@ -0,0 +1,69 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (C) Sunplus Co., Ltd. 2021
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/sunplus,sp7021-usb-ehci.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sunplus SP7021 EHCI Device Tree bindings for ehci0/ehci1
> +
> +maintainers:
> +  - Vincent Shih <vincent.sunplus@gmail.com>
> +
> +allOf:
> +  - $ref: usb-hcd.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - sunplus,sp7021-usb-ehci0
> +      - sunplus,sp7021-usb-ehci1
> +
> +  clocks:
> +    maxItems: 2
> +
> +  clock-names:
> +    items:
> +      - const: USB2_USBC0
> +      - const: USB2_UPHY0

This doesn't match what the driver looks for, though the 0 or 1 on the 
end is wrong. You obviously have not tested this against your actual dts 
file(s).

The 'USB2_' part is redundant. You only need enough information to 
distinguish clocks within a h/w block.

> +
> +  reg:
> +    maxItems: 4

You have to define each entry.

> +
> +  interrupts:
> +    maxItems: 1
> +
> +  nvmem-cell-names:
> +    description: names corresponding to the nvmem cells of disconnect voltage
> +    const: disc_vol
> +
> +  nvmem-cells:
> +    description: nvmem cell address of disconnect voltage
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - clocks
> +  - reg
> +  - interrupts
> +  - nvmem-cell-names
> +  - nvmem-cells
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    sp_ehci0: usb@9c102100 {
> +      compatible = "sunplus,sp7021-usb-ehci0";
> +      clocks = <&clkc 0x3a>, <&clkc 0x3d>;
> +      clock-names = "USB2_USBC0", "USB2_UPHY0";
> +      reg = <0x9c102100 0x68>, <0x9c004a80 0x80>,
> +               <0x9c000000 0x80>, <0x9c000200 0x80>;
> +      interrupt-parent = <&intc>;
> +      interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
> +      nvmem-cell-names = "disc_vol";
> +      nvmem-cells = <&disc_vol>;
> +    };
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 6c2faf3..49702c4 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -17951,6 +17951,7 @@ SUNPLUS USB EHCI DRIVER
>  M:	Vincent Shih <vincent.sunplus@gmail.com>
>  L:	linux-usb@vger.kernel.org
>  S:	Maintained
> +F:	Documentation/devicetree/bindings/nvmem/sunplus,sp7021-ocotp.yaml
>  F:	drivers/usb/host/ehci-sunplus.c
>  
>  SUPERH
> -- 
> 2.7.4
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/sunplus,sp7021-usb-ehci.yaml b/Documentation/devicetree/bindings/usb/sunplus,sp7021-usb-ehci.yaml
new file mode 100644
index 0000000..299f7b7
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/sunplus,sp7021-usb-ehci.yaml
@@ -0,0 +1,69 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/sunplus,sp7021-usb-ehci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus SP7021 EHCI Device Tree bindings for ehci0/ehci1
+
+maintainers:
+  - Vincent Shih <vincent.sunplus@gmail.com>
+
+allOf:
+  - $ref: usb-hcd.yaml#
+
+properties:
+  compatible:
+    enum:
+      - sunplus,sp7021-usb-ehci0
+      - sunplus,sp7021-usb-ehci1
+
+  clocks:
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: USB2_USBC0
+      - const: USB2_UPHY0
+
+  reg:
+    maxItems: 4
+
+  interrupts:
+    maxItems: 1
+
+  nvmem-cell-names:
+    description: names corresponding to the nvmem cells of disconnect voltage
+    const: disc_vol
+
+  nvmem-cells:
+    description: nvmem cell address of disconnect voltage
+    maxItems: 1
+
+required:
+  - compatible
+  - clocks
+  - reg
+  - interrupts
+  - nvmem-cell-names
+  - nvmem-cells
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    sp_ehci0: usb@9c102100 {
+      compatible = "sunplus,sp7021-usb-ehci0";
+      clocks = <&clkc 0x3a>, <&clkc 0x3d>;
+      clock-names = "USB2_USBC0", "USB2_UPHY0";
+      reg = <0x9c102100 0x68>, <0x9c004a80 0x80>,
+               <0x9c000000 0x80>, <0x9c000200 0x80>;
+      interrupt-parent = <&intc>;
+      interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
+      nvmem-cell-names = "disc_vol";
+      nvmem-cells = <&disc_vol>;
+    };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 6c2faf3..49702c4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17951,6 +17951,7 @@  SUNPLUS USB EHCI DRIVER
 M:	Vincent Shih <vincent.sunplus@gmail.com>
 L:	linux-usb@vger.kernel.org
 S:	Maintained
+F:	Documentation/devicetree/bindings/nvmem/sunplus,sp7021-ocotp.yaml
 F:	drivers/usb/host/ehci-sunplus.c
 
 SUPERH