Skip to contentSkip to conversation

dt-bindings: power: Convert mediatek,mt2701-scpsys to DT schema

PATCH Applied Rob Herring (Arm) 1 participant 2 messages Sep 28 – Oct 15

Subsystems (2)
lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

PATCH v2 1/1 dt-bindings: power: Convert mediatek,mt2701-scpsys to DT schema

Convert the mediatek,mt2701-scpsys binding to DT schema. The mt6735 and mt6765 don't exist anywhere. The mt8183 is covered by mediatek,mt8195-scpsys.yaml schema. With those dropped, the clock-names are trimmed to drop mm-*, isp-*, cam-*, and venc_lt. The venc_lt and mfg_2d supplies are dropped as well.

Assisted-by LLM

---
v2:
- Add per compatible clocks/clock-names constraints

---
 .../power/mediatek,mt2701-scpsys.yaml         | 184 ++++++++++++++++++
 .../bindings/soc/mediatek/scpsys.txt          |  79 --------
 2 files changed, 184 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml
 delete mode 100644 Documentation/devicetree/bindings/soc/mediatek/scpsys.txt
Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml new file +184 -0
new file mode 100644
index 000000000000..75c84abc865f
@@ -0,0 +1,184 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/mediatek,mt2701-scpsys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek SCPSYS
+
+maintainers:
+  - Matthias Brugger <[email protected]>
+  - AngeloGioacchino Del Regno <[email protected]>
+
+description: >
+  The System Control Processor System (SCPSYS) has several power management
+  related tasks in the system. The tasks include thermal measurement, dynamic
+  voltage frequency scaling (DVFS), interrupt filter and lowlevel sleep control.
+  The System Power Manager (SPM) inside the SCPSYS is for the MTCMOS power
+  domain control.
+
+  It provides the power domains defined in:
+    - include/dt-bindings/power/mt2701-power.h
+    - include/dt-bindings/power/mt2712-power.h
+    - include/dt-bindings/power/mt6797-power.h
+    - include/dt-bindings/power/mt7622-power.h
+    - include/dt-bindings/power/mt7623a-power.h
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - mediatek,mt7623a-scpsys
+          - mediatek,mt6797-scpsys
+      - items:
+          - enum:
+              - mediatek,mt2701-scpsys
+              - mediatek,mt2712-scpsys
+              - mediatek,mt7622-scpsys
+          - const: syscon
+      - items:
+          - const: mediatek,mt7623-scpsys
+          - const: mediatek,mt2701-scpsys
+          - const: syscon
+      - items:
+          - const: mediatek,mt7629-scpsys
+          - const: mediatek,mt7622-scpsys
+
+  '#power-domain-cells':
+    description: Always 1
+    const: 1
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 4
+
+  clocks:
+    minItems: 1
+    maxItems: 20
+
+  clock-names:
+    minItems: 1
+    maxItems: 6
+    items:
+      enum:
+        - mm
+        - mfg
+        - ethif
+        - venc
+        - jpgdec
+        - audio
+        - vdec
+        - hif_sel
+
+  vdec-supply: true
+  venc-supply: true
+  isp-supply: true
+  mm-supply: true
+  audio-supply: true
+  usb-supply: true
+  mfg_async-supply: true
+  mfg-supply: true
+
+  infracfg:
+    description: Infrastructure configuration controller phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+required:
+  - compatible
+  - '#power-domain-cells'
+  - reg
+  - infracfg
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt2701-scpsys
+    then:
+      properties:
+        clocks:
+          minItems: 3
+          maxItems: 3
+        clock-names:
+          items:
+            - const: mm
+            - const: mfg
+            - const: ethif
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt7623a-scpsys
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+        clock-names:
+          items:
+            - const: ethif
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt2712-scpsys
+    then:
+      properties:
+        clocks:
+          minItems: 6
+        clock-names:
+          items:
+            - const: mm
+            - const: mfg
+            - const: venc
+            - const: jpgdec
+            - const: audio
+            - const: vdec
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt7622-scpsys
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+        clock-names:
+          items:
+            - const: hif_sel
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt6797-scpsys
+    then:
+      properties:
+        clocks:
+          minItems: 3
+          maxItems: 3
+        clock-names:
+          items:
+            - const: mfg
+            - const: mm
+            - const: vdec
+
+examples:
+  - |
+    #include <dt-bindings/clock/mt2701-clk.h>
+
+    power-controller@10006000 {
+        #power-domain-cells = <1>;
+        compatible = "mediatek,mt2701-scpsys", "syscon";
+        reg = <0x10006000 0x1000>;
+        infracfg = <&infracfg>;
+        clocks = <&topckgen CLK_TOP_MM_SEL>,
+                  <&topckgen CLK_TOP_MFG_SEL>,
+                  <&topckgen CLK_TOP_ETHIF_SEL>;
+        clock-names = "mm", "mfg", "ethif";
+    };
Documentation/devicetree/bindings/soc/mediatek/scpsys.txt deleted +0 -79

79 lines not on this page · raw message

Signature · 1 line
2.53.0
author maintainer Applied
#1 lore raw
Quoted 11 lines · Rob Herring (Arm)

Convert the mediatek,mt2701-scpsys binding to DT schema. The mt6735 and mt6765 don't exist anywhere. The mt8183 is covered by mediatek,mt8195-scpsys.yaml schema. With those dropped, the clock-names are trimmed to drop mm-*, isp-*, cam-*, and venc_lt. The venc_lt and mfg_2d supplies are dropped as well.

Assisted-by LLM

---
v2:
- Add per compatible clocks/clock-names constraints

Quoted 7 lines
---
 .../power/mediatek,mt2701-scpsys.yaml         | 184 ++++++++++++++++++
 .../bindings/soc/mediatek/scpsys.txt          |  79 --------
 2 files changed, 184 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml
 delete mode 100644 Documentation/devicetree/bindings/soc/mediatek/scpsys.txt

Applied, thanks!