Skip to contentSkip to conversation

Initial support for the Realtek interrupt controller

PATCH Superseded James Tai 5 participants 26 messages Nov 17, 2023 – Jan 3, 2024

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

James Tai

author
#0 lore raw

v2 cover Initial support for the Realtek interrupt controller

Introduce an interrupt controller driver for Realtek DHC (Digital Home Center) SoCs.

Change log:
v1 -> v2:
- Tested the bindings using 'make dt_binding_check'
- Fixed code style issues
- Resolved kernel test robot build warnings
- Replaced spin_lock_irqsave with raw_spin_lock
- Replaced magic number with macro
- Removed the realtek_intc_set_affinity function

James Tai (6):
dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs
irqchip: Add interrupt controller support for Realtek DHC SoCs
irqchip: Introduce RTD1319 support using the Realtek common interrupt
controller driver
irqchip: Introduce RTD1319D support using the Realtek common interrupt
controller driver
irqchip: Introduce RTD1325 support using the Realtek common interrupt
controller driver
irqchip: Introduce RTD1619B support using the Realtek common interrupt
controller driver

 .../realtek,rtd1319-intc.yaml                 |  79 ++++++
 .../realtek,rtd1319d-intc.yaml                |  79 ++++++
 .../realtek,rtd1325-intc.yaml                 |  79 ++++++
 .../realtek,rtd1619b-intc.yaml                |  78 ++++++
 drivers/irqchip/Kconfig                       |  28 +++
 drivers/irqchip/Makefile                      |   5 +
 drivers/irqchip/irq-realtek-intc-common.c     | 192 +++++++++++++++
 drivers/irqchip/irq-realtek-intc-common.h     |  77 ++++++
 drivers/irqchip/irq-realtek-rtd1319.c         | 218 +++++++++++++++++
 drivers/irqchip/irq-realtek-rtd1319d.c        | 227 ++++++++++++++++++
 drivers/irqchip/irq-realtek-rtd1325.c         | 227 ++++++++++++++++++
 drivers/irqchip/irq-realtek-rtd1619b.c        | 217 +++++++++++++++++
 12 files changed, 1506 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1619b-intc.yaml
 create mode 100644 drivers/irqchip/irq-realtek-intc-common.c
 create mode 100644 drivers/irqchip/irq-realtek-intc-common.h
 create mode 100644 drivers/irqchip/irq-realtek-rtd1319.c
 create mode 100644 drivers/irqchip/irq-realtek-rtd1319d.c
 create mode 100644 drivers/irqchip/irq-realtek-rtd1325.c
 create mode 100644 drivers/irqchip/irq-realtek-rtd1619b.c
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v2 1/6 dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Add the YAML documentation for Realtek DHC SoCs.

CC Thomas Gleixner <[email protected]>
CC Marc Zyngier <[email protected]>
CC Rob Herring <[email protected]>
CC Krzysztof Kozlowski <[email protected]>
CC Conor Dooley <[email protected]>

---
v1 to v2 change:
- Tested the bindings using 'make dt_binding_check'
- Fixed code style issues

 .../realtek,rtd1319-intc.yaml                 | 79 +++++++++++++++++++
 .../realtek,rtd1319d-intc.yaml                | 79 +++++++++++++++++++
 .../realtek,rtd1325-intc.yaml                 | 79 +++++++++++++++++++
 .../realtek,rtd1619b-intc.yaml                | 78 ++++++++++++++++++
 4 files changed, 315 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1619b-intc.yaml
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +79 -0
new file mode 100644
index 000000000000..b88f3ac07cd9
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/realtek,rtd1319-intc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek DHC RTD1319 Interrupt Controller Device Tree Bindings
+
+description:
+  This interrupt controller is a component of Realtek DHC RTD1319 and
+  is designed to receive interrupts from peripheral devices.
+
+  Each DHC SoC has two sets of interrupt controllers, each capable of
+  handling up to 32 interrupts.
+
+maintainers:
+  - James Tai <[email protected]>
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  "#interrupt-cells":
+    const: 1
+
+  compatible:
+    enum:
+      - realtek,rtd1319-intc-iso
+      - realtek,rtd1319-intc-misc
+
+  "#address-cells":
+    const: 0
+
+  interrupt-controller: true
+
+  interrupts-extended:
+    minItems: 1
+    maxItems: 4
+
+  reg:
+    maxItems: 1
+
+required:
+  - "#interrupt-cells"
+  - "#address-cells"
+  - compatible
+  - interrupt-controller
+  - interrupts-extended
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    rtd1319_iso_irq: interrupt-controller@40 {
+      compatible = "realtek,rtd1319-intc-iso";
+      reg = <0x00 0x40>;
+      interrupts-extended = <&gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-controller;
+      #address-cells = <0>;
+      #interrupt-cells = <1>;
+    };
+
+    rtd1319_misc_irq: interrupt-controller@80 {
+      compatible = "realtek,rtd1319-intc-misc";
+      reg = <0x00 0x80>;
+      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-controller;
+      #address-cells = <0>;
+      #interrupt-cells = <1>;
+    };
+...
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml new file +79 -0

79 lines not on this page · raw message

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml new file +79 -0

79 lines not on this page · raw message

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1619b-intc.yaml new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
2.25.1
maintainer
#2 lore raw

Re: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Quoted 15 lines · James Tai

Add the YAML documentation for Realtek DHC SoCs.

CC Thomas Gleixner <[email protected]>
CC Marc Zyngier <[email protected]>
CC Rob Herring <[email protected]>
CC Krzysztof Kozlowski <[email protected]>
CC Conor Dooley <[email protected]>

---
v1 to v2 change:
- Tested the bindings using 'make dt_binding_check'
- Fixed code style issues

Quoted 10 lines
 .../realtek,rtd1319-intc.yaml                 | 79 +++++++++++++++++++
 .../realtek,rtd1319d-intc.yaml                | 79 +++++++++++++++++++
 .../realtek,rtd1325-intc.yaml                 | 79 +++++++++++++++++++
 .../realtek,rtd1619b-intc.yaml                | 78 ++++++++++++++++++
 4 files changed, 315 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1619b-intc.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml: title: 'Realtek DHC RTD1319D Interrupt Controller Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml: title: 'Realtek DHC RTD1325 Interrupt Controller Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1619b-intc.yaml: title: 'Realtek DHC RTD1619B Interrupt Controller Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml: title: 'Realtek DHC RTD1319 Interrupt Controller Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
from schema $id: http://devicetree.org/meta-schemas/base.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#3 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Hi Rob,

Quoted 45 lines

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/inter rupt-controller/realtek,rtd1319d-intc.yaml: title: 'Realtek DHC RTD1319D Interrupt Controller Device Tree Bindings' should not be valid under {'pattern':
'([Bb]inding| [Ss]chema)'}
hint: Everything is a binding/schema, no need to say it. Describe what
hardware the binding is for.
from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/inter rupt-controller/realtek,rtd1325-intc.yaml: title: 'Realtek DHC RTD1325 Interrupt Controller Device Tree Bindings' should not be valid under {'pattern':
'([Bb]inding| [Ss]chema)'}
hint: Everything is a binding/schema, no need to say it. Describe what
hardware the binding is for.
from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/inter rupt-controller/realtek,rtd1619b-intc.yaml: title: 'Realtek DHC RTD1619B Interrupt Controller Device Tree Bindings' should not be valid under {'pattern':
'([Bb]inding| [Ss]chema)'}
hint: Everything is a binding/schema, no need to say it. Describe what
hardware the binding is for.
from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/inter rupt-controller/realtek,rtd1319-intc.yaml: title: 'Realtek DHC RTD1319 Interrupt Controller Device Tree Bindings' should not be valid under {'pattern':
'([Bb]inding| [Ss]chema)'}
hint: Everything is a binding/schema, no need to say it. Describe what
hardware the binding is for.
from schema $id: http://devicetree.org/meta-schemas/base.yaml#

doc reference errors (make refcheckdocs):

See
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/202311171627
[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

Quoted 5 lines

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

OK. I will update the dtschema and rerun 'make dt_binding_check'.

Thank you for your feedback.

Regards,
James

#4 lore raw

Re: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

In reply to James Tai
kernel test robot noticed the following build warnings:

Hi James,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/irq/core]
[also build test WARNING on robh/for-next linus/master v6.7-rc1 next-20231117] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/James-Tai/dt-bindings-interrupt-controller-Add-support-for-Realtek-DHC-SoCs/20231118-003036
base:   tip/irq/core
patch link:    https://lore.kernel.org/r/20231117162709.1096585-2-james.tai%40realtek.com
patch subject: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231118/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

dtcheck warnings: (new ones prefixed by >>)

>> Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1619b-intc.yaml: title: 'Realtek DHC RTD1619B Interrupt Controller Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
   	hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
   	from schema $id: http://devicetree.org/meta-schemas/base.yaml#
>> Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml: title: 'Realtek DHC RTD1319 Interrupt Controller Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
   	hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
   	from schema $id: http://devicetree.org/meta-schemas/base.yaml#
>> Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml: title: 'Realtek DHC RTD1319D Interrupt Controller Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
   	hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
   	from schema $id: http://devicetree.org/meta-schemas/base.yaml#
>> Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml: title: 'Realtek DHC RTD1325 Interrupt Controller Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}

hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for. from schema $id: http://devicetree.org/meta-schemas/base.yaml#

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#5 lore raw

Re: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

In reply to James Tai
Quoted 10 lines · James Tai

Add the YAML documentation for Realtek DHC SoCs.

CC Thomas Gleixner <[email protected]>
CC Marc Zyngier <[email protected]>
CC Rob Herring <[email protected]>
CC Krzysztof Kozlowski <[email protected]>
CC Conor Dooley <[email protected]>
Quoted 3 lines

---
v1 to v2 change:
- Tested the bindings using 'make dt_binding_check'

I doubt it.

And bot prooves it.

Quoted 1 line

- Fixed code style issues

Be specific - what code style issues did you fix?

Quoted 10 lines
 .../realtek,rtd1319-intc.yaml                 | 79 +++++++++++++++++++
 .../realtek,rtd1319d-intc.yaml                | 79 +++++++++++++++++++
 .../realtek,rtd1325-intc.yaml                 | 79 +++++++++++++++++++
 .../realtek,rtd1619b-intc.yaml                | 78 ++++++++++++++++++
 4 files changed, 315 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1619b-intc.yaml

Why do you have four bindings for the same? Please explain me the differences.

Quoted 21 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +14 -0
new file mode 100644
index 000000000000..b88f3ac07cd9
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/realtek,rtd1319-intc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek DHC RTD1319 Interrupt Controller Device Tree Bindings
+
+description:
+  This interrupt controller is a component of Realtek DHC RTD1319 and
+  is designed to receive interrupts from peripheral devices.
+
+  Each DHC SoC has two sets of interrupt controllers, each capable of
+  handling up to 32 interrupts.

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml line 24

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +10 -0
+
+maintainers:
+  - James Tai <[email protected]>
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  "#interrupt-cells":
+    const: 1

compatible is first, put the cells next to other interrupt controller properties.

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml line 36

Quoted 12 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +12 -0
+
+  compatible:
+    enum:
+      - realtek,rtd1319-intc-iso
+      - realtek,rtd1319-intc-misc
+
+  "#address-cells":
+    const: 0
+
+  interrupt-controller: true
+
+  interrupts-extended:

interrupts instead.

Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely.

Quoted 23 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +23 -0
+    minItems: 1
+    maxItems: 4
+
+  reg:
+    maxItems: 1
+
+required:
+  - "#interrupt-cells"
+  - "#address-cells"
+  - compatible
+  - interrupt-controller
+  - interrupts-extended
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    rtd1319_iso_irq: interrupt-controller@40 {
+      compatible = "realtek,rtd1319-intc-iso";

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml line 69

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +10 -0
+      reg = <0x00 0x40>;
+      interrupts-extended = <&gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-controller;
+      #address-cells = <0>;
+      #interrupt-cells = <1>;
+    };
+
+    rtd1319_misc_irq: interrupt-controller@80 {
+      compatible = "realtek,rtd1319-intc-misc";

Drop, one example is enough. This is the same as previous.

Quoted 35 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +10 -0
+      reg = <0x00 0x80>;
+      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-controller;
+      #address-cells = <0>;
+      #interrupt-cells = <1>;
+    };
+...
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml new file +19 -0
new file mode 100644
index 000000000000..75aba448baf7
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/realtek,rtd1319d-intc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek DHC RTD1319D Interrupt Controller Device Tree Bindings
+
+description:
+  This interrupt controller is a component of Realtek DHC RTD1319D and
+  is designed to receive interrupts from peripheral devices.
+
+  Each DHC SoC has two sets of interrupt controllers, each capable of
+  handling up to 32 interrupts.
+
+maintainers:
+  - James Tai <[email protected]>
+
+allOf:

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml new file +10 -0
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  "#interrupt-cells":
+    const: 1
+
+  compatible:
+    enum:
+      - realtek,rtd1319d-intc-iso
+      - realtek,rtd1319d-intc-misc

So this is the same as the other one? Why it cannot be part of that one?
...

Quoted 5 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml new file +5 -0
+
+maintainers:
+  - James Tai <[email protected]>
+
+allOf:

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml line 44

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319d-intc.yaml new file +10 -0
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  "#interrupt-cells":
+    const: 1
+
+  compatible:
+    enum:
+      - realtek,rtd1325-intc-iso
+      - realtek,rtd1325-intc-misc

All my comments apply to all your bindings...

Best regards,
Krzysztof

#6 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Hi Krzysztof,

Quoted 3 lines

I doubt it.

And bot prooves it.

My 'dtschema' is outdated, and I encountered errors after updating it. I will fix it in next patches.

Quoted 4 lines
Quoted 1 line

- Fixed code style issues

Be specific - what code style issues did you fix?

I fixed the code style issue related to the license declaration.

Quoted 7 lines
Quoted 2 lines
 .../realtek,rtd1319-intc.yaml                 | 79

+++++++++++++++++++

Quoted 1 line
 .../realtek,rtd1319d-intc.yaml                | 79

+++++++++++++++++++

Quoted 1 line
 .../realtek,rtd1325-intc.yaml                 | 79

+++++++++++++++++++

Quoted 14 lines
Quoted 11 lines
 .../realtek,rtd1619b-intc.yaml                | 78 ++++++++++++++++++
 4 files changed, 315 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319 -intc.yaml create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319 d-intc.yaml create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325 -intc.yaml create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1619 b-intc.yaml

Why do you have four bindings for the same? Please explain me the differences.

If the bindings can be shared, I will consolidate it into one.

Quoted 32 lines
Quoted 32 lines

diff --git a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd13 19-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd13 19-intc.yaml
new file mode 100644
index 000000000000..b88f3ac07cd9

Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +21 -0
+++ td1319-intc.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id:
+http://devicetree.org/schemas/interrupt-controller/realtek,rtd1319-in
+tc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek DHC RTD1319 Interrupt Controller Device Tree Bindings
+
+description:
+  This interrupt controller is a component of Realtek DHC RTD1319 and
+  is designed to receive interrupts from peripheral devices.
+
+  Each DHC SoC has two sets of interrupt controllers, each capable of
+ handling up to 32 interrupts.
+
+maintainers:
+  - James Tai <[email protected]>
+
+allOf:
Quoted 9 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,r line 25

Quoted 5 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +5 -0
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  "#interrupt-cells":
+    const: 1

compatible is first, put the cells next to other interrupt controller properties.

I will fix it in next patches.

Quoted 15 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,r line 37

Quoted 12 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +12 -0
+
+  compatible:
+    enum:
+      - realtek,rtd1319-intc-iso
+      - realtek,rtd1319-intc-misc
+
+  "#address-cells":
+    const: 0
+
+  interrupt-controller: true
+
+  interrupts-extended:

interrupts instead.

Quoted 3 lines

Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely.

I will replace it with 'interrupts'. Since our Interrupt controller architecture doesn't involve multiple interrupt sources, using 'interrupts' should suffice.

Quoted 27 lines
Quoted 27 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +27 -0
+    minItems: 1
+    maxItems: 4
+
+  reg:
+    maxItems: 1
+
+required:
+  - "#interrupt-cells"
+  - "#address-cells"
+  - compatible
+  - interrupt-controller
+  - interrupts-extended
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    rtd1319_iso_irq: interrupt-controller@40 {
+      compatible = "realtek,rtd1319-intc-iso";
+      reg = <0x00 0x40>;
+      interrupts-extended = <&gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-controller;
Quoted 9 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,r line 70

Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +6 -0
+      #address-cells = <0>;
+      #interrupt-cells = <1>;
+    };
+
+    rtd1319_misc_irq: interrupt-controller@80 {
+      compatible = "realtek,rtd1319-intc-misc";

Drop, one example is enough. This is the same as previous.

I will fix it in next patches.

Quoted 49 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,r line 73

Quoted 3 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +3 -0
+      reg = <0x00 0x80>;
+      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+                            <&gic GIC_SPI 89

IRQ_TYPE_LEVEL_HIGH>,

Documentation/devicetree/bindings/interrupt-controller/realtek,r line 74

Quoted 1 line
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +1 -0
+                            <&gic GIC_SPI 90

IRQ_TYPE_LEVEL_HIGH>,

Documentation/devicetree/bindings/interrupt-controller/realtek,r line 75

Quoted 1 line
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +1 -0
+                            <&gic GIC_SPI 39

IRQ_TYPE_LEVEL_HIGH>;

Quoted 41 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +5 -0
+      interrupt-controller;
+      #address-cells = <0>;
+      #interrupt-cells = <1>;
+    };
+...

diff --git a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd13 19d-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd13 19d-intc.yaml
new file mode 100644
index 000000000000..75aba448baf7

Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +26 -0
+++ td1319d-intc.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id:
+http://devicetree.org/schemas/interrupt-controller/realtek,rtd1319d-i
+ntc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek DHC RTD1319D Interrupt Controller Device Tree Bindings
+
+description:
+  This interrupt controller is a component of Realtek DHC RTD1319D
+and
+  is designed to receive interrupts from peripheral devices.
+
+  Each DHC SoC has two sets of interrupt controllers, each capable of
+ handling up to 32 interrupts.
+
+maintainers:
+  - James Tai <[email protected]>
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  "#interrupt-cells":
Quoted 8 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,r line 31

Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,r new file +6 -0
+    const: 1
+
+  compatible:
+    enum:
+      - realtek,rtd1319d-intc-iso
+      - realtek,rtd1319d-intc-misc

So this is the same as the other one? Why it cannot be part of that one?

I will consolidate these parts into a single file.

Thank you for your feedback.

Regards,
James

#7 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Hi Krzysztof,

Quoted 15 lines
Quoted 15 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml line 36

Quoted 12 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +12 -0
+
+  compatible:
+    enum:
+      - realtek,rtd1319-intc-iso
+      - realtek,rtd1319-intc-misc
+
+  "#address-cells":
+    const: 0
+
+  interrupt-controller: true
+
+  interrupts-extended:

interrupts instead.

Quoted 6 lines
Quoted 3 lines

Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely.

I will replace it with 'interrupts'. Since our Interrupt controller architecture doesn't involve multiple interrupt sources, using 'interrupts' should suffice.

Due to changes in hardware design, some peripheral interrupts pin initially connected to the Realtek interrupt controller were redirected to the GIC. However, the associated fields and statuses in the Realtek interrupt controller registers were not removed.
As a result, these interrupts cannot be cleared by peripheral register, and their status clearing is still needing the Realtek interrupt controller driver to manage.

That's why flexibility is necessary.

Regards,
James

#8 lore raw

Re: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Quoted 24 lines · James Tai [戴志峰]

Hi Krzysztof,

Quoted 15 lines
Quoted 15 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml line 36

Quoted 12 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +12 -0
+
+  compatible:
+    enum:
+      - realtek,rtd1319-intc-iso
+      - realtek,rtd1319-intc-misc
+
+  "#address-cells":
+    const: 0
+
+  interrupt-controller: true
+
+  interrupts-extended:

interrupts instead.

Quoted 6 lines
Quoted 3 lines

Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely.

I will replace it with 'interrupts'. Since our Interrupt controller architecture doesn't involve multiple interrupt sources, using 'interrupts' should suffice.

Quoted 5 lines

Due to changes in hardware design, some peripheral interrupts pin initially connected to the Realtek interrupt controller were redirected to the GIC. However, the associated fields and statuses in the Realtek interrupt controller registers were not removed.
As a result, these interrupts cannot be cleared by peripheral register, and their status clearing is still needing the Realtek interrupt controller driver to manage.

That's why flexibility is necessary.

This does not explain why this is not fixed per variant.

Best regards,
Krzysztof

#9 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Hi Krzysztof,

Quoted 25 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml line 36

Quoted 12 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +12 -0
+
+  compatible:
+    enum:
+      - realtek,rtd1319-intc-iso
+      - realtek,rtd1319-intc-misc
+
+  "#address-cells":
+    const: 0
+
+  interrupt-controller: true
+
+  interrupts-extended:

interrupts instead.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely.

I will replace it with 'interrupts'. Since our Interrupt controller architecture doesn't involve multiple interrupt sources, using 'interrupts'

should suffice.

Quoted 3 lines
Quoted 1 line

Due to changes in hardware design, some peripheral interrupts pin initially

connected to the Realtek interrupt controller were redirected to the GIC.

Quoted 9 lines
Quoted 1 line

However, the associated fields and statuses in the Realtek interrupt controller

registers were not removed.

Quoted 1 line

As a result, these interrupts cannot be cleared by peripheral register, and their

status clearing is still needing the Realtek interrupt controller driver to manage.

Quoted 2 lines

That's why flexibility is necessary.

This does not explain why this is not fixed per variant.

Does the definition of "fixed" you mentioned refer to fixed interrupt pins? If not, could you please give me an example and let me know what you mean by "fixed"?

Thank you for your feedback.

Regards,
James

#10 lore raw

Re: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Quoted 17 lines · James Tai [戴志峰]
Quoted 17 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 1 line

+ interrupts-extended:

interrupts instead.

Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely.

I will replace it with 'interrupts'. Since our Interrupt controller architecture doesn't involve multiple interrupt sources, using 'interrupts'

should suffice.

Quoted 3 lines
Quoted 1 line

Due to changes in hardware design, some peripheral interrupts pin initially

connected to the Realtek interrupt controller were redirected to the GIC.

Quoted 1 line

However, the associated fields and statuses in the Realtek interrupt controller

registers were not removed.

Quoted 1 line

As a result, these interrupts cannot be cleared by peripheral register, and their

Quoted 8 lines
Quoted 6 lines

status clearing is still needing the Realtek interrupt controller driver to manage.

Quoted 2 lines

That's why flexibility is necessary.

This does not explain why this is not fixed per variant.

Does the definition of "fixed" you mentioned refer to fixed interrupt pins? If not, could you please give me an example and let me know what you mean by "fixed"?

Number of the interrupts per each device or variant should be strictly defined, not variable.

Please wrap your emails according to mail netiquette.

Best regards,
Krzysztof

#11 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Hi Krzysztof,

Quoted 28 lines
Quoted 14 lines
Quoted 14 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 1 line

+ interrupts-extended:

interrupts instead.

Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely.

I will replace it with 'interrupts'. Since our Interrupt controller architecture doesn't involve multiple interrupt sources, using 'interrupts'

should suffice.

Quoted 4 lines
Quoted 1 line

Due to changes in hardware design, some peripheral interrupts pin initially

Quoted 7 lines
Quoted 7 lines

connected to the Realtek interrupt controller were redirected to the GIC.

Quoted 2 lines

However, the associated fields and statuses in the Realtek interrupt controller

registers were not removed.

Quoted 2 lines

As a result, these interrupts cannot be cleared by peripheral register, and their

status clearing is still needing the Realtek interrupt controller driver to

manage.

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

That's why flexibility is necessary.

This does not explain why this is not fixed per variant.

Quoted 6 lines
Quoted 3 lines

Does the definition of "fixed" you mentioned refer to fixed interrupt pins? If not, could you please give me an example and let me know what you mean by "fixed"?

Number of the interrupts per each device or variant should be strictly defined, not variable.

Thank you for your explanation.

The DHC platforms contain two interrupt controllers, each handling peripheral device interrupts in the two power domains. While each has a fixed IRQ numbers, the specific IRQ varies depending on the platform.

Quoted 1 line

Please wrap your emails according to mail netiquette.

I apologize for my rude way of asking the question. I will improve my expression.

Thank for your feedback.

Regards,
James

#12 lore raw

Re: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Quoted 34 lines · James Tai [戴志峰]

Hi Krzysztof,

Quoted 32 lines
Quoted 14 lines
Quoted 14 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 1 line

+ interrupts-extended:

interrupts instead.

Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely.

I will replace it with 'interrupts'. Since our Interrupt controller architecture doesn't involve multiple interrupt sources, using 'interrupts'

should suffice.

Quoted 4 lines
Quoted 1 line

Due to changes in hardware design, some peripheral interrupts pin initially

Quoted 7 lines
Quoted 7 lines

connected to the Realtek interrupt controller were redirected to the GIC.

Quoted 2 lines

However, the associated fields and statuses in the Realtek interrupt controller

registers were not removed.

Quoted 2 lines

As a result, these interrupts cannot be cleared by peripheral register, and their

status clearing is still needing the Realtek interrupt controller driver to

manage.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

That's why flexibility is necessary.

This does not explain why this is not fixed per variant.

Does the definition of "fixed" you mentioned refer to fixed interrupt pins? If not, could you please give me an example and let me know what you mean by "fixed"?

Quoted 7 lines
Quoted 2 lines

Number of the interrupts per each device or variant should be strictly defined, not variable.

Thank you for your explanation.

The DHC platforms contain two interrupt controllers, each handling peripheral device interrupts in the two power domains. While each has a fixed IRQ numbers, the specific IRQ varies depending on the platform.

Srsly, what "specific IRQ" has anything to do with "number of interrupts per each device or variant"?

Look at all other bindings covering multiple devices and their clocks/interrupts/interconnects/reg etc.

Best regards,
Krzysztof

#13 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Hi Krzysztof,

Quoted 40 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

+ interrupts-extended:

interrupts instead.

Anyway, you must describe the items. Why this is not fixed but

flexible?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Hardware has different number of pins? That's unlikely.

I will replace it with 'interrupts'. Since our Interrupt controller architecture doesn't involve multiple interrupt sources, using

'interrupts'

Quoted 29 lines
Quoted 20 lines
Quoted 5 lines
Quoted 5 lines

should suffice.

Quoted 4 lines
Quoted 1 line

Due to changes in hardware design, some peripheral interrupts pin initially

Quoted 8 lines
Quoted 8 lines

connected to the Realtek interrupt controller were redirected to the GIC.

Quoted 2 lines

However, the associated fields and statuses in the Realtek interrupt controller

registers were not removed.

Quoted 2 lines

As a result, these interrupts cannot be cleared by peripheral register, and their

status clearing is still needing the Realtek interrupt controller driver to

manage.

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

That's why flexibility is necessary.

This does not explain why this is not fixed per variant.

Quoted 6 lines
Quoted 3 lines

Does the definition of "fixed" you mentioned refer to fixed interrupt pins? If not, could you please give me an example and let me know what you mean by "fixed"?

Number of the interrupts per each device or variant should be strictly defined, not variable.

Thank you for your explanation.

Quoted 7 lines
Quoted 1 line

The DHC platforms contain two interrupt controllers, each handling peripheral

device interrupts in the two power domains.

Quoted 2 lines

While each has a fixed IRQ numbers, the specific IRQ varies depending on the platform.

Srsly, what "specific IRQ" has anything to do with "number of interrupts per each device or variant"?

Each Realtek interrupt controller is assigned a fixed IRQ, which gathers interrupts from peripheral devices such as i2c, spi, ethernet phy, timer, uart, watchdog, rtc, pwm, etc.

Due to modifications in the hardware circuit, certain peripheral device interrupts including watchdog, rtc, uart1, and uart2 are now redirected to the GIC. Consequently, these devices cannot clear interrupt statuses through their own registers. To resolve this, we manage their interrupts through the Realtek interrupt controller.

This results in a variation in the number of IRQs registered by the interrupt controllers of ISO (isolation) and MSIC (miscellaneous).

In the DTS examples provided in the initial patch release, IRQs 41 and 42 are assigned to the Realtek interrupt controller.
As watchdog, rtc, uart1, and uart2 interrupts no longer use IRQs 41 or 42, their IRQs (0, 39, 89, 90) are assigned to be registered by the Realtek interrupt controller.

Fixed IRQs:
- 41: peripheral devices (iso power domain)
- 42: peripheral devices (misc power domain)

Specific IRQs:
- 0: watchdog (iso power domain)
- 39: rtc (misc power domain)
- 89: uart1 (misc power domain)
- 90: uart2 (misc power domain)

Examples(v1 patches):

    iso_irq_mux: iso_irq_mux@40 {
      compatible = "realtek,rtd1319-intc-iso";
      reg = <0x00 0x40>;
      interrupts-extended = <&gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };

    misc_irq_mux: misc_irq_mux@80 {
      compatible = "realtek,rtd1319-intc-misc";
      reg = <0x00 0x80>;
      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };

    iso_irq_mux: iso_irq_mux@40 {
      compatible = "realtek,rtd1319d-intc-iso";
      reg = <0x00 0x40>;
      interrupts-extended = <&gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
                         <&gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };

    misc_irq_mux: misc_irq_mux@80 {
      compatible = "realtek,rtd1319d-intc-misc";
      reg = <0x00 0x80>;
      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };

    iso_irq_mux: iso_irq_mux@40 {
      compatible = "realtek,rtd1325-intc-iso";
      reg = <0x00 0x40>;
      interrupts-extended = <&gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };

    misc_irq_mux: misc_irq_mux@80 {
      compatible = "realtek,rtd1325-intc-misc";
      reg = <0x00 0x80>;
      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };

    iso_irq_mux: iso_irq_mux@40 {
      compatible = "realtek,rtd1619b-intc-iso";
      reg = <0x00 0x40>;
      interrupts-extended = <&gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };

    misc_irq_mux: misc_irq_mux@80 {
      compatible = "realtek,rtd1619b-intc-misc";
      reg = <0x00 0x80>;
      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };
Quoted 3 lines

Look at all other bindings covering multiple devices and their clocks/interrupts/interconnects/reg etc.

May I adopt the approach used in this YAML for my case?
https://www.kernel.org/doc/Documentation/devicetree/bindings/timer/allwinner%2Csun4i-a10-timer.yaml

Thank you for your feedback.

Regards,
James

#14 lore raw

Re: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Quoted 11 lines · James Tai [戴志峰]
    misc_irq_mux: misc_irq_mux@80 {
      compatible = "realtek,rtd1619b-intc-misc";
      reg = <0x00 0x80>;
      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };

So you have strictly defined number of interrupts and the actual interrupts per variant.

Quoted 7 lines
Quoted 4 lines

Look at all other bindings covering multiple devices and their clocks/interrupts/interconnects/reg etc.

May I adopt the approach used in this YAML for my case?
https://www.kernel.org/doc/Documentation/devicetree/bindings/timer/allwinner%2Csun4i-a10-timer.yaml

I am asking for this since few emails.

Look:
"Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely."

Best regards,
Krzysztof

#15 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

Hi Krzysztof,

Quoted 12 lines
Quoted 11 lines
    misc_irq_mux: misc_irq_mux@80 {
      compatible = "realtek,rtd1619b-intc-misc";
      reg = <0x00 0x80>;
      interrupts-extended = <&gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
                        <&gic GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
      interrupt-controller;
      #address-cells = <0>;
      #interrupt-cells = <1>;
    };
Quoted 3 lines

So you have strictly defined number of interrupts and the actual interrupts per variant.

Yes, I have defined them.

Quoted 10 lines
Quoted 8 lines
Quoted 4 lines

Look at all other bindings covering multiple devices and their clocks/interrupts/interconnects/reg etc.

May I adopt the approach used in this YAML for my case?
https://www.kernel.org/doc/Documentation/devicetree/bindings/timer/all
winner%2Csun4i-a10-timer.yaml

Quoted 6 lines

I am asking for this since few emails.

Look:
"Anyway, you must describe the items. Why this is not fixed but flexible? Hardware has different number of pins? That's unlikely."

It is fixed, and the hardware has the same number of pins.

Regards,
James

#16 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

In reply to James Tai [戴志峰]

Hi Krzysztof,

Quoted 50 lines
Quoted 41 lines
Quoted 41 lines

diff --git a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1 3
19d-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1 3
19d-intc.yaml
new file mode 100644
index 000000000000..75aba448baf7

Documentation/devicetree/bindings/interrupt-controller/realtek, new file +29 -0
+++ r
+++ td1319d-intc.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id:
+http://devicetree.org/schemas/interrupt-controller/realtek,rtd1319d-
+i
+ntc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek DHC RTD1319D Interrupt Controller Device Tree
+Bindings
+
+description:
+  This interrupt controller is a component of Realtek DHC RTD1319D
+and
+  is designed to receive interrupts from peripheral devices.
+
+  Each DHC SoC has two sets of interrupt controllers, each capable
+ of handling up to 32 interrupts.
+
+maintainers:
+  - James Tai <[email protected]>
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  "#interrupt-cells":
Quoted 8 lines

Documentation/devicetree/bindings/interrupt-controller/realtek, line 33

Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/realtek, new file +6 -0
+    const: 1
+
+  compatible:
+    enum:
+      - realtek,rtd1319d-intc-iso
+      - realtek,rtd1319d-intc-misc

So this is the same as the other one? Why it cannot be part of that one?

Quoted 2 lines

I will consolidate these parts into a single file.

I initially believed that each platform needed its YAML file for documentation and specific configurations. However, it appears that this isn't the case.

Regards,
James

#17 lore raw

RE: [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs

In reply to Krzysztof Kozlowski

Hi Krzysztof,

Quoted 9 lines
Quoted 9 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1319-intc.yaml new file +9 -0
+
+maintainers:
+  - James Tai <[email protected]>
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  "#interrupt-cells":
Quoted 9 lines

Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml line 29

Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/realtek,rtd1325-intc.yaml new file +6 -0
+    const: 1
+
+  compatible:
+    enum:
+      - realtek,rtd1325-intc-iso
+      - realtek,rtd1325-intc-misc

All my comments apply to all your bindings...

Okay, I will apply to all My bindings.

Regards,
James

author
#18 lore raw

PATCH v2 2/6 irqchip: Add interrupt controller support for Realtek DHC SoCs

In reply to James Tai

Realtek DHC (Digital Home Center) SoCs share a common interrupt controller design. This universal interrupt controller driver provides support for various variants within the Realtek DHC SoC family.

Each DHC SoC features two sets of extended interrupt controllers, each capable of handling up to 32 interrupts. These expansion controllers are connected to the GIC (Generic Interrupt Controller).

CC Thomas Gleixner <[email protected]>
CC Marc Zyngier <[email protected]>

---
v1 to v2 change:
- Fixed code style issues
- Removed the realtek_intc_set_affinity funcation
- Replaced spin_lock_irqsave with raw_spin_lock

 drivers/irqchip/Kconfig                   |   4 +
 drivers/irqchip/Makefile                  |   1 +
 drivers/irqchip/irq-realtek-intc-common.c | 192 ++++++++++++++++++++++
 drivers/irqchip/irq-realtek-intc-common.h |  77 +++++++++
 4 files changed, 274 insertions(+)
 create mode 100644 drivers/irqchip/irq-realtek-intc-common.c
 create mode 100644 drivers/irqchip/irq-realtek-intc-common.h
drivers/irqchip/Kconfig +4 -0
index f7149d0f3d45..267c3429b48d 100644
@@ -218,6 +218,10 @@ config RDA_INTC
 	bool
 	select IRQ_DOMAIN
 
+config REALTEK_DHC_INTC
+	tristate
+	select IRQ_DOMAIN
+
 config RENESAS_INTC_IRQPIN
 	bool "Renesas INTC External IRQ Pin Support" if COMPILE_TEST
 	select IRQ_DOMAIN
drivers/irqchip/Makefile +1 -0
index ffd945fe71aa..f6774af7fde2 100644
@@ -47,6 +47,7 @@ obj-$(CONFIG_IRQ_MIPS_CPU)		+= irq-mips-cpu.o
 obj-$(CONFIG_IXP4XX_IRQ)		+= irq-ixp4xx.o
 obj-$(CONFIG_JCORE_AIC)			+= irq-jcore-aic.o
 obj-$(CONFIG_RDA_INTC)			+= irq-rda-intc.o
+obj-$(CONFIG_REALTEK_DHC_INTC)		+= irq-realtek-intc-common.o
 obj-$(CONFIG_RENESAS_INTC_IRQPIN)	+= irq-renesas-intc-irqpin.o
 obj-$(CONFIG_RENESAS_IRQC)		+= irq-renesas-irqc.o
 obj-$(CONFIG_RENESAS_RZA1_IRQC)		+= irq-renesas-rza1.o
drivers/irqchip/irq-realtek-intc-common.c new file +192 -0

192 lines not on this page · raw message

drivers/irqchip/irq-realtek-intc-common.h new file +77 -0

77 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#19 lore raw

PATCH v2 3/6 irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver

In reply to James Tai

Add support for the RTD1319 platform.

---
v1 to v2 change:
- Resolved kernel test robot build warnings
- Replaced magic number with macro
- Fixed code style issues

 drivers/irqchip/Kconfig               |   6 +
 drivers/irqchip/Makefile              |   1 +
 drivers/irqchip/irq-realtek-rtd1319.c | 218 ++++++++++++++++++++++++++
 3 files changed, 225 insertions(+)
 create mode 100644 drivers/irqchip/irq-realtek-rtd1319.c
drivers/irqchip/Kconfig +6 -0
index 267c3429b48d..05856ce885fa 100644
@@ -222,6 +222,12 @@ config REALTEK_DHC_INTC
 	tristate
 	select IRQ_DOMAIN
 
+config REALTEK_RTD1319_INTC
+	tristate "Realtek RTD1319 interrupt controller"
+	select REALTEK_DHC_INTC
+	help
+	  Support for Realtek RTD1319 Interrupt Controller.
+
 config RENESAS_INTC_IRQPIN
 	bool "Renesas INTC External IRQ Pin Support" if COMPILE_TEST
 	select IRQ_DOMAIN
drivers/irqchip/Makefile +1 -0
index f6774af7fde2..6a2650b0a924 100644
@@ -48,6 +48,7 @@ obj-$(CONFIG_IXP4XX_IRQ)		+= irq-ixp4xx.o
 obj-$(CONFIG_JCORE_AIC)			+= irq-jcore-aic.o
 obj-$(CONFIG_RDA_INTC)			+= irq-rda-intc.o
 obj-$(CONFIG_REALTEK_DHC_INTC)		+= irq-realtek-intc-common.o
+obj-$(CONFIG_REALTEK_RTD1319_INTC)	+= irq-realtek-rtd1319.o
 obj-$(CONFIG_RENESAS_INTC_IRQPIN)	+= irq-renesas-intc-irqpin.o
 obj-$(CONFIG_RENESAS_IRQC)		+= irq-renesas-irqc.o
 obj-$(CONFIG_RENESAS_RZA1_IRQC)		+= irq-renesas-rza1.o
drivers/irqchip/irq-realtek-rtd1319.c new file +218 -0

218 lines not on this page · raw message

Signature · 1 line
2.25.1
#20 lore raw

Re: [PATCH v2 3/6] irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver

Hi James,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/James-Tai/dt-bindings-interrupt-controller-Add-support-for-Realtek-DHC-SoCs/20231118-003036
base:   tip/irq/core
patch link:    https://lore.kernel.org/r/20231117162709.1096585-4-james.tai%40realtek.com
patch subject: [PATCH v2 3/6] irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver
config: nios2-randconfig-r081-20231120 (https://download.01.org/0day-ci/archive/20231120/[email protected]/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231120/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
drivers/irqchip/irq-realtek-intc-common.c:179 realtek_intc_probe() warn: ignoring unreachable code. drivers/irqchip/irq-realtek-intc-common.c:187 realtek_intc_probe() warn: 'data->base' from of_iomap() not released on lines: 176,182.

vim +179 drivers/irqchip/irq-realtek-intc-common.c

40e5ff4eaef72b James Tai 2023-11-18  155  int realtek_intc_probe(struct platform_device *pdev, const struct realtek_intc_info *info)
40e5ff4eaef72b James Tai 2023-11-18  156  {
40e5ff4eaef72b James Tai 2023-11-18  157  	struct realtek_intc_data *data;
40e5ff4eaef72b James Tai 2023-11-18  158  	struct device *dev = &pdev->dev;
40e5ff4eaef72b James Tai 2023-11-18  159  	struct device_node *node = dev->of_node;
40e5ff4eaef72b James Tai 2023-11-18  160  	int ret, i;
40e5ff4eaef72b James Tai 2023-11-18  161  
40e5ff4eaef72b James Tai 2023-11-18  162  	data = devm_kzalloc(dev, struct_size(data, subset_data, info->cfg_num), GFP_KERNEL);
40e5ff4eaef72b James Tai 2023-11-18  163  	if (!data)
40e5ff4eaef72b James Tai 2023-11-18  164  		return -ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18  165  
40e5ff4eaef72b James Tai 2023-11-18  166  	data->base = of_iomap(node, 0);
40e5ff4eaef72b James Tai 2023-11-18  167  	if (!data->base)
40e5ff4eaef72b James Tai 2023-11-18  168  		return -ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18  169  
40e5ff4eaef72b James Tai 2023-11-18  170  	data->info = info;
40e5ff4eaef72b James Tai 2023-11-18  171  
40e5ff4eaef72b James Tai 2023-11-18  172  	raw_spin_lock_init(&data->lock);
40e5ff4eaef72b James Tai 2023-11-18  173  
40e5ff4eaef72b James Tai 2023-11-18  174  	data->domain = irq_domain_add_linear(node, 32, &realtek_intc_domain_ops, data);
40e5ff4eaef72b James Tai 2023-11-18  175  	if (!data->domain)
40e5ff4eaef72b James Tai 2023-11-18  176  		return -ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18  177  
40e5ff4eaef72b James Tai 2023-11-18  178  	data->subset_data_num = info->cfg_num;
40e5ff4eaef72b James Tai 2023-11-18 @179  	for (i = 0; i < info->cfg_num; i++) {
40e5ff4eaef72b James Tai 2023-11-18  180  		ret = realtek_intc_subset(node, data, i);
40e5ff4eaef72b James Tai 2023-11-18  181  		WARN(ret, "failed to init subset %d: %d", i, ret);
40e5ff4eaef72b James Tai 2023-11-18  182  		return -ENOMEM;

This loop just returns -ENOMEM. Missing if statement? No clean up either. Needs to release resources before returning.

40e5ff4eaef72b James Tai 2023-11-18  183  	}
40e5ff4eaef72b James Tai 2023-11-18  184  
40e5ff4eaef72b James Tai 2023-11-18  185  	platform_set_drvdata(pdev, data);
40e5ff4eaef72b James Tai 2023-11-18  186  
40e5ff4eaef72b James Tai 2023-11-18 @187  	return 0;
40e5ff4eaef72b James Tai 2023-11-18  188  }
40e5ff4eaef72b James Tai 2023-11-18  189  EXPORT_SYMBOL(realtek_intc_probe);
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#21 lore raw

RE: [PATCH v2 3/6] irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver

Hi Dan,

Quoted 53 lines

smatch warnings:
drivers/irqchip/irq-realtek-intc-common.c:179 realtek_intc_probe() warn:
ignoring unreachable code. drivers/irqchip/irq-realtek-intc-common.c:187 realtek_intc_probe() warn:
'data->base' from of_iomap() not released on lines: 176,182.

vim +179 drivers/irqchip/irq-realtek-intc-common.c

40e5ff4eaef72b James Tai 2023-11-18 155 int realtek_intc_probe(struct platform_device *pdev, const struct realtek_intc_info *info) 40e5ff4eaef72b James Tai 2023-11-18 156 {
40e5ff4eaef72b James Tai 2023-11-18 157 struct realtek_intc_data
*data;
40e5ff4eaef72b James Tai 2023-11-18 158 struct device *dev =
&pdev->dev;
40e5ff4eaef72b James Tai 2023-11-18 159 struct device_node *node
= dev->of_node;

40e5ff4eaef72b James Tai 2023-11-18  160        int ret, i;
40e5ff4eaef72b James Tai 2023-11-18  161
40e5ff4eaef72b James Tai 2023-11-18  162        data = devm_kzalloc(dev,

struct_size(data, subset_data, info->cfg_num), GFP_KERNEL);
40e5ff4eaef72b James Tai 2023-11-18 163 if (!data)
40e5ff4eaef72b James Tai 2023-11-18 164 return
-ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18 165
40e5ff4eaef72b James Tai 2023-11-18 166 data->base =
of_iomap(node, 0);
40e5ff4eaef72b James Tai 2023-11-18 167 if (!data->base)
40e5ff4eaef72b James Tai 2023-11-18 168 return
-ENOMEM;

40e5ff4eaef72b James Tai 2023-11-18  169
40e5ff4eaef72b James Tai 2023-11-18  170        data->info = info;
40e5ff4eaef72b James Tai 2023-11-18  171
40e5ff4eaef72b James Tai 2023-11-18  172

raw_spin_lock_init(&data->lock);
40e5ff4eaef72b James Tai 2023-11-18 173
40e5ff4eaef72b James Tai 2023-11-18 174 data->domain =
irq_domain_add_linear(node, 32, &realtek_intc_domain_ops, data);
40e5ff4eaef72b James Tai 2023-11-18 175 if (!data->domain)
40e5ff4eaef72b James Tai 2023-11-18 176 return
-ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18 177
40e5ff4eaef72b James Tai 2023-11-18 178 data->subset_data_num
= info->cfg_num;
40e5ff4eaef72b James Tai 2023-11-18 @179 for (i = 0; i <
info->cfg_num; i++) {
40e5ff4eaef72b James Tai 2023-11-18 180 ret =
realtek_intc_subset(node, data, i);
40e5ff4eaef72b James Tai 2023-11-18 181 WARN(ret,
"failed to init subset %d: %d", i, ret);
40e5ff4eaef72b James Tai 2023-11-18 182 return
-ENOMEM;

Quoted 2 lines

This loop just returns -ENOMEM. Missing if statement? No clean up either. Needs to release resources before returning.

I will fix it in next patches.

Thank you for your feedback.

Regards,
James

#22 lore raw

Re: [PATCH v2 3/6] irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver

In reply to James Tai

Hi James,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/James-Tai/dt-bindings-interrupt-controller-Add-support-for-Realtek-DHC-SoCs/20231118-003036
base:   tip/irq/core
patch link:    https://lore.kernel.org/r/20231117162709.1096585-4-james.tai%40realtek.com
patch subject: [PATCH v2 3/6] irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver
config: nios2-randconfig-r081-20231120 (https://download.01.org/0day-ci/archive/20231217/[email protected]/config)
compiler: nios2-linux-gcc (GCC) 13.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
drivers/irqchip/irq-realtek-intc-common.c:179 realtek_intc_probe() warn: ignoring unreachable code. drivers/irqchip/irq-realtek-intc-common.c:187 realtek_intc_probe() warn: 'data->base' from of_iomap() not released on lines: 176,182.

vim +179 drivers/irqchip/irq-realtek-intc-common.c

40e5ff4eaef72b James Tai 2023-11-18  155  int realtek_intc_probe(struct platform_device *pdev, const struct realtek_intc_info *info)
40e5ff4eaef72b James Tai 2023-11-18  156  {
40e5ff4eaef72b James Tai 2023-11-18  157  	struct realtek_intc_data *data;
40e5ff4eaef72b James Tai 2023-11-18  158  	struct device *dev = &pdev->dev;
40e5ff4eaef72b James Tai 2023-11-18  159  	struct device_node *node = dev->of_node;
40e5ff4eaef72b James Tai 2023-11-18  160  	int ret, i;
40e5ff4eaef72b James Tai 2023-11-18  161  
40e5ff4eaef72b James Tai 2023-11-18  162  	data = devm_kzalloc(dev, struct_size(data, subset_data, info->cfg_num), GFP_KERNEL);
40e5ff4eaef72b James Tai 2023-11-18  163  	if (!data)
40e5ff4eaef72b James Tai 2023-11-18  164  		return -ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18  165  
40e5ff4eaef72b James Tai 2023-11-18  166  	data->base = of_iomap(node, 0);
40e5ff4eaef72b James Tai 2023-11-18  167  	if (!data->base)
40e5ff4eaef72b James Tai 2023-11-18  168  		return -ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18  169  
40e5ff4eaef72b James Tai 2023-11-18  170  	data->info = info;
40e5ff4eaef72b James Tai 2023-11-18  171  
40e5ff4eaef72b James Tai 2023-11-18  172  	raw_spin_lock_init(&data->lock);
40e5ff4eaef72b James Tai 2023-11-18  173  
40e5ff4eaef72b James Tai 2023-11-18  174  	data->domain = irq_domain_add_linear(node, 32, &realtek_intc_domain_ops, data);
40e5ff4eaef72b James Tai 2023-11-18  175  	if (!data->domain)
40e5ff4eaef72b James Tai 2023-11-18  176  		return -ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18  177  
40e5ff4eaef72b James Tai 2023-11-18  178  	data->subset_data_num = info->cfg_num;
40e5ff4eaef72b James Tai 2023-11-18 @179  	for (i = 0; i < info->cfg_num; i++) {
40e5ff4eaef72b James Tai 2023-11-18  180  		ret = realtek_intc_subset(node, data, i);
40e5ff4eaef72b James Tai 2023-11-18  181  		WARN(ret, "failed to init subset %d: %d", i, ret);

if statement missing

40e5ff4eaef72b James Tai 2023-11-18  182  		return -ENOMEM;
40e5ff4eaef72b James Tai 2023-11-18  183  	}
40e5ff4eaef72b James Tai 2023-11-18  184  
40e5ff4eaef72b James Tai 2023-11-18  185  	platform_set_drvdata(pdev, data);
40e5ff4eaef72b James Tai 2023-11-18  186  

40e5ff4eaef72b James Tai 2023-11-18 @187 return 0;
40e5ff4eaef72b James Tai 2023-11-18 188 }

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author
#23 lore raw

PATCH v2 4/6 irqchip: Introduce RTD1319D support using the Realtek common interrupt controller driver

In reply to James Tai

Add support for the RTD1319D platform.

---
v1 to v2 change:
- Resolved kernel test robot build warnings
- Replaced magic number with macro
- Fixed code style issues

 drivers/irqchip/Kconfig                |   6 +
 drivers/irqchip/Makefile               |   1 +
 drivers/irqchip/irq-realtek-rtd1319d.c | 227 +++++++++++++++++++++++++
 3 files changed, 234 insertions(+)
 create mode 100644 drivers/irqchip/irq-realtek-rtd1319d.c
drivers/irqchip/Kconfig +6 -0
index 05856ce885fa..c6552c513442 100644
@@ -228,6 +228,12 @@ config REALTEK_RTD1319_INTC
 	help
 	  Support for Realtek RTD1319 Interrupt Controller.
 
+config REALTEK_RTD1319D_INTC
+	tristate "Realtek RTD1319D interrupt controller"
+	select REALTEK_DHC_INTC
+	help
+	  Support for Realtek RTD1319D Interrupt Controller.
+
 config RENESAS_INTC_IRQPIN
 	bool "Renesas INTC External IRQ Pin Support" if COMPILE_TEST
 	select IRQ_DOMAIN
drivers/irqchip/Makefile +1 -0
index 6a2650b0a924..c8adaed4c1b2 100644
@@ -49,6 +49,7 @@ obj-$(CONFIG_JCORE_AIC)			+= irq-jcore-aic.o
 obj-$(CONFIG_RDA_INTC)			+= irq-rda-intc.o
 obj-$(CONFIG_REALTEK_DHC_INTC)		+= irq-realtek-intc-common.o
 obj-$(CONFIG_REALTEK_RTD1319_INTC)	+= irq-realtek-rtd1319.o
+obj-$(CONFIG_REALTEK_RTD1319D_INTC)	+= irq-realtek-rtd1319d.o
 obj-$(CONFIG_RENESAS_INTC_IRQPIN)	+= irq-renesas-intc-irqpin.o
 obj-$(CONFIG_RENESAS_IRQC)		+= irq-renesas-irqc.o
 obj-$(CONFIG_RENESAS_RZA1_IRQC)		+= irq-renesas-rza1.o
drivers/irqchip/irq-realtek-rtd1319d.c new file +227 -0

227 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#24 lore raw

PATCH v2 5/6 irqchip: Introduce RTD1325 support using the Realtek common interrupt controller driver

In reply to James Tai

Add support for the RTD1325 platform.

---
v1 to v2 change:
- Resolved kernel test robot build warnings
- Replaced magic number with macro
- Fixed code style issues

 drivers/irqchip/Kconfig               |   6 +
 drivers/irqchip/Makefile              |   1 +
 drivers/irqchip/irq-realtek-rtd1325.c | 227 ++++++++++++++++++++++++++
 3 files changed, 234 insertions(+)
 create mode 100644 drivers/irqchip/irq-realtek-rtd1325.c
drivers/irqchip/Kconfig +6 -0
index c6552c513442..65e2d67d1505 100644
@@ -234,6 +234,12 @@ config REALTEK_RTD1319D_INTC
 	help
 	  Support for Realtek RTD1319D Interrupt Controller.
 
+config REALTEK_RTD1325_INTC
+	tristate "Realtek RTD1325 interrupt controller"
+	select REALTEK_DHC_INTC
+	help
+	  Support for Realtek RTD1325 Interrupt Controller.
+
 config RENESAS_INTC_IRQPIN
 	bool "Renesas INTC External IRQ Pin Support" if COMPILE_TEST
 	select IRQ_DOMAIN
drivers/irqchip/Makefile +1 -0
index c8adaed4c1b2..eaa12928d60b 100644
@@ -50,6 +50,7 @@ obj-$(CONFIG_RDA_INTC)			+= irq-rda-intc.o
 obj-$(CONFIG_REALTEK_DHC_INTC)		+= irq-realtek-intc-common.o
 obj-$(CONFIG_REALTEK_RTD1319_INTC)	+= irq-realtek-rtd1319.o
 obj-$(CONFIG_REALTEK_RTD1319D_INTC)	+= irq-realtek-rtd1319d.o
+obj-$(CONFIG_REALTEK_RTD1325_INTC)	+= irq-realtek-rtd1325.o
 obj-$(CONFIG_RENESAS_INTC_IRQPIN)	+= irq-renesas-intc-irqpin.o
 obj-$(CONFIG_RENESAS_IRQC)		+= irq-renesas-irqc.o
 obj-$(CONFIG_RENESAS_RZA1_IRQC)		+= irq-renesas-rza1.o
drivers/irqchip/irq-realtek-rtd1325.c new file +227 -0

227 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#25 lore raw

PATCH v2 6/6 irqchip: Introduce RTD1619B support using the Realtek common interrupt controller driver

In reply to James Tai

Add support for the RTD1619B platform.

---
v1 to v2 change:
- Resolved kernel test robot build warnings
- Replaced magic number with macro
- Fixed code style issues

 drivers/irqchip/Kconfig                |   6 +
 drivers/irqchip/Makefile               |   1 +
 drivers/irqchip/irq-realtek-rtd1619b.c | 217 +++++++++++++++++++++++++
 3 files changed, 224 insertions(+)
 create mode 100644 drivers/irqchip/irq-realtek-rtd1619b.c
drivers/irqchip/Kconfig +6 -0
index 65e2d67d1505..c5b2762df420 100644
@@ -240,6 +240,12 @@ config REALTEK_RTD1325_INTC
 	help
 	  Support for Realtek RTD1325 Interrupt Controller.
 
+config REALTEK_RTD1619B_INTC
+	tristate "Realtek RTD1619B interrupt controller"
+	select REALTEK_DHC_INTC
+	help
+	  Support for Realtek RTD1619B Interrupt Controller.
+
 config RENESAS_INTC_IRQPIN
 	bool "Renesas INTC External IRQ Pin Support" if COMPILE_TEST
 	select IRQ_DOMAIN
drivers/irqchip/Makefile +1 -0
index eaa12928d60b..da308aefcb87 100644
@@ -51,6 +51,7 @@ obj-$(CONFIG_REALTEK_DHC_INTC)		+= irq-realtek-intc-common.o
 obj-$(CONFIG_REALTEK_RTD1319_INTC)	+= irq-realtek-rtd1319.o
 obj-$(CONFIG_REALTEK_RTD1319D_INTC)	+= irq-realtek-rtd1319d.o
 obj-$(CONFIG_REALTEK_RTD1325_INTC)	+= irq-realtek-rtd1325.o
+obj-$(CONFIG_REALTEK_RTD1619B_INTC)	+= irq-realtek-rtd1619b.o
 obj-$(CONFIG_RENESAS_INTC_IRQPIN)	+= irq-renesas-intc-irqpin.o
 obj-$(CONFIG_RENESAS_IRQC)		+= irq-renesas-irqc.o
 obj-$(CONFIG_RENESAS_RZA1_IRQC)		+= irq-renesas-rza1.o
drivers/irqchip/irq-realtek-rtd1619b.c new file +217 -0

217 lines not on this page · raw message

Signature · 1 line
2.25.1