]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
irqchip/dw-apb-ictl: Support building as module
authorJisheng Zhang <jszhang@kernel.org>
Fri, 14 Jun 2024 15:34:49 +0000 (23:34 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 23 Jun 2024 17:49:44 +0000 (19:49 +0200)
The driver is now always built in. In some synaptics ARM64 SoCs it is used
as a second level interrupt controller hanging off the ARM GIC and is
therefore loadable during boot.

Enable it to be built as a module and handle built-in usage correctly, so
that it continues working on systems where it is the main interrupt
controller.

[ tglx: Massage changelog ]

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240614153449.2083-1-jszhang@kernel.org
drivers/irqchip/Kconfig
drivers/irqchip/irq-dw-apb-ictl.c

index 348f34525d238ef51805b42ab72d4433000f7637..aaf84530386a089fc757f8775e75fe65d72eedc0 100644 (file)
@@ -145,7 +145,7 @@ config DAVINCI_CP_INTC
        select IRQ_DOMAIN
 
 config DW_APB_ICTL
-       bool
+       tristate "DesignWare APB Interrupt Controller"
        select GENERIC_IRQ_CHIP
        select IRQ_DOMAIN_HIERARCHY
 
index d5c1c750c8d2d5a08653694798ec411cee035a3c..5eda6c4689cf8197a8ce657b2f72b5790b922260 100644 (file)
@@ -122,7 +122,7 @@ static int __init dw_apb_ictl_init(struct device_node *np,
        int ret, nrirqs, parent_irq, i;
        u32 reg;
 
-       if (!parent) {
+       if (!parent && IS_BUILTIN(CONFIG_DW_APB_ICTL)) {
                /* Used as the primary interrupt controller */
                parent_irq = 0;
                domain_ops = &dw_apb_ictl_irq_domain_ops;
@@ -214,5 +214,12 @@ err_release:
        release_mem_region(r.start, resource_size(&r));
        return ret;
 }
-IRQCHIP_DECLARE(dw_apb_ictl,
-               "snps,dw-apb-ictl", dw_apb_ictl_init);
+#if IS_BUILTIN(CONFIG_DW_APB_ICTL)
+IRQCHIP_DECLARE(dw_apb_ictl, "snps,dw-apb-ictl", dw_apb_ictl_init);
+#else
+IRQCHIP_PLATFORM_DRIVER_BEGIN(dw_apb_ictl)
+IRQCHIP_MATCH("snps,dw-apb-ictl", dw_apb_ictl_init)
+IRQCHIP_PLATFORM_DRIVER_END(dw_apb_ictl)
+MODULE_DESCRIPTION("DesignWare APB Interrupt Controller");
+MODULE_LICENSE("GPL v2");
+#endif