[3/5] cpuidle: psci: Split into two separate build objects
diff mbox series

Message ID 20200615152054.6819-4-ulf.hansson@linaro.org
State Superseded, archived
Headers show
Series
  • cpuidle: psci: Various improvements for PSCI PM domains
Related show

Commit Message

Ulf Hansson June 15, 2020, 3:20 p.m. UTC
The combined build object for the PSCI cpuidle driver and the PSCI PM
domain, is a bit messy. Therefore let's split it up by adding a new Kconfig
ARM_PSCI_CPUIDLE_DOMAIN and convert into two separate objects.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/cpuidle/Kconfig.arm    | 10 ++++++++++
 drivers/cpuidle/Makefile       |  5 ++---
 drivers/cpuidle/cpuidle-psci.h |  2 +-
 3 files changed, 13 insertions(+), 4 deletions(-)

Comments

Lina Iyer June 18, 2020, 6:02 p.m. UTC | #1
On Mon, Jun 15 2020 at 09:21 -0600, Ulf Hansson wrote:
>The combined build object for the PSCI cpuidle driver and the PSCI PM
>domain, is a bit messy. Therefore let's split it up by adding a new Kconfig
>ARM_PSCI_CPUIDLE_DOMAIN and convert into two separate objects.
>
>Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Lina Iyer <ilina@codeaurora.org>

>---
> drivers/cpuidle/Kconfig.arm    | 10 ++++++++++
> drivers/cpuidle/Makefile       |  5 ++---
> drivers/cpuidle/cpuidle-psci.h |  2 +-
> 3 files changed, 13 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm
>index 51a7e89085c0..0844fadc4be8 100644
>--- a/drivers/cpuidle/Kconfig.arm
>+++ b/drivers/cpuidle/Kconfig.arm
>@@ -23,6 +23,16 @@ config ARM_PSCI_CPUIDLE
> 	  It provides an idle driver that is capable of detecting and
> 	  managing idle states through the PSCI firmware interface.
>
>+config ARM_PSCI_CPUIDLE_DOMAIN
>+	bool "PSCI CPU idle Domain"
>+	depends on ARM_PSCI_CPUIDLE
>+	depends on PM_GENERIC_DOMAINS_OF
>+	default y
>+	help
>+	  Select this to enable the PSCI based CPUidle driver to use PM domains,
>+	  which is needed to support the hierarchical DT based layout of the
>+	  idle states.
>+
> config ARM_BIG_LITTLE_CPUIDLE
> 	bool "Support for ARM big.LITTLE processors"
> 	depends on ARCH_VEXPRESS_TC2_PM || ARCH_EXYNOS || COMPILE_TEST
>diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile
>index f07800cbb43f..26bbc5e74123 100644
>--- a/drivers/cpuidle/Makefile
>+++ b/drivers/cpuidle/Makefile
>@@ -21,9 +21,8 @@ obj-$(CONFIG_ARM_U8500_CPUIDLE)         += cpuidle-ux500.o
> obj-$(CONFIG_ARM_AT91_CPUIDLE)          += cpuidle-at91.o
> obj-$(CONFIG_ARM_EXYNOS_CPUIDLE)        += cpuidle-exynos.o
> obj-$(CONFIG_ARM_CPUIDLE)		+= cpuidle-arm.o
>-obj-$(CONFIG_ARM_PSCI_CPUIDLE)		+= cpuidle_psci.o
>-cpuidle_psci-y				:= cpuidle-psci.o
>-cpuidle_psci-$(CONFIG_PM_GENERIC_DOMAINS_OF) += cpuidle-psci-domain.o
>+obj-$(CONFIG_ARM_PSCI_CPUIDLE)		+= cpuidle-psci.o
>+obj-$(CONFIG_ARM_PSCI_CPUIDLE_DOMAIN)	+= cpuidle-psci-domain.o
> obj-$(CONFIG_ARM_TEGRA_CPUIDLE)		+= cpuidle-tegra.o
> obj-$(CONFIG_ARM_QCOM_SPM_CPUIDLE)	+= cpuidle-qcom-spm.o
>
>diff --git a/drivers/cpuidle/cpuidle-psci.h b/drivers/cpuidle/cpuidle-psci.h
>index 0690d66df829..d8e925e84c27 100644
>--- a/drivers/cpuidle/cpuidle-psci.h
>+++ b/drivers/cpuidle/cpuidle-psci.h
>@@ -9,7 +9,7 @@ struct device_node;
> void psci_set_domain_state(u32 state);
> int psci_dt_parse_state_node(struct device_node *np, u32 *state);
>
>-#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
>+#ifdef CONFIG_ARM_PSCI_CPUIDLE_DOMAIN
> struct device *psci_dt_attach_cpu(int cpu);
> void psci_dt_detach_cpu(struct device *dev);
> #else
>-- 
>2.20.1
>
Sudeep Holla June 26, 2020, 2:44 p.m. UTC | #2
On Mon, Jun 15, 2020 at 05:20:52PM +0200, Ulf Hansson wrote:
> The combined build object for the PSCI cpuidle driver and the PSCI PM
> domain, is a bit messy. Therefore let's split it up by adding a new Kconfig
> ARM_PSCI_CPUIDLE_DOMAIN and convert into two separate objects.
>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

Patch
diff mbox series

diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm
index 51a7e89085c0..0844fadc4be8 100644
--- a/drivers/cpuidle/Kconfig.arm
+++ b/drivers/cpuidle/Kconfig.arm
@@ -23,6 +23,16 @@  config ARM_PSCI_CPUIDLE
 	  It provides an idle driver that is capable of detecting and
 	  managing idle states through the PSCI firmware interface.
 
+config ARM_PSCI_CPUIDLE_DOMAIN
+	bool "PSCI CPU idle Domain"
+	depends on ARM_PSCI_CPUIDLE
+	depends on PM_GENERIC_DOMAINS_OF
+	default y
+	help
+	  Select this to enable the PSCI based CPUidle driver to use PM domains,
+	  which is needed to support the hierarchical DT based layout of the
+	  idle states.
+
 config ARM_BIG_LITTLE_CPUIDLE
 	bool "Support for ARM big.LITTLE processors"
 	depends on ARCH_VEXPRESS_TC2_PM || ARCH_EXYNOS || COMPILE_TEST
diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile
index f07800cbb43f..26bbc5e74123 100644
--- a/drivers/cpuidle/Makefile
+++ b/drivers/cpuidle/Makefile
@@ -21,9 +21,8 @@  obj-$(CONFIG_ARM_U8500_CPUIDLE)         += cpuidle-ux500.o
 obj-$(CONFIG_ARM_AT91_CPUIDLE)          += cpuidle-at91.o
 obj-$(CONFIG_ARM_EXYNOS_CPUIDLE)        += cpuidle-exynos.o
 obj-$(CONFIG_ARM_CPUIDLE)		+= cpuidle-arm.o
-obj-$(CONFIG_ARM_PSCI_CPUIDLE)		+= cpuidle_psci.o
-cpuidle_psci-y				:= cpuidle-psci.o
-cpuidle_psci-$(CONFIG_PM_GENERIC_DOMAINS_OF) += cpuidle-psci-domain.o
+obj-$(CONFIG_ARM_PSCI_CPUIDLE)		+= cpuidle-psci.o
+obj-$(CONFIG_ARM_PSCI_CPUIDLE_DOMAIN)	+= cpuidle-psci-domain.o
 obj-$(CONFIG_ARM_TEGRA_CPUIDLE)		+= cpuidle-tegra.o
 obj-$(CONFIG_ARM_QCOM_SPM_CPUIDLE)	+= cpuidle-qcom-spm.o
 
diff --git a/drivers/cpuidle/cpuidle-psci.h b/drivers/cpuidle/cpuidle-psci.h
index 0690d66df829..d8e925e84c27 100644
--- a/drivers/cpuidle/cpuidle-psci.h
+++ b/drivers/cpuidle/cpuidle-psci.h
@@ -9,7 +9,7 @@  struct device_node;
 void psci_set_domain_state(u32 state);
 int psci_dt_parse_state_node(struct device_node *np, u32 *state);
 
-#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
+#ifdef CONFIG_ARM_PSCI_CPUIDLE_DOMAIN
 struct device *psci_dt_attach_cpu(int cpu);
 void psci_dt_detach_cpu(struct device *dev);
 #else