2021-09-02 13:54:36

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 0/2] irq-meson-gpio: make it possible to build as a module

In order to reduce the kernel Image size on multi-platform distributions,
make it possible to build the Amlogic GPIO IRQ controller as a module
by switching it to a platform driver.

The second patch removes MESON_IRQ_GPIO selection from ARCH_MESON to allow
building the driver as module.

Changes since v1:
- makes usage of IRQCHIP_PLATFORM_DRIVER_BEGIN/MATCH/PLATFORM_DRIVER_END

Neil Armstrong (2):
irqchip: irq-meson-gpio: make it possible to build as a module
arm64: meson: remove MESON_IRQ_GPIO selection

arch/arm64/Kconfig.platforms | 1 -
drivers/irqchip/Kconfig | 5 +++--
drivers/irqchip/irq-meson-gpio.c | 15 +++++++++------
3 files changed, 12 insertions(+), 9 deletions(-)

--
2.25.1


2021-09-02 20:02:27

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 2/2] arm64: meson: remove MESON_IRQ_GPIO selection

Selecting MESON_IRQ_GPIO forces it as built-in, but we may need to build it
as a module, thus remove it here and let the "default ARCH_MESON" build as
built-in by default with the option to switch it to module.

Signed-off-by: Neil Armstrong <[email protected]>
---
arch/arm64/Kconfig.platforms | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index b0ce18d4cc98..ff2d83fbbde1 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -167,7 +167,6 @@ config ARCH_MEDIATEK
config ARCH_MESON
bool "Amlogic Platforms"
select COMMON_CLK
- select MESON_IRQ_GPIO
help
This enables support for the arm64 based Amlogic SoCs
such as the s905, S905X/D, S912, A113X/D or S905X/D2
--
2.25.1

2021-09-02 23:25:08

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 1/2] irqchip: irq-meson-gpio: make it possible to build as a module

In order to reduce the kernel Image size on multi-platform distributions,
make it possible to build the Amlogic GPIO IRQ controller as a module
by switching it to a platform driver.

Signed-off-by: Neil Armstrong <[email protected]>
---
drivers/irqchip/Kconfig | 5 +++--
drivers/irqchip/irq-meson-gpio.c | 15 +++++++++------
2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 4d5924e9f766..2aba485025fd 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -400,8 +400,9 @@ config IRQ_UNIPHIER_AIDET
Support for the UniPhier AIDET (ARM Interrupt Detector).

config MESON_IRQ_GPIO
- bool "Meson GPIO Interrupt Multiplexer"
- depends on ARCH_MESON
+ tristate "Meson GPIO Interrupt Multiplexer"
+ depends on ARCH_MESON || COMPILE_TEST
+ default ARCH_MESON
select IRQ_DOMAIN_HIERARCHY
help
Support Meson SoC Family GPIO Interrupt Multiplexer
diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpio.c
index e50676ce2ec8..d90ff0b92480 100644
--- a/drivers/irqchip/irq-meson-gpio.c
+++ b/drivers/irqchip/irq-meson-gpio.c
@@ -436,8 +436,7 @@ static const struct irq_domain_ops meson_gpio_irq_domain_ops = {
.translate = meson_gpio_irq_domain_translate,
};

-static int __init meson_gpio_irq_parse_dt(struct device_node *node,
- struct meson_gpio_irq_controller *ctl)
+static int meson_gpio_irq_parse_dt(struct device_node *node, struct meson_gpio_irq_controller *ctl)
{
const struct of_device_id *match;
int ret;
@@ -463,8 +462,7 @@ static int __init meson_gpio_irq_parse_dt(struct device_node *node,
return 0;
}

-static int __init meson_gpio_irq_of_init(struct device_node *node,
- struct device_node *parent)
+static int meson_gpio_irq_of_init(struct device_node *node, struct device_node *parent)
{
struct irq_domain *domain, *parent_domain;
struct meson_gpio_irq_controller *ctl;
@@ -521,5 +519,10 @@ static int __init meson_gpio_irq_of_init(struct device_node *node,
return ret;
}

-IRQCHIP_DECLARE(meson_gpio_intc, "amlogic,meson-gpio-intc",
- meson_gpio_irq_of_init);
+IRQCHIP_PLATFORM_DRIVER_BEGIN(meson_gpio_intc)
+IRQCHIP_MATCH("amlogic,meson-gpio-intc", meson_gpio_irq_of_init)
+IRQCHIP_PLATFORM_DRIVER_END(meson_gpio_intc)
+
+MODULE_AUTHOR("Jerome Brunet <[email protected]>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:meson-gpio-intc");
--
2.25.1

2021-09-28 23:29:43

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 1/2] irqchip: irq-meson-gpio: make it possible to build as a module

Neil Armstrong <[email protected]> writes:

> In order to reduce the kernel Image size on multi-platform distributions,
> make it possible to build the Amlogic GPIO IRQ controller as a module
> by switching it to a platform driver.
>
> Signed-off-by: Neil Armstrong <[email protected]>

Reviewed-by: Kevin Hilman <[email protected]>
Tested-by: Kevin Hilman <[email protected]>

2021-09-28 23:31:04

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: meson: remove MESON_IRQ_GPIO selection

Neil Armstrong <[email protected]> writes:

> Selecting MESON_IRQ_GPIO forces it as built-in, but we may need to build it
> as a module, thus remove it here and let the "default ARCH_MESON" build as
> built-in by default with the option to switch it to module.
>
> Signed-off-by: Neil Armstrong <[email protected]>

Reviewed-by: Kevin Hilman <[email protected]>

Subject: [irqchip: irq/irqchip-next] irqchip/meson-gpio: Make it possible to build as a module

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID: a947aa00edd4d465f89fdb6029ed40c00a344bc2
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/a947aa00edd4d465f89fdb6029ed40c00a344bc2
Author: Neil Armstrong <[email protected]>
AuthorDate: Thu, 02 Sep 2021 15:49:13 +02:00
Committer: Marc Zyngier <[email protected]>
CommitterDate: Wed, 20 Oct 2021 19:38:01 +01:00

irqchip/meson-gpio: Make it possible to build as a module

In order to reduce the kernel Image size on multi-platform distributions,
make it possible to build the Amlogic GPIO IRQ controller as a module
by switching it to a platform driver.

Signed-off-by: Neil Armstrong <[email protected]>
Acked-by: Saravana Kannan <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reviewed-by: Lee Jones <[email protected]>
Reviewed-by: Kevin Hilman <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
drivers/irqchip/Kconfig | 5 +++--
drivers/irqchip/irq-meson-gpio.c | 15 +++++++++------
2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index aca7b59..6a4496f 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -400,8 +400,9 @@ config IRQ_UNIPHIER_AIDET
Support for the UniPhier AIDET (ARM Interrupt Detector).

config MESON_IRQ_GPIO
- bool "Meson GPIO Interrupt Multiplexer"
- depends on ARCH_MESON
+ tristate "Meson GPIO Interrupt Multiplexer"
+ depends on ARCH_MESON || COMPILE_TEST
+ default ARCH_MESON
select IRQ_DOMAIN_HIERARCHY
help
Support Meson SoC Family GPIO Interrupt Multiplexer
diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpio.c
index e50676c..d90ff0b 100644
--- a/drivers/irqchip/irq-meson-gpio.c
+++ b/drivers/irqchip/irq-meson-gpio.c
@@ -436,8 +436,7 @@ static const struct irq_domain_ops meson_gpio_irq_domain_ops = {
.translate = meson_gpio_irq_domain_translate,
};

-static int __init meson_gpio_irq_parse_dt(struct device_node *node,
- struct meson_gpio_irq_controller *ctl)
+static int meson_gpio_irq_parse_dt(struct device_node *node, struct meson_gpio_irq_controller *ctl)
{
const struct of_device_id *match;
int ret;
@@ -463,8 +462,7 @@ static int __init meson_gpio_irq_parse_dt(struct device_node *node,
return 0;
}

-static int __init meson_gpio_irq_of_init(struct device_node *node,
- struct device_node *parent)
+static int meson_gpio_irq_of_init(struct device_node *node, struct device_node *parent)
{
struct irq_domain *domain, *parent_domain;
struct meson_gpio_irq_controller *ctl;
@@ -521,5 +519,10 @@ free_ctl:
return ret;
}

-IRQCHIP_DECLARE(meson_gpio_intc, "amlogic,meson-gpio-intc",
- meson_gpio_irq_of_init);
+IRQCHIP_PLATFORM_DRIVER_BEGIN(meson_gpio_intc)
+IRQCHIP_MATCH("amlogic,meson-gpio-intc", meson_gpio_irq_of_init)
+IRQCHIP_PLATFORM_DRIVER_END(meson_gpio_intc)
+
+MODULE_AUTHOR("Jerome Brunet <[email protected]>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:meson-gpio-intc");

Subject: [irqchip: irq/irqchip-next] arm64: meson: remove MESON_IRQ_GPIO selection

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID: dfd8c90eb28b8f7c77ce7173c4bae591b26ea51a
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/dfd8c90eb28b8f7c77ce7173c4bae591b26ea51a
Author: Neil Armstrong <[email protected]>
AuthorDate: Thu, 02 Sep 2021 15:49:14 +02:00
Committer: Marc Zyngier <[email protected]>
CommitterDate: Wed, 20 Oct 2021 19:38:21 +01:00

arm64: meson: remove MESON_IRQ_GPIO selection

Selecting MESON_IRQ_GPIO forces it as built-in, but we may need to build it
as a module, thus remove it here and let the "default ARCH_MESON" build as
built-in by default with the option to switch it to module.

Signed-off-by: Neil Armstrong <[email protected]>
Reviewed-by: Kevin Hilman <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/arm64/Kconfig.platforms | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index b0ce18d..ff2d83f 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -167,7 +167,6 @@ config ARCH_MEDIATEK
config ARCH_MESON
bool "Amlogic Platforms"
select COMMON_CLK
- select MESON_IRQ_GPIO
help
This enables support for the arm64 based Amlogic SoCs
such as the s905, S905X/D, S912, A113X/D or S905X/D2