Skip to contentSkip to conversation

dt-bindings: interrupt-controller: Convert nxp,lpc3220-mic.txt to yaml format

PATCH Applied Leonardo Felipe Takao Hirata 4 participants 5 messages Feb 28, 2025 – Mar 4, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 dt-bindings: interrupt-controller: Convert nxp,lpc3220-mic.txt to yaml format

Convert NXP LPC3220-MIC to DT schema.

---
Changes in v3:
- Add interrupts property description
- Fix interrupts items descriptions
- Remove else condition

---
 .../interrupt-controller/nxp,lpc3220-mic.txt  | 58 ----------------
 .../interrupt-controller/nxp,lpc3220-mic.yaml | 69 +++++++++++++++++++
 2 files changed, 69 insertions(+), 58 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.txt deleted +0 -58
deleted file mode 100644
index 0bfb3ba55f4c..000000000000
@@ -1,58 +0,0 @@
-* NXP LPC32xx MIC, SIC1 and SIC2 Interrupt Controllers
-
-Required properties:
-- compatible: "nxp,lpc3220-mic" or "nxp,lpc3220-sic".
-- reg: should contain IC registers location and length.
-- interrupt-controller: identifies the node as an interrupt controller.
-- #interrupt-cells: the number of cells to define an interrupt, should be 2.
-  The first cell is the IRQ number, the second cell is used to specify
-  one of the supported IRQ types:
-      IRQ_TYPE_EDGE_RISING = low-to-high edge triggered,
-      IRQ_TYPE_EDGE_FALLING = high-to-low edge triggered,
-      IRQ_TYPE_LEVEL_HIGH = active high level-sensitive,
-      IRQ_TYPE_LEVEL_LOW = active low level-sensitive.
-  Reset value is IRQ_TYPE_LEVEL_LOW.
-
-Optional properties:
-- interrupts: empty for MIC interrupt controller, cascaded MIC
-  hardware interrupts for SIC1 and SIC2
-
-Examples:
-
-	/* LPC32xx MIC, SIC1 and SIC2 interrupt controllers */
-	mic: interrupt-controller@40008000 {
-		compatible = "nxp,lpc3220-mic";
-		reg = <0x40008000 0x4000>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-	};
-
-	sic1: interrupt-controller@4000c000 {
-		compatible = "nxp,lpc3220-sic";
-		reg = <0x4000c000 0x4000>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-
-		interrupt-parent = <&mic>;
-		interrupts = <0 IRQ_TYPE_LEVEL_LOW>,
-			     <30 IRQ_TYPE_LEVEL_LOW>;
-	};
-
-	sic2: interrupt-controller@40010000 {
-		compatible = "nxp,lpc3220-sic";
-		reg = <0x40010000 0x4000>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-
-		interrupt-parent = <&mic>;
-		interrupts = <1 IRQ_TYPE_LEVEL_LOW>,
-			     <31 IRQ_TYPE_LEVEL_LOW>;
-	};
-
-	/* ADC */
-	adc@40048000 {
-		compatible = "nxp,lpc3220-adc";
-		reg = <0x40048000 0x1000>;
-		interrupt-parent = <&sic1>;
-		interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
-	};
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
2.43.0
Acked-by on v3 1/1
#1 lore raw
Quoted 27 lines · Leonardo Felipe Takao Hirata
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +21 -0
new file mode 100644
index 000000000000..59e8814a15b7
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/nxp,lpc3220-mic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP LPC32xx MIC, SIC1 and SIC2 Interrupt Controllers
+
+maintainers:
+  - Vladimir Zapolskiy <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - nxp,lpc3220-mic
+      - nxp,lpc3220-sic
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 30

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +9 -0
+
+  '#interrupt-cells':
+    const: 2
+
+  interrupts:
+    items:
+      - description: Regular interrupt request
+      - description: Fast interrupt request
 
+    description: IRQ and FIQ outputs of SIC1/SIC2 to the MIC.

If you respin, drop this line and...

Quoted 21 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +21 -0
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nxp,lpc3220-sic
+    then:
+      required:
+        - interrupts
+
+additionalProperties: false
+
+examples:
+  - |

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 61

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    mic: interrupt-controller@40008000 {
+        compatible = "nxp,lpc3220-mic";
+        reg = <0x40008000 0x4000>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+    };
+
+    sic1: interrupt-controller@4000c000 {

...the unused label "sic1".

Quoted 11 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +8 -0
+        compatible = "nxp,lpc3220-sic";
+        reg = <0x4000c000 0x4000>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+        interrupt-parent = <&mic>;
+        interrupts = <0 IRQ_TYPE_LEVEL_LOW>,
+                    <30 IRQ_TYPE_LEVEL_LOW>;
+    };
Signature · 1 line
2.43.0
maintainer Applied
#2 lore raw
In reply to Leonardo Felipe Takao Hirata
Quoted 8 lines · Leonardo Felipe Takao Hirata

Convert NXP LPC3220-MIC to DT schema.

---
Changes in v3:
- Add interrupts property description
- Fix interrupts items descriptions
- Remove else condition

Quoted 7 lines
---
 .../interrupt-controller/nxp,lpc3220-mic.txt  | 58 ----------------
 .../interrupt-controller/nxp,lpc3220-mic.yaml | 69 +++++++++++++++++++
 2 files changed, 69 insertions(+), 58 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml

Applied, thanks!

Reviewed-by on v3 1/1
#3 lore raw
In reply to Leonardo Felipe Takao Hirata

Hello Leonardo.

Quoted 9 lines · Leonardo Felipe Takao Hirata

Convert NXP LPC3220-MIC to DT schema.

---
Changes in v3:
- Add interrupts property description
- Fix interrupts items descriptions
- Remove else condition
---

<snip>

Quoted 22 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +16 -0
new file mode 100644
index 000000000000..59e8814a15b7
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/nxp,lpc3220-mic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP LPC32xx MIC, SIC1 and SIC2 Interrupt Controllers
+
+maintainers:
+  - Vladimir Zapolskiy <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - nxp,lpc3220-mic
+      - nxp,lpc3220-sic

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 2
+
+  interrupts:

Please put here

minItems: 2
maxItems: 2

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 30

Quoted 4 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +4 -0
+    items:
+      - description: Regular interrupt request
+      - description: Fast interrupt request
+    description: IRQ and FIQ outputs of SIC1/SIC2 to the MIC.

Having both two descriptions under 'items:' and another description is excessive, please leave only one of two.

Quoted 21 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +21 -0
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nxp,lpc3220-sic
+    then:
+      required:
+        - interrupts
+
+additionalProperties: false
+
+examples:
+  - |

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 61

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    mic: interrupt-controller@40008000 {
+        compatible = "nxp,lpc3220-mic";
+        reg = <0x40008000 0x4000>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+    };
+
+    sic1: interrupt-controller@4000c000 {

Here sic1 label is not used, please remove.

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 69

Quoted 8 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +8 -0
+        compatible = "nxp,lpc3220-sic";
+        reg = <0x4000c000 0x4000>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+        interrupt-parent = <&mic>;
+        interrupts = <0 IRQ_TYPE_LEVEL_LOW>,
+                    <30 IRQ_TYPE_LEVEL_LOW>;
+    };

After the fixes please feel free to add the tag:

--
Best wishes,
Vladimir

#4 lore raw

Hi Vladimir.

Quoted 50 lines · Vladimir Zapolskiy

Hello Leonardo.

Quoted 9 lines · Leonardo Felipe Takao Hirata

Convert NXP LPC3220-MIC to DT schema.

---
Changes in v3:
  - Add interrupts property description
  - Fix interrupts items descriptions
  - Remove else condition
---

<snip>

Quoted 22 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +16 -0
new file mode 100644
index 000000000000..59e8814a15b7
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/nxp,lpc3220-mic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP LPC32xx MIC, SIC1 and SIC2 Interrupt Controllers
+
+maintainers:
+  - Vladimir Zapolskiy <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - nxp,lpc3220-mic
+      - nxp,lpc3220-sic

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 2
+
+  interrupts:

Please put here

Quoted 3 lines

  minItems: 2
  maxItems: 2

I didn't add them in this patch because example-schema.yaml states that minItems and maxItems are already implied. The following code is taken from the example-schema.yaml.

items:
- description: core registers
- description: aux registers
# minItems/maxItems equal to 2 is implied

Besides, adding minItems and maxItems triggers the respective warnings:

- "minItems" is only needed if less than the "items" list length
- "maxItems" is not needed with an "items" list

Quoted 51 lines

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 30

Quoted 4 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +4 -0
+    items:
+      - description: Regular interrupt request
+      - description: Fast interrupt request
+    description: IRQ and FIQ outputs of SIC1/SIC2 to the MIC.

Having both two descriptions under 'items:' and another description is excessive, please leave only one of two.

Quoted 21 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +21 -0
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nxp,lpc3220-sic
+    then:
+      required:
+        - interrupts
+
+additionalProperties: false
+
+examples:
+  - |

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 61

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    mic: interrupt-controller@40008000 {
+        compatible = "nxp,lpc3220-mic";
+        reg = <0x40008000 0x4000>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+    };
+
+    sic1: interrupt-controller@4000c000 {

Here sic1 label is not used, please remove.

Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml line 69

Quoted 8 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +8 -0
+        compatible = "nxp,lpc3220-sic";
+        reg = <0x4000c000 0x4000>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+        interrupt-parent = <&mic>;
+        interrupts = <0 IRQ_TYPE_LEVEL_LOW>,
+                    <30 IRQ_TYPE_LEVEL_LOW>;
+    };
Quoted 7 lines

After the fixes please feel free to add the tag:

Signature · 2 lines
Best wishes,
Vladimir

Rob,

Do you want these changes on top of what was applied or a complete patch?

Best regards,

Leonardo Hirata