diff options
| author | Lina Iyer <ilina@codeaurora.org> | 2016-02-23 13:08:31 -0700 |
|---|---|---|
| committer | Ram Chandrasekar <rkumbako@codeaurora.org> | 2016-10-21 10:53:56 -0600 |
| commit | 64892ef3284f74cff45dbe4fcc56ed4393c85b6e (patch) | |
| tree | c0c5bb1ba1bbdd36b3f34201510f5c7605d99e4e /include/linux | |
| parent | 1ff56658f3493b9e56cb30d1ddcd7e6646d14c85 (diff) | |
drivers: thermal: cpu_cooling: allow platform freq mitigation
cpu device can be controlled by a hardware platform device and in those
cases the cpu cooling device interface should communicate with the
platform device instead of the cpufreq module.
Allow platform drivers to register with CPU cooling with their frequency
mitigation functions. This allows the cpu cooling interface to
communicate the frequency mitigations to the platform driver directly.
Change-Id: I47960b002bf1bce1cd588de2892de46793a95562
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cpu_cooling.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index c156f5082758..e221494fb7a0 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h @@ -31,6 +31,11 @@ typedef int (*get_static_t)(cpumask_t *cpumask, int interval, unsigned long voltage, u32 *power); +struct cpu_cooling_ops { + int (*ceil_limit)(int, u32); + int (*get_cur_state)(int, unsigned long *); +}; + #ifdef CONFIG_CPU_THERMAL /** * cpufreq_cooling_register - function to create cpufreq cooling device. @@ -43,6 +48,10 @@ struct thermal_cooling_device * cpufreq_power_cooling_register(const struct cpumask *clip_cpus, u32 capacitance, get_static_t plat_static_func); +struct thermal_cooling_device * +cpufreq_platform_cooling_register(const struct cpumask *clip_cpus, + struct cpu_cooling_ops *ops); + /** * of_cpufreq_cooling_register - create cpufreq cooling device based on DT. * @np: a valid struct device_node to the cooling device device tree node. @@ -112,6 +121,13 @@ of_cpufreq_power_cooling_register(struct device_node *np, return NULL; } +static inline struct thermal_cooling_device * +cpufreq_platform_cooling_register(const struct cpumask *clip_cpus, + struct cpu_cooling_ops *ops) +{ + return NULL; +} + static inline void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) { |
