Skip to content

Commit 7cc4f30

Browse files
xhackerustcKAGA-KOKO
authored andcommitted
irqchip/dw-apb-ictl: Support building as module
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ef7080b commit 7cc4f30

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

drivers/irqchip/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ config DAVINCI_CP_INTC
145145
select IRQ_DOMAIN
146146

147147
config DW_APB_ICTL
148-
bool
148+
tristate "DesignWare APB Interrupt Controller"
149149
select GENERIC_IRQ_CHIP
150150
select IRQ_DOMAIN_HIERARCHY
151151

drivers/irqchip/irq-dw-apb-ictl.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static int __init dw_apb_ictl_init(struct device_node *np,
122122
int ret, nrirqs, parent_irq, i;
123123
u32 reg;
124124

125-
if (!parent) {
125+
if (!parent && IS_BUILTIN(CONFIG_DW_APB_ICTL)) {
126126
/* Used as the primary interrupt controller */
127127
parent_irq = 0;
128128
domain_ops = &dw_apb_ictl_irq_domain_ops;
@@ -214,5 +214,12 @@ static int __init dw_apb_ictl_init(struct device_node *np,
214214
release_mem_region(r.start, resource_size(&r));
215215
return ret;
216216
}
217-
IRQCHIP_DECLARE(dw_apb_ictl,
218-
"snps,dw-apb-ictl", dw_apb_ictl_init);
217+
#if IS_BUILTIN(CONFIG_DW_APB_ICTL)
218+
IRQCHIP_DECLARE(dw_apb_ictl, "snps,dw-apb-ictl", dw_apb_ictl_init);
219+
#else
220+
IRQCHIP_PLATFORM_DRIVER_BEGIN(dw_apb_ictl)
221+
IRQCHIP_MATCH("snps,dw-apb-ictl", dw_apb_ictl_init)
222+
IRQCHIP_PLATFORM_DRIVER_END(dw_apb_ictl)
223+
MODULE_DESCRIPTION("DesignWare APB Interrupt Controller");
224+
MODULE_LICENSE("GPL v2");
225+
#endif

0 commit comments

Comments
 (0)