Skip to contentSkip to conversation

soc: imx8m: Support building imx8m soc driver as module

PATCH Applied Jindong Yue 3 participants 10 messages Mar 1, 2023 – Mar 14, 2023 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

v3 cover soc: imx8m: Support building imx8m soc driver as module

This series adds support for building imx8m soc driver as module.

----
v3: Update commit message to include link error of
undefined genpd_dev_pm_attach_by_name symbol
v2: Use dev_pm_domain_attach_by_name() for imx8m*-blk-ctrl.
----

Jindong Yue (7):
soc: imx: imx8mp-blk-ctrl: Use dev_pm_domain_attach_by_name
soc: imx: imx8mp-blk-ctrl: Fix typo of imx8m_blk_ctrl_of_match
soc: imx: imx8mp-blk-ctrl: Add MODULE_LICENSE
soc: imx: imx8m-blk-ctrl: Use dev_pm_domain_attach_by_name
soc: imx: imx8m-blk-ctrl: Add MODULE_LICENSE
soc: imx8m: Add MODULE_LICENSE
soc: imx8m: Support building imx8m soc driver as module

 drivers/soc/imx/Kconfig           | 2 +-
 drivers/soc/imx/imx8m-blk-ctrl.c  | 3 ++-
 drivers/soc/imx/imx8mp-blk-ctrl.c | 5 +++--
 drivers/soc/imx/soc-imx8m.c       | 1 +
 4 files changed, 7 insertions(+), 4 deletions(-)
Signature · 1 line
2.36.0
#1 lore raw

PATCH v3 1/7 soc: imx: imx8mp-blk-ctrl: Use dev_pm_domain_attach_by_name

The genpd_dev_pm_attach_by_name() is not exported, following error occurs when building imx8mp-blk-ctrl as a module:

ERROR: modpost: "genpd_dev_pm_attach_by_name" [drivers/soc/imx/imx8mp-blk-ctrl.ko] undefined!

Fix this by using dev_pm_domain_attach_by_name() instead.

---
 drivers/soc/imx/imx8mp-blk-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/imx/imx8mp-blk-ctrl.c +1 -1
index a0592db8fa86..1892c2c78831 100644
@@ -642,7 +642,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
 	if (!bc->onecell_data.domains)
 		return -ENOMEM;
 
-	bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus");
+	bc->bus_power_dev = dev_pm_domain_attach_by_name(dev, "bus");
 	if (IS_ERR(bc->bus_power_dev))
 		return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev),
 				     "failed to attach bus power domain\n");
Signature · 1 line
2.36.0
#2 lore raw

PATCH v3 2/7 soc: imx: imx8mp-blk-ctrl: Fix typo of imx8m_blk_ctrl_of_match

In reply to Jindong Yue

Once set CONFIG_SOC_IMX8M as m, following error occurs:

drivers/soc/imx/imx8mp-blk-ctrl.c:747:25: error: ‘imx8m_blk_ctrl_of_match’ undeclared here (not in a function); did you mean ‘imx8mp_blk_ctrl_of_match’?

  747 | MODULE_DEVICE_TABLE(of, imx8m_blk_ctrl_of_match);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~

Fix the typo.

Fixes 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl")
---
 drivers/soc/imx/imx8mp-blk-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/imx/imx8mp-blk-ctrl.c +1 -1
index 1892c2c78831..f109c7bd6658 100644
@@ -852,7 +852,7 @@ static const struct of_device_id imx8mp_blk_ctrl_of_match[] = {
 		/* Sentinel */
 	}
 };
-MODULE_DEVICE_TABLE(of, imx8m_blk_ctrl_of_match);
+MODULE_DEVICE_TABLE(of, imx8mp_blk_ctrl_of_match);
 
 static struct platform_driver imx8mp_blk_ctrl_driver = {
 	.probe = imx8mp_blk_ctrl_probe,
Signature · 1 line
2.36.0
#3 lore raw

PATCH v3 3/7 soc: imx: imx8mp-blk-ctrl: Add MODULE_LICENSE

In reply to Jindong Yue

Add MODULE_LICENSE to support building as a module.

---
 drivers/soc/imx/imx8mp-blk-ctrl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/imx/imx8mp-blk-ctrl.c +1 -0
index f109c7bd6658..870aecc0202a 100644
@@ -864,3 +864,4 @@ static struct platform_driver imx8mp_blk_ctrl_driver = {
 	},
 };
 module_platform_driver(imx8mp_blk_ctrl_driver);
+MODULE_LICENSE("GPL");
Signature · 1 line
2.36.0
#4 lore raw

PATCH v3 4/7 soc: imx: imx8m-blk-ctrl: Use dev_pm_domain_attach_by_name

In reply to Jindong Yue

The genpd_dev_pm_attach_by_name() is not exported, following error occurs when building imx8m-blk-ctrl as a module:

ERROR: modpost: "genpd_dev_pm_attach_by_name" [drivers/soc/imx/imx8m-blk-ctrl.ko] undefined!

Fix this by using dev_pm_domain_attach_by_name() instead.

---
 drivers/soc/imx/imx8m-blk-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/imx/imx8m-blk-ctrl.c +1 -1
index 399cb85105a1..af67f2c3f7a1 100644
@@ -210,7 +210,7 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
 	if (!bc->onecell_data.domains)
 		return -ENOMEM;
 
-	bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus");
+	bc->bus_power_dev = dev_pm_domain_attach_by_name(dev, "bus");
 	if (IS_ERR(bc->bus_power_dev)) {
 		if (PTR_ERR(bc->bus_power_dev) == -ENODEV)
 			return dev_err_probe(dev, -EPROBE_DEFER,
Signature · 1 line
2.36.0
#5 lore raw

PATCH v3 5/7 soc: imx: imx8m-blk-ctrl: Add MODULE_LICENSE

In reply to Jindong Yue

Add MODULE_LICENSE to support building as a module.

---
 drivers/soc/imx/imx8m-blk-ctrl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/imx/imx8m-blk-ctrl.c +1 -0
index af67f2c3f7a1..a955513d6d68 100644
@@ -891,3 +891,4 @@ static struct platform_driver imx8m_blk_ctrl_driver = {
 	},
 };
 module_platform_driver(imx8m_blk_ctrl_driver);
+MODULE_LICENSE("GPL");
Signature · 1 line
2.36.0
#6 lore raw

PATCH v3 6/7 soc: imx8m: Add MODULE_LICENSE

In reply to Jindong Yue

Add MODULE_LICENSE to support building as module.

---
 drivers/soc/imx/soc-imx8m.c | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/imx/soc-imx8m.c +1 -0
index 32ed9dc88e45..1dcd243df567 100644
@@ -242,3 +242,4 @@ static int __init imx8_soc_init(void)
 	return ret;
 }
 device_initcall(imx8_soc_init);
+MODULE_LICENSE("GPL");
Signature · 1 line
2.36.0
#7 lore raw

PATCH v3 7/7 soc: imx8m: Support building imx8m soc driver as module

In reply to Jindong Yue

Make the imx8m soc driver as tristate so that it can be built as loadable module, module names are:
soc-imx8m.ko, imx8m-blk-ctrl.ko and imx8mp-blk-ctrl.ko

---
 drivers/soc/imx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/imx/Kconfig +1 -1
index a8742fc58f01..76a4593baf0a 100644
@@ -10,7 +10,7 @@ config IMX_GPCV2_PM_DOMAINS
 	default y if SOC_IMX7D
 
 config SOC_IMX8M
-	bool "i.MX8M SoC family support"
+	tristate "i.MX8M SoC family support"
 	depends on ARCH_MXC || COMPILE_TEST
 	default ARCH_MXC && ARM64
 	select SOC_BUS
Signature · 1 line
2.36.0
Reviewed-by on the v3 series
#8 lore raw
In reply to Jindong Yue

Hi,

Quoted 1 line · Jindong Yue

This series adds support for building imx8m soc driver as module.

...

Quoted 5 lines
 drivers/soc/imx/Kconfig           | 2 +-
 drivers/soc/imx/imx8m-blk-ctrl.c  | 3 ++-
 drivers/soc/imx/imx8mp-blk-ctrl.c | 5 +++--
 drivers/soc/imx/soc-imx8m.c       | 1 +
 4 files changed, 7 insertions(+), 4 deletions(-)

the serie lgtm now, feel free to add my:

Applied
#9 lore raw
In reply to Jindong Yue
Quoted 9 lines · Jindong Yue

This series adds support for building imx8m soc driver as module.

----
v3: Update commit message to include link error of
undefined genpd_dev_pm_attach_by_name symbol
v2: Use dev_pm_domain_attach_by_name() for imx8m*-blk-ctrl.
----

Quoted 8 lines

Jindong Yue (7):
soc: imx: imx8mp-blk-ctrl: Use dev_pm_domain_attach_by_name
soc: imx: imx8mp-blk-ctrl: Fix typo of imx8m_blk_ctrl_of_match
soc: imx: imx8mp-blk-ctrl: Add MODULE_LICENSE
soc: imx: imx8m-blk-ctrl: Use dev_pm_domain_attach_by_name
soc: imx: imx8m-blk-ctrl: Add MODULE_LICENSE
soc: imx8m: Add MODULE_LICENSE
soc: imx8m: Support building imx8m soc driver as module

Applied all, thanks!