All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/3] reset: imx7: Support module build
@ 2020-06-29 15:05 ` Anson Huang
  0 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-06-29 15:05 UTC (permalink / raw)
  To: catalin.marinas, will, lorenzo.pieralisi, robh, bhelgaas,
	p.zabel, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci
  Cc: Linux-imx

Add module device table, author, description and license to support
module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY
for i.MX7D, other platforms need to select it in defconfig.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
Changes since V1:
	- make it default 'y' for SOC_IMX7D;
	- add module author, description;
	- use device_initcall instead of builtin_platform_driver() to support
	  module unload.
---
 drivers/reset/Kconfig      |  5 +++--
 drivers/reset/reset-imx7.c | 14 ++++++++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index d9efbfd..19f9773 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -65,9 +65,10 @@ config RESET_HSDK
 	  This enables the reset controller driver for HSDK board.
 
 config RESET_IMX7
-	bool "i.MX7/8 Reset Driver" if COMPILE_TEST
+	tristate "i.MX7/8 Reset Driver"
 	depends on HAS_IOMEM
-	default SOC_IMX7D || (ARM64 && ARCH_MXC)
+	depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST
+	default y if SOC_IMX7D
 	select MFD_SYSCON
 	help
 	  This enables the reset controller driver for i.MX7 SoCs.
diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c
index d170fe6..c710f789 100644
--- a/drivers/reset/reset-imx7.c
+++ b/drivers/reset/reset-imx7.c
@@ -8,7 +8,7 @@
  */
 
 #include <linux/mfd/syscon.h>
-#include <linux/mod_devicetable.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/reset-controller.h>
@@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[] = {
 	{ .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
 	{ /* sentinel */ },
 };
+MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids);
 
 static struct platform_driver imx7_reset_driver = {
 	.probe	= imx7_reset_probe,
@@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = {
 		.of_match_table	= imx7_reset_dt_ids,
 	},
 };
-builtin_platform_driver(imx7_reset_driver);
+
+static int __init imx7_reset_init(void)
+{
+	return platform_driver_register(&imx7_reset_driver);
+}
+device_initcall(imx7_reset_init);
+
+MODULE_AUTHOR("Andrey Smirnov <andrew.smirnov@gmail.com>");
+MODULE_DESCRIPTION("NXP i.MX7 reset driver");
+MODULE_LICENSE("GPL v2");
-- 
2.7.4


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

* [PATCH V2 1/3] reset: imx7: Support module build
@ 2020-06-29 15:05 ` Anson Huang
  0 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-06-29 15:05 UTC (permalink / raw)
  To: catalin.marinas, will, lorenzo.pieralisi, robh, bhelgaas,
	p.zabel, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci
  Cc: Linux-imx

Add module device table, author, description and license to support
module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY
for i.MX7D, other platforms need to select it in defconfig.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
Changes since V1:
	- make it default 'y' for SOC_IMX7D;
	- add module author, description;
	- use device_initcall instead of builtin_platform_driver() to support
	  module unload.
---
 drivers/reset/Kconfig      |  5 +++--
 drivers/reset/reset-imx7.c | 14 ++++++++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index d9efbfd..19f9773 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -65,9 +65,10 @@ config RESET_HSDK
 	  This enables the reset controller driver for HSDK board.
 
 config RESET_IMX7
-	bool "i.MX7/8 Reset Driver" if COMPILE_TEST
+	tristate "i.MX7/8 Reset Driver"
 	depends on HAS_IOMEM
-	default SOC_IMX7D || (ARM64 && ARCH_MXC)
+	depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST
+	default y if SOC_IMX7D
 	select MFD_SYSCON
 	help
 	  This enables the reset controller driver for i.MX7 SoCs.
diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c
index d170fe6..c710f789 100644
--- a/drivers/reset/reset-imx7.c
+++ b/drivers/reset/reset-imx7.c
@@ -8,7 +8,7 @@
  */
 
 #include <linux/mfd/syscon.h>
-#include <linux/mod_devicetable.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/reset-controller.h>
@@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[] = {
 	{ .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
 	{ /* sentinel */ },
 };
+MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids);
 
 static struct platform_driver imx7_reset_driver = {
 	.probe	= imx7_reset_probe,
@@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = {
 		.of_match_table	= imx7_reset_dt_ids,
 	},
 };
-builtin_platform_driver(imx7_reset_driver);
+
+static int __init imx7_reset_init(void)
+{
+	return platform_driver_register(&imx7_reset_driver);
+}
+device_initcall(imx7_reset_init);
+
+MODULE_AUTHOR("Andrey Smirnov <andrew.smirnov@gmail.com>");
+MODULE_DESCRIPTION("NXP i.MX7 reset driver");
+MODULE_LICENSE("GPL v2");
-- 
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] 12+ messages in thread

* [PATCH V2 2/3] arm64: defconfig: Select CONFIG_RESET_IMX7 as module by default
  2020-06-29 15:05 ` Anson Huang
@ 2020-06-29 15:05   ` Anson Huang
  -1 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-06-29 15:05 UTC (permalink / raw)
  To: catalin.marinas, will, lorenzo.pieralisi, robh, bhelgaas,
	p.zabel, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci
  Cc: Linux-imx

i.MX7 reset driver now supports module build, it is no longer
enabled by default, need to select it explicitly.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
Changes since V1:
	- use module build by default.
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 35f037f..454a1f2 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -909,6 +909,7 @@ CONFIG_PWM_SAMSUNG=y
 CONFIG_PWM_SUN4I=m
 CONFIG_PWM_TEGRA=m
 CONFIG_QCOM_PDC=y
+CONFIG_RESET_IMX7=m
 CONFIG_RESET_QCOM_AOSS=y
 CONFIG_RESET_QCOM_PDC=m
 CONFIG_RESET_TI_SCI=y
-- 
2.7.4


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

* [PATCH V2 2/3] arm64: defconfig: Select CONFIG_RESET_IMX7 as module by default
@ 2020-06-29 15:05   ` Anson Huang
  0 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-06-29 15:05 UTC (permalink / raw)
  To: catalin.marinas, will, lorenzo.pieralisi, robh, bhelgaas,
	p.zabel, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci
  Cc: Linux-imx

i.MX7 reset driver now supports module build, it is no longer
enabled by default, need to select it explicitly.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
Changes since V1:
	- use module build by default.
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 35f037f..454a1f2 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -909,6 +909,7 @@ CONFIG_PWM_SAMSUNG=y
 CONFIG_PWM_SUN4I=m
 CONFIG_PWM_TEGRA=m
 CONFIG_QCOM_PDC=y
+CONFIG_RESET_IMX7=m
 CONFIG_RESET_QCOM_AOSS=y
 CONFIG_RESET_QCOM_PDC=m
 CONFIG_RESET_TI_SCI=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] 12+ messages in thread

* [PATCH V2 3/3] pci: imx: Select RESET_IMX7 by default
  2020-06-29 15:05 ` Anson Huang
@ 2020-06-29 15:05   ` Anson Huang
  -1 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-06-29 15:05 UTC (permalink / raw)
  To: catalin.marinas, will, lorenzo.pieralisi, robh, bhelgaas,
	p.zabel, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci
  Cc: Linux-imx

i.MX7 reset driver now supports module build and it is no longer
built in by default, so i.MX PCI driver needs to select it explicitly
due to it is NOT supporting loadable module currently.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
New patch.
---
 drivers/pci/controller/dwc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
index 044a376..bcf63ce 100644
--- a/drivers/pci/controller/dwc/Kconfig
+++ b/drivers/pci/controller/dwc/Kconfig
@@ -90,6 +90,7 @@ config PCI_EXYNOS
 
 config PCI_IMX6
 	bool "Freescale i.MX6/7/8 PCIe controller"
+	select RESET_IMX7
 	depends on ARCH_MXC || COMPILE_TEST
 	depends on PCI_MSI_IRQ_DOMAIN
 	select PCIE_DW_HOST
-- 
2.7.4


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

* [PATCH V2 3/3] pci: imx: Select RESET_IMX7 by default
@ 2020-06-29 15:05   ` Anson Huang
  0 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-06-29 15:05 UTC (permalink / raw)
  To: catalin.marinas, will, lorenzo.pieralisi, robh, bhelgaas,
	p.zabel, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci
  Cc: Linux-imx

i.MX7 reset driver now supports module build and it is no longer
built in by default, so i.MX PCI driver needs to select it explicitly
due to it is NOT supporting loadable module currently.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
New patch.
---
 drivers/pci/controller/dwc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
index 044a376..bcf63ce 100644
--- a/drivers/pci/controller/dwc/Kconfig
+++ b/drivers/pci/controller/dwc/Kconfig
@@ -90,6 +90,7 @@ config PCI_EXYNOS
 
 config PCI_IMX6
 	bool "Freescale i.MX6/7/8 PCIe controller"
+	select RESET_IMX7
 	depends on ARCH_MXC || COMPILE_TEST
 	depends on PCI_MSI_IRQ_DOMAIN
 	select PCIE_DW_HOST
-- 
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] 12+ messages in thread

* Re: [PATCH V2 3/3] pci: imx: Select RESET_IMX7 by default
  2020-06-29 15:05   ` Anson Huang
@ 2020-06-29 18:53     ` Bjorn Helgaas
  -1 siblings, 0 replies; 12+ messages in thread
From: Bjorn Helgaas @ 2020-06-29 18:53 UTC (permalink / raw)
  To: Anson Huang
  Cc: catalin.marinas, will, lorenzo.pieralisi, robh, bhelgaas,
	p.zabel, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci, Linux-imx

If you post a V3, "git log --oneline
drivers/pci/controller/dwc/pci-imx6.c" says the subject line could be:

  PCI: imx6: Select CONFIG_RESET_IMX7

If you don't need a V3 for any other reason, whoever applies this
series might adjust that for you.

On Mon, Jun 29, 2020 at 11:05:29PM +0800, Anson Huang wrote:
> i.MX7 reset driver now supports module build and it is no longer
> built in by default, so i.MX PCI driver needs to select it explicitly
> due to it is NOT supporting loadable module currently.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> New patch.
> ---
>  drivers/pci/controller/dwc/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
> index 044a376..bcf63ce 100644
> --- a/drivers/pci/controller/dwc/Kconfig
> +++ b/drivers/pci/controller/dwc/Kconfig
> @@ -90,6 +90,7 @@ config PCI_EXYNOS
>  
>  config PCI_IMX6
>  	bool "Freescale i.MX6/7/8 PCIe controller"
> +	select RESET_IMX7
>  	depends on ARCH_MXC || COMPILE_TEST
>  	depends on PCI_MSI_IRQ_DOMAIN
>  	select PCIE_DW_HOST
> -- 
> 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	[flat|nested] 12+ messages in thread

* Re: [PATCH V2 3/3] pci: imx: Select RESET_IMX7 by default
@ 2020-06-29 18:53     ` Bjorn Helgaas
  0 siblings, 0 replies; 12+ messages in thread
From: Bjorn Helgaas @ 2020-06-29 18:53 UTC (permalink / raw)
  To: Anson Huang
  Cc: geert+renesas, catalin.marinas, bjorn.andersson, jonnyc, vidyas,
	festevam, robh, lorenzo.pieralisi, hayashi.kunihiko, eswara.kota,
	will, krzk, Linux-imx, linux-pci, treding, p.zabel, s.hauer,
	bhelgaas, linux-arm-kernel, xiaowei.bao, gustavo.pimentel,
	linux-kernel, leoyang.li, vkoul, kernel, olof, shawnguo, amurray

If you post a V3, "git log --oneline
drivers/pci/controller/dwc/pci-imx6.c" says the subject line could be:

  PCI: imx6: Select CONFIG_RESET_IMX7

If you don't need a V3 for any other reason, whoever applies this
series might adjust that for you.

On Mon, Jun 29, 2020 at 11:05:29PM +0800, Anson Huang wrote:
> i.MX7 reset driver now supports module build and it is no longer
> built in by default, so i.MX PCI driver needs to select it explicitly
> due to it is NOT supporting loadable module currently.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> New patch.
> ---
>  drivers/pci/controller/dwc/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
> index 044a376..bcf63ce 100644
> --- a/drivers/pci/controller/dwc/Kconfig
> +++ b/drivers/pci/controller/dwc/Kconfig
> @@ -90,6 +90,7 @@ config PCI_EXYNOS
>  
>  config PCI_IMX6
>  	bool "Freescale i.MX6/7/8 PCIe controller"
> +	select RESET_IMX7
>  	depends on ARCH_MXC || COMPILE_TEST
>  	depends on PCI_MSI_IRQ_DOMAIN
>  	select PCIE_DW_HOST
> -- 
> 2.7.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
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] 12+ messages in thread

* Re: [PATCH V2 1/3] reset: imx7: Support module build
  2020-06-29 15:05 ` Anson Huang
@ 2020-07-20  9:22   ` Philipp Zabel
  -1 siblings, 0 replies; 12+ messages in thread
From: Philipp Zabel @ 2020-07-20  9:22 UTC (permalink / raw)
  To: Anson Huang, catalin.marinas, will, lorenzo.pieralisi, robh,
	bhelgaas, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci
  Cc: Linux-imx

On Mon, 2020-06-29 at 23:05 +0800, Anson Huang wrote:
> Add module device table, author, description and license to support
> module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY
> for i.MX7D, other platforms need to select it in defconfig.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> Changes since V1:
> 	- make it default 'y' for SOC_IMX7D;
> 	- add module author, description;
> 	- use device_initcall instead of builtin_platform_driver() to support
> 	  module unload.
> ---
>  drivers/reset/Kconfig      |  5 +++--
>  drivers/reset/reset-imx7.c | 14 ++++++++++++--
>  2 files changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> index d9efbfd..19f9773 100644
> --- a/drivers/reset/Kconfig
> +++ b/drivers/reset/Kconfig
> @@ -65,9 +65,10 @@ config RESET_HSDK
>  	  This enables the reset controller driver for HSDK board.
>  
>  config RESET_IMX7
> -	bool "i.MX7/8 Reset Driver" if COMPILE_TEST
> +	tristate "i.MX7/8 Reset Driver"
>  	depends on HAS_IOMEM
> -	default SOC_IMX7D || (ARM64 && ARCH_MXC)
> +	depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST
> +	default y if SOC_IMX7D
>  	select MFD_SYSCON
>  	help
>  	  This enables the reset controller driver for i.MX7 SoCs.
> diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c
> index d170fe6..c710f789 100644
> --- a/drivers/reset/reset-imx7.c
> +++ b/drivers/reset/reset-imx7.c
> @@ -8,7 +8,7 @@
>   */
>  
>  #include <linux/mfd/syscon.h>
> -#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
>  #include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/reset-controller.h>
> @@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[] = {
>  	{ .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
>  	{ /* sentinel */ },
>  };
> +MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids);
>  
>  static struct platform_driver imx7_reset_driver = {
>  	.probe	= imx7_reset_probe,
> @@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = {
>  		.of_match_table	= imx7_reset_dt_ids,
>  	},
>  };
> -builtin_platform_driver(imx7_reset_driver);
> +
> +static int __init imx7_reset_init(void)
> +{
> +	return platform_driver_register(&imx7_reset_driver);
> +}
> +device_initcall(imx7_reset_init);

Shouldn't this use module_platform_driver instead?

regards
Philipp

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

* Re: [PATCH V2 1/3] reset: imx7: Support module build
@ 2020-07-20  9:22   ` Philipp Zabel
  0 siblings, 0 replies; 12+ messages in thread
From: Philipp Zabel @ 2020-07-20  9:22 UTC (permalink / raw)
  To: Anson Huang, catalin.marinas, will, lorenzo.pieralisi, robh,
	bhelgaas, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	leoyang.li, vkoul, geert+renesas, olof, treding,
	gustavo.pimentel, amurray, vidyas, xiaowei.bao, jonnyc,
	hayashi.kunihiko, eswara.kota, krzk, linux-arm-kernel,
	linux-kernel, linux-pci
  Cc: Linux-imx

On Mon, 2020-06-29 at 23:05 +0800, Anson Huang wrote:
> Add module device table, author, description and license to support
> module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY
> for i.MX7D, other platforms need to select it in defconfig.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> Changes since V1:
> 	- make it default 'y' for SOC_IMX7D;
> 	- add module author, description;
> 	- use device_initcall instead of builtin_platform_driver() to support
> 	  module unload.
> ---
>  drivers/reset/Kconfig      |  5 +++--
>  drivers/reset/reset-imx7.c | 14 ++++++++++++--
>  2 files changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> index d9efbfd..19f9773 100644
> --- a/drivers/reset/Kconfig
> +++ b/drivers/reset/Kconfig
> @@ -65,9 +65,10 @@ config RESET_HSDK
>  	  This enables the reset controller driver for HSDK board.
>  
>  config RESET_IMX7
> -	bool "i.MX7/8 Reset Driver" if COMPILE_TEST
> +	tristate "i.MX7/8 Reset Driver"
>  	depends on HAS_IOMEM
> -	default SOC_IMX7D || (ARM64 && ARCH_MXC)
> +	depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST
> +	default y if SOC_IMX7D
>  	select MFD_SYSCON
>  	help
>  	  This enables the reset controller driver for i.MX7 SoCs.
> diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c
> index d170fe6..c710f789 100644
> --- a/drivers/reset/reset-imx7.c
> +++ b/drivers/reset/reset-imx7.c
> @@ -8,7 +8,7 @@
>   */
>  
>  #include <linux/mfd/syscon.h>
> -#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
>  #include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/reset-controller.h>
> @@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[] = {
>  	{ .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
>  	{ /* sentinel */ },
>  };
> +MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids);
>  
>  static struct platform_driver imx7_reset_driver = {
>  	.probe	= imx7_reset_probe,
> @@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = {
>  		.of_match_table	= imx7_reset_dt_ids,
>  	},
>  };
> -builtin_platform_driver(imx7_reset_driver);
> +
> +static int __init imx7_reset_init(void)
> +{
> +	return platform_driver_register(&imx7_reset_driver);
> +}
> +device_initcall(imx7_reset_init);

Shouldn't this use module_platform_driver instead?

regards
Philipp

_______________________________________________
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] 12+ messages in thread

* RE: [PATCH V2 1/3] reset: imx7: Support module build
  2020-07-20  9:22   ` Philipp Zabel
@ 2020-07-20 13:52     ` Anson Huang
  -1 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-07-20 13:52 UTC (permalink / raw)
  To: Philipp Zabel, catalin.marinas, will, lorenzo.pieralisi, robh,
	bhelgaas, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	Leo Li, vkoul, geert+renesas, olof, treding, gustavo.pimentel,
	amurray, vidyas, xiaowei.bao, jonnyc, hayashi.kunihiko,
	eswara.kota, krzk, linux-arm-kernel, linux-kernel, linux-pci
  Cc: dl-linux-imx

Hi, Philipp


> Subject: Re: [PATCH V2 1/3] reset: imx7: Support module build
> 
> On Mon, 2020-06-29 at 23:05 +0800, Anson Huang wrote:
> > Add module device table, author, description and license to support
> > module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY for
> > i.MX7D, other platforms need to select it in defconfig.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > Changes since V1:
> > 	- make it default 'y' for SOC_IMX7D;
> > 	- add module author, description;
> > 	- use device_initcall instead of builtin_platform_driver() to support
> > 	  module unload.
> > ---
> >  drivers/reset/Kconfig      |  5 +++--
> >  drivers/reset/reset-imx7.c | 14 ++++++++++++--
> >  2 files changed, 15 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index
> > d9efbfd..19f9773 100644
> > --- a/drivers/reset/Kconfig
> > +++ b/drivers/reset/Kconfig
> > @@ -65,9 +65,10 @@ config RESET_HSDK
> >  	  This enables the reset controller driver for HSDK board.
> >
> >  config RESET_IMX7
> > -	bool "i.MX7/8 Reset Driver" if COMPILE_TEST
> > +	tristate "i.MX7/8 Reset Driver"
> >  	depends on HAS_IOMEM
> > -	default SOC_IMX7D || (ARM64 && ARCH_MXC)
> > +	depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST
> > +	default y if SOC_IMX7D
> >  	select MFD_SYSCON
> >  	help
> >  	  This enables the reset controller driver for i.MX7 SoCs.
> > diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c
> > index d170fe6..c710f789 100644
> > --- a/drivers/reset/reset-imx7.c
> > +++ b/drivers/reset/reset-imx7.c
> > @@ -8,7 +8,7 @@
> >   */
> >
> >  #include <linux/mfd/syscon.h>
> > -#include <linux/mod_devicetable.h>
> > +#include <linux/module.h>
> >  #include <linux/of_device.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/reset-controller.h>
> > @@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[]
> = {
> >  	{ .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
> >  	{ /* sentinel */ },
> >  };
> > +MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids);
> >
> >  static struct platform_driver imx7_reset_driver = {
> >  	.probe	= imx7_reset_probe,
> > @@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = {
> >  		.of_match_table	= imx7_reset_dt_ids,
> >  	},
> >  };
> > -builtin_platform_driver(imx7_reset_driver);
> > +
> > +static int __init imx7_reset_init(void) {
> > +	return platform_driver_register(&imx7_reset_driver);
> > +}
> > +device_initcall(imx7_reset_init);
> 
> Shouldn't this use module_platform_driver instead?

Agreed, module_platform_driver() is better, will improve it in V3.

Thanks,
Anson


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

* RE: [PATCH V2 1/3] reset: imx7: Support module build
@ 2020-07-20 13:52     ` Anson Huang
  0 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-07-20 13:52 UTC (permalink / raw)
  To: Philipp Zabel, catalin.marinas, will, lorenzo.pieralisi, robh,
	bhelgaas, shawnguo, s.hauer, kernel, festevam, bjorn.andersson,
	Leo Li, vkoul, geert+renesas, olof, treding, gustavo.pimentel,
	amurray, vidyas, xiaowei.bao, jonnyc, hayashi.kunihiko,
	eswara.kota, krzk, linux-arm-kernel, linux-kernel, linux-pci
  Cc: dl-linux-imx

Hi, Philipp


> Subject: Re: [PATCH V2 1/3] reset: imx7: Support module build
> 
> On Mon, 2020-06-29 at 23:05 +0800, Anson Huang wrote:
> > Add module device table, author, description and license to support
> > module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY for
> > i.MX7D, other platforms need to select it in defconfig.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > Changes since V1:
> > 	- make it default 'y' for SOC_IMX7D;
> > 	- add module author, description;
> > 	- use device_initcall instead of builtin_platform_driver() to support
> > 	  module unload.
> > ---
> >  drivers/reset/Kconfig      |  5 +++--
> >  drivers/reset/reset-imx7.c | 14 ++++++++++++--
> >  2 files changed, 15 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index
> > d9efbfd..19f9773 100644
> > --- a/drivers/reset/Kconfig
> > +++ b/drivers/reset/Kconfig
> > @@ -65,9 +65,10 @@ config RESET_HSDK
> >  	  This enables the reset controller driver for HSDK board.
> >
> >  config RESET_IMX7
> > -	bool "i.MX7/8 Reset Driver" if COMPILE_TEST
> > +	tristate "i.MX7/8 Reset Driver"
> >  	depends on HAS_IOMEM
> > -	default SOC_IMX7D || (ARM64 && ARCH_MXC)
> > +	depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST
> > +	default y if SOC_IMX7D
> >  	select MFD_SYSCON
> >  	help
> >  	  This enables the reset controller driver for i.MX7 SoCs.
> > diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c
> > index d170fe6..c710f789 100644
> > --- a/drivers/reset/reset-imx7.c
> > +++ b/drivers/reset/reset-imx7.c
> > @@ -8,7 +8,7 @@
> >   */
> >
> >  #include <linux/mfd/syscon.h>
> > -#include <linux/mod_devicetable.h>
> > +#include <linux/module.h>
> >  #include <linux/of_device.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/reset-controller.h>
> > @@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[]
> = {
> >  	{ .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
> >  	{ /* sentinel */ },
> >  };
> > +MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids);
> >
> >  static struct platform_driver imx7_reset_driver = {
> >  	.probe	= imx7_reset_probe,
> > @@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = {
> >  		.of_match_table	= imx7_reset_dt_ids,
> >  	},
> >  };
> > -builtin_platform_driver(imx7_reset_driver);
> > +
> > +static int __init imx7_reset_init(void) {
> > +	return platform_driver_register(&imx7_reset_driver);
> > +}
> > +device_initcall(imx7_reset_init);
> 
> Shouldn't this use module_platform_driver instead?

Agreed, module_platform_driver() is better, will improve it in V3.

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] 12+ messages in thread

end of thread, other threads:[~2020-07-20 13:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 15:05 [PATCH V2 1/3] reset: imx7: Support module build Anson Huang
2020-06-29 15:05 ` Anson Huang
2020-06-29 15:05 ` [PATCH V2 2/3] arm64: defconfig: Select CONFIG_RESET_IMX7 as module by default Anson Huang
2020-06-29 15:05   ` Anson Huang
2020-06-29 15:05 ` [PATCH V2 3/3] pci: imx: Select RESET_IMX7 " Anson Huang
2020-06-29 15:05   ` Anson Huang
2020-06-29 18:53   ` Bjorn Helgaas
2020-06-29 18:53     ` Bjorn Helgaas
2020-07-20  9:22 ` [PATCH V2 1/3] reset: imx7: Support module build Philipp Zabel
2020-07-20  9:22   ` Philipp Zabel
2020-07-20 13:52   ` Anson Huang
2020-07-20 13:52     ` Anson Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.