diff mbox series

[v2] dt-bindings: phy: Convert PXA1928 USB/HSIC PHY to DT schema

Message ID 20231002-pxa1928-usb-yaml-v2-1-121a7e02d29f@skole.hr
State Changes Requested
Headers show
Series [v2] dt-bindings: phy: Convert PXA1928 USB/HSIC PHY to DT schema | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 1 warnings, 41 lines checked
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Duje Mihanović Oct. 2, 2023, 7:34 p.m. UTC
Convert the binding for the Marvell PXA1928 USB and HSIC PHYs from TXT
to DT schema.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
---
Changes in v2:
- Add myself as maintainer
- Combine HSIC and USB bindings into one
- Drop unneeded quotes
- Remove example as it can't compile (probably because of clock
  reference)
- Link to v1: https://lore.kernel.org/r/20231001-pxa1928-usb-yaml-v1-1-9309a8c0c03f@skole.hr
---
 .../bindings/phy/marvell,pxa1928-usb-phy.yaml      | 41 ++++++++++++++++++++++
 .../devicetree/bindings/phy/pxa1928-usb-phy.txt    | 18 ----------
 2 files changed, 41 insertions(+), 18 deletions(-)


---
base-commit: 6465e260f48790807eef06b583b38ca9789b6072
change-id: 20231001-pxa1928-usb-yaml-809564082241

Best regards,

Comments

Krzysztof Kozlowski Oct. 3, 2023, 8:57 a.m. UTC | #1
On 02/10/2023 21:34, Duje Mihanović wrote:
> Convert the binding for the Marvell PXA1928 USB and HSIC PHYs from TXT
> to DT schema.
> 
> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
> ---
> Changes in v2:
> - Add myself as maintainer
> - Combine HSIC and USB bindings into one
> - Drop unneeded quotes
> - Remove example as it can't compile (probably because of clock
>   reference)
> - Link to v1: https://lore.kernel.org/r/20231001-pxa1928-usb-yaml-v1-1-9309a8c0c03f@skole.hr

Thank you for your patch. There is something to discuss/improve.


> +++ b/Documentation/devicetree/bindings/phy/marvell,pxa1928-usb-phy.yaml
> @@ -0,0 +1,41 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/phy/marvell,pxa1928-usb-phy.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Marvell PXA1928 USB/HSIC PHY
> +
> +maintainers:
> +  - Duje Mihanović <duje.mihanovic@skole.hr>
> +
> +properties:
> +  $nodename:
> +    pattern: '^phy@[a-f0-9]+$'

Drop nodename, we do no need enforce in each device schemas.

> +
> +  compatible:
> +    oneOf:
> +      - items:
> +          const: marvell,pxa1928-usb-phy
> +      - items:
> +          const: marvell,pxa1928-hsic-phy

Entire oneOf is just an enum (without items, no const):
enum:
  - foo
  - bar

> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  '#phy-cells':
> +    const: 0
> +
> +  resets:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - '#phy-cells'
> +
> +additionalProperties: false

Please add example DTS.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/marvell,pxa1928-usb-phy.yaml b/Documentation/devicetree/bindings/phy/marvell,pxa1928-usb-phy.yaml
new file mode 100644
index 000000000000..60cf3fa8d3bc
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/marvell,pxa1928-usb-phy.yaml
@@ -0,0 +1,41 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/marvell,pxa1928-usb-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell PXA1928 USB/HSIC PHY
+
+maintainers:
+  - Duje Mihanović <duje.mihanovic@skole.hr>
+
+properties:
+  $nodename:
+    pattern: '^phy@[a-f0-9]+$'
+
+  compatible:
+    oneOf:
+      - items:
+          const: marvell,pxa1928-usb-phy
+      - items:
+          const: marvell,pxa1928-hsic-phy
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  '#phy-cells':
+    const: 0
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - '#phy-cells'
+
+additionalProperties: false
diff --git a/Documentation/devicetree/bindings/phy/pxa1928-usb-phy.txt b/Documentation/devicetree/bindings/phy/pxa1928-usb-phy.txt
deleted file mode 100644
index da94426aa694..000000000000
--- a/Documentation/devicetree/bindings/phy/pxa1928-usb-phy.txt
+++ /dev/null
@@ -1,18 +0,0 @@ 
-* Marvell PXA1928 USB and HSIC PHYs
-
-Required properties:
-- compatible: "marvell,pxa1928-usb-phy" or "marvell,pxa1928-hsic-phy"
-- reg: base address and length of the registers
-- clocks - A single clock. From common clock binding.
-- #phys-cells: should be 0. From common phy binding.
-- resets: reference to the reset controller
-
-Example:
-
-	usbphy: phy@7000 {
-		compatible = "marvell,pxa1928-usb-phy";
-		reg = <0x7000 0xe0>;
-		clocks = <&apmu_clocks PXA1928_CLK_USB>;
-		#phy-cells = <0>;
-	};
-