thermal/drivers/Kconfig: Convert the CPU cooling device to a choice
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 4 Dec 2019 15:39:27 +0000 (16:39 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 27 Jan 2020 09:24:32 +0000 (10:24 +0100)
The next changes will add a new way to cool down a CPU by injecting
idle cycles. With the current configuration, a CPU cooling device is
the cpufreq cooling device. As we want to add a new CPU cooling
device, let's convert the CPU cooling to a choice giving a list of CPU
cooling devices. At this point, there is obviously only one CPU
cooling device.

There is no functional changes.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20191204153930.9128-1-daniel.lezcano@linaro.org
drivers/thermal/Kconfig
drivers/thermal/Makefile
include/linux/cpu_cooling.h

index 79b2786..62c1c83 100644 (file)
@@ -151,8 +151,18 @@ config THERMAL_GOV_POWER_ALLOCATOR
 
 config CPU_THERMAL
        bool "Generic cpu cooling support"
-       depends on CPU_FREQ
        depends on THERMAL_OF
+       help
+         Enable the CPU cooling features. If the system has no active
+         cooling device available, this option allows to use the CPU
+         as a cooling device.
+
+if CPU_THERMAL
+
+config CPU_FREQ_THERMAL
+       bool "CPU frequency cooling device"
+       depends on CPU_FREQ
+       default y
        help
          This implements the generic cpu cooling mechanism through frequency
          reduction. An ACPI version of this already exists
@@ -160,7 +170,7 @@ config CPU_THERMAL
          This will be useful for platforms using the generic thermal interface
          and not the ACPI interface.
 
-         If you want this support, you should say Y here.
+endif
 
 config CLOCK_THERMAL
        bool "Generic clock cooling support"
index baeb70b..3f3533c 100644 (file)
@@ -19,7 +19,7 @@ thermal_sys-$(CONFIG_THERMAL_GOV_USER_SPACE)  += user_space.o
 thermal_sys-$(CONFIG_THERMAL_GOV_POWER_ALLOCATOR)      += power_allocator.o
 
 # cpufreq cooling
-thermal_sys-$(CONFIG_CPU_THERMAL)      += cpu_cooling.o
+thermal_sys-$(CONFIG_CPU_FREQ_THERMAL) += cpu_cooling.o
 
 # clock cooling
 thermal_sys-$(CONFIG_CLOCK_THERMAL)    += clock_cooling.o
index b747325..3cdd85f 100644 (file)
@@ -19,7 +19,7 @@
 
 struct cpufreq_policy;
 
-#ifdef CONFIG_CPU_THERMAL
+#ifdef CONFIG_CPU_FREQ_THERMAL
 /**
  * cpufreq_cooling_register - function to create cpufreq cooling device.
  * @policy: cpufreq policy.
@@ -40,7 +40,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
 struct thermal_cooling_device *
 of_cpufreq_cooling_register(struct cpufreq_policy *policy);
 
-#else /* !CONFIG_CPU_THERMAL */
+#else /* !CONFIG_CPU_FREQ_THERMAL */
 static inline struct thermal_cooling_device *
 cpufreq_cooling_register(struct cpufreq_policy *policy)
 {
@@ -58,6 +58,6 @@ of_cpufreq_cooling_register(struct cpufreq_policy *policy)
 {
        return NULL;
 }
-#endif /* CONFIG_CPU_THERMAL */
+#endif /* CONFIG_CPU_FREQ_THERMAL */
 
 #endif /* __CPU_COOLING_H__ */