soc: samsung: exynos-chipid: convert to a module
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Sun, 19 Sep 2021 09:31:13 +0000 (11:31 +0200)
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Wed, 29 Sep 2021 13:50:34 +0000 (15:50 +0200)
Exynos ChipID and ASV (Adaptive Supply Voltage) driver is not essential
to system boot and it can successfully be built and loaded as module.

This makes core kernel image smaller and reduces the memory footprint
when multi-platform kernel is booted on non-Exynos board.  Usually it is
also distro-friendly.

Add multiple authors of the driver since its conversion from
mach-exynos, ordered alphabetically by first name.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org>
Tested-by: Sylwester Nawrocki <snawrocki@kernel.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>
Link: https://lore.kernel.org/r/20210919093114.35987-3-krzysztof.kozlowski@canonical.com
drivers/soc/samsung/Kconfig
drivers/soc/samsung/Makefile
drivers/soc/samsung/exynos-chipid.c
drivers/soc/samsung/exynos5422-asv.c

index 1f643c0..fe139f2 100644 (file)
@@ -13,13 +13,14 @@ config EXYNOS_ASV_ARM
        depends on EXYNOS_CHIPID
 
 config EXYNOS_CHIPID
-       bool "Exynos ChipID controller and ASV driver" if COMPILE_TEST
+       tristate "Exynos ChipID controller and ASV driver" if COMPILE_TEST
        depends on ARCH_EXYNOS || COMPILE_TEST
        select EXYNOS_ASV_ARM if ARM && ARCH_EXYNOS
        select MFD_SYSCON
        select SOC_BUS
        help
          Support for Samsung Exynos SoC ChipID and Adaptive Supply Voltage.
+         This driver can also be built as module (exynos_chipid).
 
 config EXYNOS_PMU
        bool "Exynos PMU controller driver" if COMPILE_TEST
index 0c523a8..2ae4bea 100644 (file)
@@ -1,8 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-$(CONFIG_EXYNOS_ASV_ARM)   += exynos5422-asv.o
+obj-$(CONFIG_EXYNOS_CHIPID)    += exynos_chipid.o
+exynos_chipid-y                        += exynos-chipid.o exynos-asv.o
 
-obj-$(CONFIG_EXYNOS_CHIPID)    += exynos-chipid.o exynos-asv.o
 obj-$(CONFIG_EXYNOS_PMU)       += exynos-pmu.o
 
 obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS)   += exynos3250-pmu.o exynos4-pmu.o \
index dcd9a08..b2627a3 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/errno.h>
 #include <linux/mfd/syscon.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
@@ -128,6 +129,7 @@ static const struct of_device_id exynos_chipid_of_device_ids[] = {
        { .compatible = "samsung,exynos4210-chipid" },
        {}
 };
+MODULE_DEVICE_TABLE(of, exynos_chipid_of_device_ids);
 
 static struct platform_driver exynos_chipid_driver = {
        .driver = {
@@ -137,4 +139,11 @@ static struct platform_driver exynos_chipid_driver = {
        .probe  = exynos_chipid_probe,
        .remove = exynos_chipid_remove,
 };
-builtin_platform_driver(exynos_chipid_driver);
+module_platform_driver(exynos_chipid_driver);
+
+MODULE_DESCRIPTION("Samsung Exynos ChipID controller and ASV driver");
+MODULE_AUTHOR("Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>");
+MODULE_AUTHOR("Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>");
+MODULE_AUTHOR("Pankaj Dubey <pankaj.dubey@samsung.com>");
+MODULE_AUTHOR("Sylwester Nawrocki <s.nawrocki@samsung.com>");
+MODULE_LICENSE("GPL");
index ca409a9..475ae52 100644 (file)
@@ -503,3 +503,4 @@ int exynos5422_asv_init(struct exynos_asv *asv)
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(exynos5422_asv_init);