dt-bindings: arm: mediatek: apmixedsys: Convert to DT schema
authorYassine Oudjana <y.oudjana@protonmail.com>
Sun, 24 Apr 2022 08:46:46 +0000 (12:46 +0400)
committerRob Herring <robh@kernel.org>
Tue, 26 Apr 2022 18:47:44 +0000 (13:47 -0500)
Convert apmixedsys bindings to DT schema format. MT2701, MT7623 and
MT7629 device trees currently have the syscon compatible without
it being mentioned in the old DT bindings file which introduces
dtbs_check errors when converting to DT schema as-is, so
mediatek,mt2701-apmixedsys and mediatek,mt7629-apmixedsys are placed
in the last items list with the syscon compatible, and syscon is
added to the mediatek,mt7623-apmixedsys list.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220424084647.76577-3-y.oudjana@protonmail.com
Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt [deleted file]
Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml [new file with mode: 0644]

diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt
deleted file mode 100644 (file)
index 3fa7558..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-Mediatek apmixedsys controller
-==============================
-
-The Mediatek apmixedsys controller provides the PLLs to the system.
-
-Required Properties:
-
-- compatible: Should be one of:
-       - "mediatek,mt2701-apmixedsys"
-       - "mediatek,mt2712-apmixedsys", "syscon"
-       - "mediatek,mt6765-apmixedsys", "syscon"
-       - "mediatek,mt6779-apmixedsys", "syscon"
-       - "mediatek,mt6797-apmixedsys"
-       - "mediatek,mt7622-apmixedsys"
-       - "mediatek,mt7623-apmixedsys", "mediatek,mt2701-apmixedsys"
-       - "mediatek,mt7629-apmixedsys"
-       - "mediatek,mt7986-apmixedsys"
-       - "mediatek,mt8135-apmixedsys"
-       - "mediatek,mt8167-apmixedsys", "syscon"
-       - "mediatek,mt8173-apmixedsys"
-       - "mediatek,mt8183-apmixedsys", "syscon"
-       - "mediatek,mt8516-apmixedsys"
-- #clock-cells: Must be 1
-
-The apmixedsys controller uses the common clk binding from
-Documentation/devicetree/bindings/clock/clock-bindings.txt
-The available clocks are defined in dt-bindings/clock/mt*-clk.h.
-
-Example:
-
-apmixedsys: clock-controller@10209000 {
-       compatible = "mediatek,mt8173-apmixedsys";
-       reg = <0 0x10209000 0 0x1000>;
-       #clock-cells = <1>;
-};
diff --git a/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml b/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml
new file mode 100644 (file)
index 0000000..7705461
--- /dev/null
@@ -0,0 +1,61 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/clock/mediatek,apmixedsys.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: MediaTek AP Mixedsys Controller
+
+maintainers:
+  - Michael Turquette <mturquette@baylibre.com>
+  - Stephen Boyd <sboyd@kernel.org>
+
+description:
+  The Mediatek apmixedsys controller provides PLLs to the system.
+  The clock values can be found in <dt-bindings/clock/mt*-clk.h>.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - mediatek,mt6797-apmixedsys
+          - mediatek,mt7622-apmixedsys
+          - mediatek,mt7986-apmixedsys
+          - mediatek,mt8135-apmixedsys
+          - mediatek,mt8173-apmixedsys
+          - mediatek,mt8516-apmixedsys
+      - items:
+          - const: mediatek,mt7623-apmixedsys
+          - const: mediatek,mt2701-apmixedsys
+          - const: syscon
+      - items:
+          - enum:
+              - mediatek,mt2701-apmixedsys
+              - mediatek,mt2712-apmixedsys
+              - mediatek,mt6765-apmixedsys
+              - mediatek,mt6779-apmixedsys
+              - mediatek,mt7629-apmixedsys
+              - mediatek,mt8167-apmixedsys
+              - mediatek,mt8183-apmixedsys
+          - const: syscon
+
+  reg:
+    maxItems: 1
+
+  '#clock-cells':
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - '#clock-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    apmixedsys: clock-controller@10209000 {
+        compatible = "mediatek,mt8173-apmixedsys";
+        reg = <0x10209000 0x1000>;
+        #clock-cells = <1>;
+    };