firmware: arm_scmi: Enable building as a single module
authorSudeep Holla <sudeep.holla@arm.com>
Mon, 7 Sep 2020 11:09:23 +0000 (12:09 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 14 Sep 2020 06:31:03 +0000 (07:31 +0100)
Now, with all the plumbing in place to enable building scmi as a module
instead of built-in modules, let us enable the same.

Link: https://lore.kernel.org/r/20200907195046.56615-5-sudeep.holla@arm.com
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/Kconfig
drivers/firmware/Makefile
drivers/firmware/arm_scmi/Makefile
include/linux/scmi_protocol.h

index fbd785d..afdbebb 100644 (file)
@@ -7,7 +7,7 @@
 menu "Firmware Drivers"
 
 config ARM_SCMI_PROTOCOL
-       bool "ARM System Control and Management Interface (SCMI) Message Protocol"
+       tristate "ARM System Control and Management Interface (SCMI) Message Protocol"
        depends on ARM || ARM64 || COMPILE_TEST
        depends on MAILBOX
        help
index 99510be..5e013b6 100644 (file)
@@ -22,7 +22,7 @@ obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o
 obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
 obj-$(CONFIG_TURRIS_MOX_RWTM)  += turris-mox-rwtm.o
 
-obj-$(CONFIG_ARM_SCMI_PROTOCOL)        += arm_scmi/
+obj-y                          += arm_scmi/
 obj-y                          += broadcom/
 obj-y                          += meson/
 obj-$(CONFIG_GOOGLE_FIRMWARE)  += google/
index 643f232..bc0d54f 100644 (file)
@@ -1,9 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-y  = scmi-bus.o scmi-driver.o scmi-protocols.o scmi-transport.o
 scmi-bus-y = bus.o
 scmi-driver-y = driver.o notify.o
 scmi-transport-y = shmem.o
 scmi-transport-$(CONFIG_MAILBOX) += mailbox.o
 scmi-transport-$(CONFIG_HAVE_ARM_SMCCC_DISCOVERY) += smc.o
 scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o system.o
+scmi-module-objs := $(scmi-bus-y) $(scmi-driver-y) $(scmi-protocols-y) \
+                   $(scmi-transport-y)
+obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-module.o
 obj-$(CONFIG_ARM_SCMI_POWER_DOMAIN) += scmi_pm_domain.o
index 4b10093..9cd312a 100644 (file)
@@ -345,7 +345,7 @@ struct scmi_driver {
 
 #define to_scmi_driver(d) container_of(d, struct scmi_driver, driver)
 
-#ifdef CONFIG_ARM_SCMI_PROTOCOL
+#if IS_REACHABLE(CONFIG_ARM_SCMI_PROTOCOL)
 int scmi_driver_register(struct scmi_driver *driver,
                         struct module *owner, const char *mod_name);
 void scmi_driver_unregister(struct scmi_driver *driver);