Commit a60e6a57 authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Angus Ainslie (Purism)

thermal/drivers/Kconfig: Convert the CPU cooling device to a choice

The next changes will add new way to cool down a CPU. In order to
sanitize and make the overall cpu cooling code consistent and robust
we must prevent the cpu cooling devices to co-exists with the same
purpose at the same time in the kernel.

Make the CPU cooling device a choice in the Kconfig, so only one CPU
cooling strategy can be chosen.
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent cb97ad64
......@@ -150,8 +150,22 @@ 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.
choice
prompt "CPU cooling strategies"
depends on CPU_THERMAL
default CPU_FREQ_THERMAL
help
Select the CPU cooling strategy.
config CPU_FREQ_THERMAL
bool "CPU frequency cooling strategy"
depends on CPU_FREQ
help
This implements the generic cpu cooling mechanism through frequency
reduction. An ACPI version of this already exists
......@@ -159,7 +173,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.
endchoice
config CLOCK_THERMAL
bool "Generic clock cooling support"
......
......@@ -22,6 +22,7 @@
#include <trace/events/thermal.h>
#ifdef CONFIG_CPU_FREQ_THERMAL
/*
* Cooling state <-> CPUFreq frequency
*
......@@ -801,3 +802,4 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
kfree(cpufreq_cdev);
}
EXPORT_SYMBOL_GPL(cpufreq_cooling_unregister);
#endif /* CONFIG_CPU_FREQ_THERMAL */
......@@ -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.
......@@ -33,7 +33,7 @@ cpufreq_cooling_register(struct cpufreq_policy *policy);
*/
void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
#else /* !CONFIG_CPU_THERMAL */
#else /* !CONFIG_CPU_FREQ_THERMAL */
static inline struct thermal_cooling_device *
cpufreq_cooling_register(struct cpufreq_policy *policy)
{
......@@ -45,7 +45,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
{
return;
}
#endif /* CONFIG_CPU_THERMAL */
#endif /* CONFIG_CPU_FREQ_THERMAL */
#if defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL)
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment