From: Jisheng Zhang <jszhang@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH] irqchip/dw-apb-ictl: Support building as module
Date: Fri, 14 Jun 2024 23:34:49 +0800 [thread overview]
Message-ID: <20240614153449.2083-1-jszhang@kernel.org> (raw)
Allow the user selection and building of this interrupt controller
driver as a module, for example, 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.
However, this interrupt controller can also be used as the main
interrupt controller by other platforms, so we must keep this kind
of support by checking whether DW_APB_ICTL is builtin or not.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/irqchip/Kconfig | 2 +-
drivers/irqchip/irq-dw-apb-ictl.c | 13 ++++++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 14464716bacb..cfd1102eb273 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -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
diff --git a/drivers/irqchip/irq-dw-apb-ictl.c b/drivers/irqchip/irq-dw-apb-ictl.c
index d5c1c750c8d2..5eda6c4689cf 100644
--- a/drivers/irqchip/irq-dw-apb-ictl.c
+++ b/drivers/irqchip/irq-dw-apb-ictl.c
@@ -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 @@ static int __init dw_apb_ictl_init(struct device_node *np,
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
--
2.43.0
reply other threads:[~2024-06-14 15:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240614153449.2083-1-jszhang@kernel.org \
--to=jszhang@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).