From: Will McVicker <willmcvicker@google.com>
To: Russell King <linux@armlinux.org.uk>,
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Tomasz Figa <tomasz.figa@gmail.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
Linus Walleij <linus.walleij@linaro.org>,
Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Lee Jones <lee.jones@linaro.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Saravana Kannan <saravanak@google.com>,
Will McVicker <willmcvicker@google.com>,
kernel-team@android.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-rtc@vger.kernel.org
Subject: [PATCH v2 10/12] soc: samsung: pmu: modularize the Exynos ARMv8 PMU driver
Date: Tue, 28 Sep 2021 23:56:27 +0000 [thread overview]
Message-ID: <20210928235635.1348330-11-willmcvicker@google.com> (raw)
In-Reply-To: <20210928235635.1348330-1-willmcvicker@google.com>
In order to only modularize the Exynos ARMv8 PMU driver, we have to
split it up from the ARM PMU driver. So make the following Kconfig
changes:
* EXYNOS_PMU -> EXYNOS_PMU_ARM64
* EXYNOS_PMU_ARM_DRIVERS -> EXYNOS_PMU_ARM
This patch also includes the necessary modularization changes.
Lastly, have EXYNOS_PMU_ARM64 use "default y if ARCH_EXYNOS && ARM64"
instead of having ARCH_EXYNOS select it directly.
Signed-off-by: Will McVicker <willmcvicker@google.com>
---
arch/arm/mach-exynos/Kconfig | 2 +-
arch/arm64/Kconfig.platforms | 1 -
drivers/soc/samsung/Kconfig | 15 +++++++++------
drivers/soc/samsung/Makefile | 8 +++++---
drivers/soc/samsung/exynos-pmu.c | 13 +++++++------
drivers/soc/samsung/exynos-pmu.h | 2 +-
include/linux/soc/samsung/exynos-pmu.h | 2 +-
7 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index afc8cd062605..e97e1d8f7b00 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -13,7 +13,7 @@ menuconfig ARCH_EXYNOS
select ARM_GIC
select EXYNOS_IRQ_COMBINER
select EXYNOS_THERMAL
- select EXYNOS_PMU
+ select EXYNOS_PMU_ARM
select EXYNOS_SROM
select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
select GPIOLIB
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 67f60cc3c723..e5e4b9b2fb97 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -92,7 +92,6 @@ config ARCH_BRCMSTB
config ARCH_EXYNOS
bool "ARMv8 based Samsung Exynos SoC family"
select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
- select EXYNOS_PMU
select HAVE_S3C_RTC if RTC_CLASS
select PINCTRL
select PM_GENERIC_DOMAINS if PM
diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig
index d3746415be72..fdf1162ec98b 100644
--- a/drivers/soc/samsung/Kconfig
+++ b/drivers/soc/samsung/Kconfig
@@ -23,15 +23,18 @@ config EXYNOS_CHIPID
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
- depends on ARCH_EXYNOS || ((ARM || ARM64) && COMPILE_TEST)
- select EXYNOS_PMU_ARM_DRIVERS if ARM && ARCH_EXYNOS
+config EXYNOS_PMU_ARM64
+ tristate "Exynos PMU controller driver"
+ depends on ARCH_EXYNOS || (ARM64 && COMPILE_TEST)
+ default y if (ARCH_EXYNOS && ARM64)
+ help
+ Support for Samsung Exynos ARMv8 PMU controller. This driver can be
+ built-in or as a module (exynos-pmu).
# There is no need to enable these drivers for ARMv8
-config EXYNOS_PMU_ARM_DRIVERS
+config EXYNOS_PMU_ARM
bool "Exynos PMU ARMv7-specific driver extensions" if COMPILE_TEST
- depends on EXYNOS_PMU
+ depends on ARCH_EXYNOS || (ARM && COMPILE_TEST)
config EXYNOS_PM_DOMAINS
bool "Exynos PM domains" if COMPILE_TEST
diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile
index 2ae4bea804cf..cd55c72a052d 100644
--- a/drivers/soc/samsung/Makefile
+++ b/drivers/soc/samsung/Makefile
@@ -4,10 +4,12 @@ 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_PMU) += exynos-pmu.o
+obj-$(CONFIG_EXYNOS_PMU_ARM64) += exynos-pmu.o
+
+obj-$(CONFIG_EXYNOS_PMU_ARM) += exynos-pmu32.o
+exynos-pmu32-y += exynos-pmu.o exynos3250-pmu.o \
+ exynos4-pmu.o exynos5250-pmu.o exynos5420-pmu.o
-obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \
- exynos5250-pmu.o exynos5420-pmu.o
obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o
obj-$(CONFIG_EXYNOS_REGULATOR_COUPLER) += exynos-regulator-coupler.o
diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c
index a18c93a4646c..3dd0219c908c 100644
--- a/drivers/soc/samsung/exynos-pmu.c
+++ b/drivers/soc/samsung/exynos-pmu.c
@@ -8,6 +8,7 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
+#include <linux/module.h>
#include <linux/mfd/core.h>
#include <linux/mfd/syscon.h>
#include <linux/platform_device.h>
@@ -63,7 +64,7 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode)
* Split the data between ARM architectures because it is relatively big
* and useless on other arch.
*/
-#ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS
+#ifdef CONFIG_EXYNOS_PMU_ARM
#define exynos_pmu_data_arm_ptr(data) (&data)
#else
#define exynos_pmu_data_arm_ptr(data) NULL
@@ -154,9 +155,9 @@ static struct platform_driver exynos_pmu_driver = {
.probe = exynos_pmu_probe,
};
-static int __init exynos_pmu_init(void)
-{
- return platform_driver_register(&exynos_pmu_driver);
+module_platform_driver(exynos_pmu_driver);
-}
-postcore_initcall(exynos_pmu_init);
+MODULE_DESCRIPTION("Exynos PMU controller driver");
+MODULE_AUTHOR("Marek Szyprowski <m.szyprowski@samsung.com>");
+MODULE_AUTHOR("Krzysztof Kozlowski <krzk@kernel.org>");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/soc/samsung/exynos-pmu.h b/drivers/soc/samsung/exynos-pmu.h
index 5e851f32307e..4a7f03c79dd0 100644
--- a/drivers/soc/samsung/exynos-pmu.h
+++ b/drivers/soc/samsung/exynos-pmu.h
@@ -28,7 +28,7 @@ struct exynos_pmu_data {
extern void __iomem *pmu_base_addr;
-#ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS
+#ifdef CONFIG_EXYNOS_PMU_ARM
/* list of all exported SoC specific data */
extern const struct exynos_pmu_data exynos3250_pmu_data;
extern const struct exynos_pmu_data exynos4210_pmu_data;
diff --git a/include/linux/soc/samsung/exynos-pmu.h b/include/linux/soc/samsung/exynos-pmu.h
index a4f5516cc956..d7317e0902b8 100644
--- a/include/linux/soc/samsung/exynos-pmu.h
+++ b/include/linux/soc/samsung/exynos-pmu.h
@@ -19,7 +19,7 @@ enum sys_powerdown {
};
extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
-#ifdef CONFIG_EXYNOS_PMU
+#if IS_ENABLED(CONFIG_EXYNOS_PMU_ARM64) || IS_ENABLED(CONFIG_EXYNOS_PMU_ARM)
extern struct regmap *exynos_get_pmu_regmap(void);
#else
static inline struct regmap *exynos_get_pmu_regmap(void)
--
2.33.0.685.g46640cef36-goog
next prev parent reply other threads:[~2021-09-28 23:57 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 23:56 [PATCH v2 00/12] arm64: Kconfig: Update ARCH_EXYNOS select configs Will McVicker
2021-09-28 23:56 ` [PATCH v2 01/12] arm64: don't have ARCH_EXYNOS select EXYNOS_CHIPID Will McVicker
2021-09-29 13:58 ` (subset) " Krzysztof Kozlowski
2021-09-29 14:00 ` Krzysztof Kozlowski
2021-09-28 23:56 ` [PATCH v2 02/12] timekeeping: add API for getting timekeeping_suspended Will McVicker
2021-09-29 3:42 ` John Stultz
2021-09-29 20:01 ` Will McVicker
2021-09-29 20:46 ` John Stultz
2021-09-30 18:31 ` Will McVicker
2021-09-28 23:56 ` [PATCH v2 03/12] clk: samsung: add support for CPU clocks Will McVicker
2021-09-28 23:56 ` [PATCH v2 04/12] clk: samsung: exynos5433: update apollo and atlas clock probing Will McVicker
2021-09-28 23:56 ` [PATCH v2 05/12] clk: export __clk_lookup Will McVicker
2021-10-08 4:31 ` Stephen Boyd
2021-09-28 23:56 ` [PATCH v2 06/12] clk: samsung: modularize exynos arm64 clk drivers Will McVicker
2021-09-28 23:56 ` [PATCH v2 07/12] clk: samsung: set exynos arm64 clk driver as tristate Will McVicker
2021-09-29 13:09 ` Krzysztof Kozlowski
2021-09-28 23:56 ` [PATCH v2 08/12] pinctrl: samsung: modularize the ARM and ARM64 pinctrls Will McVicker
2021-09-29 2:01 ` Chanho Park
2021-09-28 23:56 ` [PATCH v2 09/12] pinctrl: samsung: set PINCTRL_EXYNOS and PINCTRL_SAMSUNG as tristate Will McVicker
2021-09-28 23:56 ` Will McVicker [this message]
2021-09-29 13:11 ` [PATCH v2 10/12] soc: samsung: pmu: modularize the Exynos ARMv8 PMU driver Krzysztof Kozlowski
2021-09-28 23:56 ` [PATCH v2 11/12] soc: samsung: pm_domains: modularize EXYNOS_PM_DOMAINS Will McVicker
2021-09-29 13:36 ` Krzysztof Kozlowski
2021-09-28 23:56 ` [PATCH v2 12/12] ARM: rtc: remove HAVE_S3C_RTC in favor of direct dependencies Will McVicker
2021-09-29 11:52 ` Alexandre Belloni
2021-09-29 13:02 ` [PATCH v2 00/12] arm64: Kconfig: Update ARCH_EXYNOS select configs Krzysztof Kozlowski
2021-09-29 19:48 ` Will McVicker
2021-09-30 6:14 ` Krzysztof Kozlowski
2021-09-30 9:01 ` Arnd Bergmann
2021-09-30 9:30 ` Lee Jones
2021-09-30 10:33 ` Krzysztof Kozlowski
2021-09-30 12:34 ` Lee Jones
2021-09-30 12:38 ` Krzysztof Kozlowski
2021-09-30 10:05 ` Geert Uytterhoeven
2021-09-30 9:23 ` Lee Jones
2021-09-30 10:17 ` Geert Uytterhoeven
2021-09-30 10:56 ` Lee Jones
2021-09-30 11:25 ` Geert Uytterhoeven
2021-09-30 12:08 ` Lee Jones
2021-09-30 16:09 ` Geert Uytterhoeven
2021-09-30 10:52 ` Krzysztof Kozlowski
2021-09-30 12:32 ` Lee Jones
2021-09-30 11:01 ` Tomasz Figa
2021-09-30 11:27 ` Geert Uytterhoeven
2021-09-30 11:51 ` Lee Jones
2021-09-30 12:10 ` Tomasz Figa
2021-09-30 12:15 ` Krzysztof Kozlowski
2021-09-30 12:45 ` Lee Jones
2021-10-01 4:01 ` Christoph Hellwig
2021-10-01 4:52 ` Saravana Kannan
2021-10-01 4:55 ` Christoph Hellwig
2021-09-30 12:21 ` Krzysztof Kozlowski
2021-09-30 12:39 ` Lee Jones
2021-09-30 13:08 ` Krzysztof Kozlowski
2021-09-30 13:29 ` Lee Jones
2021-09-30 16:12 ` Geert Uytterhoeven
2021-09-30 16:21 ` Lee Jones
2021-09-30 16:26 ` Geert Uytterhoeven
2021-09-30 18:02 ` Will McVicker
2021-10-01 4:04 ` Christoph Hellwig
2021-10-01 4:52 ` Olof Johansson
2021-10-01 5:23 ` Saravana Kannan
2021-10-01 5:35 ` Olof Johansson
2021-10-01 5:59 ` Will McVicker
2021-10-01 8:01 ` Krzysztof Kozlowski
2021-10-01 6:02 ` Saravana Kannan
2021-10-01 6:27 ` Olof Johansson
2021-10-01 6:30 ` Olof Johansson
2021-10-01 12:00 ` Arnd Bergmann
2021-10-01 12:31 ` Lee Jones
2021-10-01 15:43 ` Olof Johansson
2021-10-01 11:38 ` Linus Walleij
2021-10-01 11:59 ` Geert Uytterhoeven
2021-10-01 15:59 ` Olof Johansson
2021-10-01 16:51 ` Will McVicker
2021-10-01 17:15 ` Olof Johansson
2021-10-01 17:48 ` Will McVicker
2021-10-01 8:19 ` Geert Uytterhoeven
2021-10-01 9:00 ` Arnd Bergmann
2021-10-01 15:27 ` Olof Johansson
2021-10-01 19:26 ` Saravana Kannan
2021-10-02 1:47 ` Tomasz Figa
2021-10-02 21:03 ` Olof Johansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210928235635.1348330-11-willmcvicker@google.com \
--to=willmcvicker@google.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=catalin.marinas@arm.com \
--cc=cw00.choi@samsung.com \
--cc=geert@linux-m68k.org \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--cc=krzysztof.kozlowski@canonical.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mturquette@baylibre.com \
--cc=s.nawrocki@samsung.com \
--cc=saravanak@google.com \
--cc=sboyd@kernel.org \
--cc=tglx@linutronix.de \
--cc=tomasz.figa@gmail.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).