linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 RESEND 1/4] gpio: mxc: Support module build
@ 2020-09-14  3:29 Anson Huang
  2020-09-14  3:29 ` [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default Anson Huang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Anson Huang @ 2020-09-14  3:29 UTC (permalink / raw)
  To: linux, shawnguo, s.hauer, kernel, festevam, catalin.marinas,
	will, linus.walleij, bgolaszewski, oleksandr.suvorov, peng.fan,
	andreas, hverkuil-cisco, olof, krzk, geert+renesas,
	prabhakar.mahadev-lad.rj, aisheng.dong, lkundrak, joel,
	bjorn.andersson, leoyang.li, vkoul, michael, linux-arm-kernel,
	linux-kernel, linux-gpio
  Cc: Linux-imx

Change config to tristate, add module device table, module author,
description and license to support module build for i.MX GPIO driver.

As this is a SoC GPIO module, it provides common functions for most
of the peripheral devices, such as GPIO pins control, secondary
interrupt controller for GPIO pins IRQ etc., without GPIO driver, most
of the peripheral devices will NOT work properly, so GPIO module is
similar with clock, pinctrl driver that should be loaded ONCE and
never unloaded.

Since MXC GPIO driver needs to have init function to register syscore
ops once, here still use subsys_initcall(), NOT module_platform_driver().

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
Changes since V1:
	- no code change, just add detail explanation about why this patch
	  does NOT support module unloaded.
---
 drivers/gpio/Kconfig    | 2 +-
 drivers/gpio/gpio-mxc.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 5cfdaf3..c7292a5 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -397,7 +397,7 @@ config GPIO_MVEBU
 	select REGMAP_MMIO
 
 config GPIO_MXC
-	def_bool y
+	tristate "i.MX GPIO support"
 	depends on ARCH_MXC || COMPILE_TEST
 	select GPIO_GENERIC
 	select GENERIC_IRQ_CHIP
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 64278a4..643f4c55 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -15,6 +15,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/irqchip/chained_irq.h>
+#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/syscore_ops.h>
@@ -158,6 +159,7 @@ static const struct of_device_id mxc_gpio_dt_ids[] = {
 	{ .compatible = "fsl,imx7d-gpio", .data = &mxc_gpio_devtype[IMX35_GPIO], },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, mxc_gpio_dt_ids);
 
 /*
  * MX2 has one interrupt *for all* gpio ports. The list is used
@@ -604,3 +606,7 @@ static int __init gpio_mxc_init(void)
 	return platform_driver_register(&mxc_gpio_driver);
 }
 subsys_initcall(gpio_mxc_init);
+
+MODULE_AUTHOR("Shawn Guo <shawn.guo@linaro.org>");
+MODULE_DESCRIPTION("i.MX GPIO Driver");
+MODULE_LICENSE("GPL");
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default
  2020-09-14  3:29 [PATCH V2 RESEND 1/4] gpio: mxc: Support module build Anson Huang
@ 2020-09-14  3:29 ` Anson Huang
  2020-09-15 15:58   ` Krzysztof Kozlowski
  2020-09-14  3:29 ` [PATCH V2 RESEND 3/4] ARM: imx_v6_v7_defconfig: " Anson Huang
  2020-09-14  3:29 ` [PATCH V2 RESEND 4/4] ARM: multi_v7_defconfig: " Anson Huang
  2 siblings, 1 reply; 8+ messages in thread
From: Anson Huang @ 2020-09-14  3:29 UTC (permalink / raw)
  To: linux, shawnguo, s.hauer, kernel, festevam, catalin.marinas,
	will, linus.walleij, bgolaszewski, oleksandr.suvorov, peng.fan,
	andreas, hverkuil-cisco, olof, krzk, geert+renesas,
	prabhakar.mahadev-lad.rj, aisheng.dong, lkundrak, joel,
	bjorn.andersson, leoyang.li, vkoul, michael, linux-arm-kernel,
	linux-kernel, linux-gpio
  Cc: Linux-imx

i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC
as built-in manually.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No change.
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 63003ec..c8fca1a 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -510,6 +510,7 @@ CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GPIO_BD9571MWV=m
 CONFIG_GPIO_MAX77620=y
+CONFIG_GPIO_MXC=y
 CONFIG_POWER_AVS=y
 CONFIG_QCOM_CPR=y
 CONFIG_ROCKCHIP_IODOMAIN=y
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2 RESEND 3/4] ARM: imx_v6_v7_defconfig: Build in CONFIG_GPIO_MXC by default
  2020-09-14  3:29 [PATCH V2 RESEND 1/4] gpio: mxc: Support module build Anson Huang
  2020-09-14  3:29 ` [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default Anson Huang
@ 2020-09-14  3:29 ` Anson Huang
  2020-09-14  3:29 ` [PATCH V2 RESEND 4/4] ARM: multi_v7_defconfig: " Anson Huang
  2 siblings, 0 replies; 8+ messages in thread
From: Anson Huang @ 2020-09-14  3:29 UTC (permalink / raw)
  To: linux, shawnguo, s.hauer, kernel, festevam, catalin.marinas,
	will, linus.walleij, bgolaszewski, oleksandr.suvorov, peng.fan,
	andreas, hverkuil-cisco, olof, krzk, geert+renesas,
	prabhakar.mahadev-lad.rj, aisheng.dong, lkundrak, joel,
	bjorn.andersson, leoyang.li, vkoul, michael, linux-arm-kernel,
	linux-kernel, linux-gpio
  Cc: Linux-imx

i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC
as built-in manually.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No change.
---
 arch/arm/configs/imx_v6_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 0fa79bd..221f5c3 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -217,6 +217,7 @@ CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCF857X=y
 CONFIG_GPIO_STMPE=y
 CONFIG_GPIO_74X164=y
+CONFIG_GPIO_MXC=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_SYSCON=y
 CONFIG_POWER_RESET_SYSCON_POWEROFF=y
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2 RESEND 4/4] ARM: multi_v7_defconfig: Build in CONFIG_GPIO_MXC by default
  2020-09-14  3:29 [PATCH V2 RESEND 1/4] gpio: mxc: Support module build Anson Huang
  2020-09-14  3:29 ` [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default Anson Huang
  2020-09-14  3:29 ` [PATCH V2 RESEND 3/4] ARM: imx_v6_v7_defconfig: " Anson Huang
@ 2020-09-14  3:29 ` Anson Huang
  2020-09-15 15:59   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 8+ messages in thread
From: Anson Huang @ 2020-09-14  3:29 UTC (permalink / raw)
  To: linux, shawnguo, s.hauer, kernel, festevam, catalin.marinas,
	will, linus.walleij, bgolaszewski, oleksandr.suvorov, peng.fan,
	andreas, hverkuil-cisco, olof, krzk, geert+renesas,
	prabhakar.mahadev-lad.rj, aisheng.dong, lkundrak, joel,
	bjorn.andersson, leoyang.li, vkoul, michael, linux-arm-kernel,
	linux-kernel, linux-gpio
  Cc: Linux-imx

i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC
as built-in manually.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
new patch.
---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index bfaa38c..d2744ff 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -465,6 +465,7 @@ CONFIG_GPIO_PALMAS=y
 CONFIG_GPIO_TPS6586X=y
 CONFIG_GPIO_TPS65910=y
 CONFIG_GPIO_TWL4030=y
+CONFIG_GPIO_MXC=y
 CONFIG_POWER_AVS=y
 CONFIG_ROCKCHIP_IODOMAIN=y
 CONFIG_POWER_RESET_AS3722=y
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default
  2020-09-14  3:29 ` [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default Anson Huang
@ 2020-09-15 15:58   ` Krzysztof Kozlowski
  2020-09-16  1:59     ` Anson Huang
  0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-15 15:58 UTC (permalink / raw)
  To: Anson Huang
  Cc: peng.fan, geert+renesas, catalin.marinas, linus.walleij,
	bjorn.andersson, oleksandr.suvorov, michael, will,
	hverkuil-cisco, linux, bgolaszewski, andreas, joel, Linux-imx,
	s.hauer, prabhakar.mahadev-lad.rj, lkundrak, festevam,
	linux-arm-kernel, aisheng.dong, linux-gpio, linux-kernel,
	leoyang.li, vkoul, kernel, olof, shawnguo

On Mon, 14 Sep 2020 at 05:36, Anson Huang <Anson.Huang@nxp.com> wrote:
>
> i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC
> as built-in manually.

Maybe it should stay not enabled? Please explain in commit msg why it
should be enabled.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 RESEND 4/4] ARM: multi_v7_defconfig: Build in CONFIG_GPIO_MXC by default
  2020-09-14  3:29 ` [PATCH V2 RESEND 4/4] ARM: multi_v7_defconfig: " Anson Huang
@ 2020-09-15 15:59   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-15 15:59 UTC (permalink / raw)
  To: Anson Huang
  Cc: peng.fan, geert+renesas, catalin.marinas, linus.walleij,
	bjorn.andersson, oleksandr.suvorov, michael, will,
	hverkuil-cisco, linux, bgolaszewski, andreas, joel, Linux-imx,
	s.hauer, prabhakar.mahadev-lad.rj, lkundrak, festevam,
	linux-arm-kernel, aisheng.dong, linux-gpio, linux-kernel,
	leoyang.li, vkoul, kernel, olof, shawnguo

On Mon, 14 Sep 2020 at 05:36, Anson Huang <Anson.Huang@nxp.com> wrote:
>
> i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC
> as built-in manually.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>


The same as on arm64 defconfig - please explain in commit msg why it
should be enabled.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default
  2020-09-15 15:58   ` Krzysztof Kozlowski
@ 2020-09-16  1:59     ` Anson Huang
  2020-09-16  6:03       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 8+ messages in thread
From: Anson Huang @ 2020-09-16  1:59 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Peng Fan, geert+renesas, catalin.marinas, linus.walleij,
	bjorn.andersson, oleksandr.suvorov, michael, will,
	hverkuil-cisco, linux, bgolaszewski, andreas, joel, dl-linux-imx,
	s.hauer, prabhakar.mahadev-lad.rj, lkundrak, festevam,
	linux-arm-kernel, Aisheng Dong, linux-gpio, linux-kernel, Leo Li,
	vkoul, kernel, olof, shawnguo

Hi, Krzysztof

> Subject: Re: [PATCH V2 RESEND 2/4] arm64: defconfig: Build in
> CONFIG_GPIO_MXC by default
> 
> On Mon, 14 Sep 2020 at 05:36, Anson Huang <Anson.Huang@nxp.com>
> wrote:
> >
> > i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC as
> > built-in manually.
> 
> Maybe it should stay not enabled? Please explain in commit msg why it should
> be enabled.

The CONFIG_GPIO_MXC is necessary for all the i.MX SoCs, as it provides the basic
function of GPIO pin operations and IRQ operations, it is enabled by default previously
with " def_bool y " in Kconfig, now it is changed to tristate, so it should be explicitly
enabled in defconfig to make sure it does NOT break any existing functions, that is
why I list " i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC as 
built-in manually " in commit msg, it aims to NOT change any previous behaviors.

thanks,
Anson
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default
  2020-09-16  1:59     ` Anson Huang
@ 2020-09-16  6:03       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-16  6:03 UTC (permalink / raw)
  To: Anson Huang
  Cc: Peng Fan, geert+renesas, catalin.marinas, linus.walleij,
	bjorn.andersson, oleksandr.suvorov, michael, will,
	hverkuil-cisco, linux, bgolaszewski, andreas, joel, dl-linux-imx,
	s.hauer, prabhakar.mahadev-lad.rj, lkundrak, festevam,
	linux-arm-kernel, Aisheng Dong, linux-gpio, linux-kernel, Leo Li,
	vkoul, kernel, olof, shawnguo

On Wed, 16 Sep 2020 at 03:59, Anson Huang <anson.huang@nxp.com> wrote:
>
> Hi, Krzysztof
>
> > Subject: Re: [PATCH V2 RESEND 2/4] arm64: defconfig: Build in
> > CONFIG_GPIO_MXC by default
> >
> > On Mon, 14 Sep 2020 at 05:36, Anson Huang <Anson.Huang@nxp.com>
> > wrote:
> > >
> > > i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC as
> > > built-in manually.
> >
> > Maybe it should stay not enabled? Please explain in commit msg why it should
> > be enabled.
>
> The CONFIG_GPIO_MXC is necessary for all the i.MX SoCs, as it provides the basic
> function of GPIO pin operations and IRQ operations, it is enabled by default previously
> with " def_bool y " in Kconfig, now it is changed to tristate, so it should be explicitly
> enabled in defconfig to make sure it does NOT break any existing functions, that is
> why I list " i.MX GPIO is NOT default enabled now, so select CONFIG_GPIO_MXC as
> built-in manually " in commit msg, it aims to NOT change any previous behaviors.

Sure, I was just saying that all this should be in commit msg. The
commit should explain why it is there in the Linux kernel.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-16  6:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14  3:29 [PATCH V2 RESEND 1/4] gpio: mxc: Support module build Anson Huang
2020-09-14  3:29 ` [PATCH V2 RESEND 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default Anson Huang
2020-09-15 15:58   ` Krzysztof Kozlowski
2020-09-16  1:59     ` Anson Huang
2020-09-16  6:03       ` Krzysztof Kozlowski
2020-09-14  3:29 ` [PATCH V2 RESEND 3/4] ARM: imx_v6_v7_defconfig: " Anson Huang
2020-09-14  3:29 ` [PATCH V2 RESEND 4/4] ARM: multi_v7_defconfig: " Anson Huang
2020-09-15 15:59   ` Krzysztof Kozlowski

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).