Skip to content

Commit a442abb

Browse files
Anson-HuangpH5
authored andcommitted
reset: imx7: Support module build
Use module_platform_driver(), 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> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
1 parent 9123e3a commit a442abb

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

drivers/reset/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ config RESET_HSDK
6565
This enables the reset controller driver for HSDK board.
6666

6767
config RESET_IMX7
68-
bool "i.MX7/8 Reset Driver" if COMPILE_TEST
68+
tristate "i.MX7/8 Reset Driver"
6969
depends on HAS_IOMEM
70-
default SOC_IMX7D || (ARM64 && ARCH_MXC)
70+
depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST
71+
default y if SOC_IMX7D
7172
select MFD_SYSCON
7273
help
7374
This enables the reset controller driver for i.MX7 SoCs.

drivers/reset/reset-imx7.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
#include <linux/mfd/syscon.h>
11-
#include <linux/mod_devicetable.h>
11+
#include <linux/module.h>
1212
#include <linux/of_device.h>
1313
#include <linux/platform_device.h>
1414
#include <linux/reset-controller.h>
@@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[] = {
386386
{ .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
387387
{ /* sentinel */ },
388388
};
389+
MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids);
389390

390391
static struct platform_driver imx7_reset_driver = {
391392
.probe = imx7_reset_probe,
@@ -394,4 +395,8 @@ static struct platform_driver imx7_reset_driver = {
394395
.of_match_table = imx7_reset_dt_ids,
395396
},
396397
};
397-
builtin_platform_driver(imx7_reset_driver);
398+
module_platform_driver(imx7_reset_driver);
399+
400+
MODULE_AUTHOR("Andrey Smirnov <andrew.smirnov@gmail.com>");
401+
MODULE_DESCRIPTION("NXP i.MX7 reset driver");
402+
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)