Skip to contentSkip to conversation

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

PATCH Superseded Leonardo Felipe Takao Hirata 3 participants 5 messages Feb 26, 2025

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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

Convert NXP LPC3220-MIC to DT schema.

---
Changes in v2:
- Fix SoB
- Remove reg description
- List #interrupt-cell items
- Add interrupt restriction per variant
- Remove extra examples

---
 .../interrupt-controller/nxp,lpc3220-mic.txt  | 58 --------------
 .../interrupt-controller/nxp,lpc3220-mic.yaml | 80 +++++++++++++++++++
 2 files changed, 80 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 +80 -0

80 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Quoted 10 lines · Leonardo Felipe Takao Hirata
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+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 31

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+
+  '#interrupt-cells':
+    const: 2
+
+  interrupts:
+    items:
+      - description:
+          IRQ number.
+      - description: |
+          IRQ type. Can be one of:

That's not correct. Previously you said you have here two interrupts - SIC1 and SIC2. Now you say you have one intrerrupt "IRQ Number" and second interrupt "IRQ type". This makes little sense - your interrupt is not "IRQ type". Unless it is an interrupt signaling that other interrupt has type?

Look at other bindings what are the interrupts.

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

Quoted 5 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +5 -0
+
+              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.

None of these are relevant here.

Best regards,
Krzysztof

#2 lore raw
In reply to Leonardo Felipe Takao Hirata

Hello Leonardo,

thank you so much for working on this.

Quoted 17 lines · Leonardo Felipe Takao Hirata

Convert NXP LPC3220-MIC to DT schema.

---
Changes in v2:
- Fix SoB
- Remove reg description
- List #interrupt-cell items
- Add interrupt restriction per variant
- Remove extra examples

---
  .../interrupt-controller/nxp,lpc3220-mic.txt  | 58 --------------
  .../interrupt-controller/nxp,lpc3220-mic.yaml | 80 +++++++++++++++++++
  2 files changed, 80 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

<snip>

Quoted 25 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +19 -0
new file mode 100644
index 000000000000..489bd329bc4e
@@ -0,0 +1,80 @@
+# 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

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

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

For sake of better understanding SIC1 and SIC2 interrupt controllers are chained to MIC, that's why there is 'interrupts' property present, and here 0/1 interrupt values are for regular IRQ, 30/31 are for fast IRQ.

Also please add here

minItems: 2
maxItems: 2

I believe that the 'interrupts' property can be just left without any given description, or just give a simple description like

IRQ and FIQ outputs of sub interrupt controllers to the main interrupt controller

Quoted 18 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +18 -0
+      - description: |
+          IRQ type. Can be one of:
+
+              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.
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+
+allOf:
+  - if:

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

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+      properties:
+        compatible:
+          contains:
+            const: nxp,lpc3220-sic
+    then:
+      required:
+        - interrupts
+    else:
+      properties:
+        interrupts: false

Please check if this 'else' condition can be removed.

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

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

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +10 -0
+
+    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>;
+    };

--
Best wishes,
Vladimir

#3 lore raw
Quoted 26 lines · Vladimir Zapolskiy
Quoted 9 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +9 -0
+
+properties:
+  compatible:
+    enum:
+      - nxp,lpc3220-mic
+      - nxp,lpc3220-sic
+
+  reg:
+    maxItems: 1

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

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

For sake of better understanding SIC1 and SIC2 interrupt controllers are chained to MIC, that's why there is 'interrupts' property present, and here 0/1 interrupt values are for regular IRQ, 30/31 are for fast IRQ.

Also please add here

Quoted 7 lines

minItems: 2
maxItems: 2

I believe that the 'interrupts' property can be just left without any given description, or just give a simple description like

IRQ and FIQ outputs of sub interrupt controllers to the main interrupt controller

If they are obvious, e.g. maxItems: 2 would be enough, but I understand that these are distinctive interrupts from dedicated blocks - 1 and 2 - so they should be listed.
- description: IRQ/FIO of SIC1 (or whatever name is here better)
- description: IRQ/FIO of SIC2

Best regards,
Krzysztof

#4 lore raw

Hello Krzysztof and Vladimir,

Thanks a lot for your time. I really appreciate your feedbacks.

Quoted 34 lines · Krzysztof Kozlowski
Quoted 26 lines · Vladimir Zapolskiy
Quoted 9 lines
Documentation/devicetree/bindings/interrupt-controller/nxp,lpc3220-mic.yaml new file +9 -0
+
+properties:
+  compatible:
+    enum:
+      - nxp,lpc3220-mic
+      - nxp,lpc3220-sic
+
+  reg:
+    maxItems: 1

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

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

For sake of better understanding SIC1 and SIC2 interrupt controllers are chained to MIC, that's why there is 'interrupts' property present, and here 0/1 interrupt values are for regular IRQ, 30/31 are for fast IRQ.

Also please add here

Quoted 7 lines

minItems: 2
maxItems: 2

I believe that the 'interrupts' property can be just left without any given description, or just give a simple description like

IRQ and FIQ outputs of sub interrupt controllers to the main interrupt controller

Quoted 8 lines

If they are obvious, e.g. maxItems: 2 would be enough, but I understand that these are distinctive interrupts from dedicated blocks - 1 and 2 - so they should be listed.
- description: IRQ/FIO of SIC1 (or whatever name is here better)
- description: IRQ/FIO of SIC2

Best regards,
Krzysztof

If I understood correctly, the first item of interrupts is dedicated to IRQ type and the second to FIQ type. Then, I was thinking about listing them like:

- description: Regular interrupt request
- description: Fast interrupt request

What do you guys think?

Best regards,
Leonardo Hirata