From 76ac2a28035f2c5648fd5fb4babcd94ca1c73b2b Mon Sep 17 00:00:00 2001 From: Olav Haugan Date: Tue, 18 Oct 2016 18:09:59 -0700 Subject: sched/core_ctl: Move header file to global location Move the header file of core control to the standard linux include directory to allow other entities to include this file. Change-Id: I2ddb8b3b96063be3c6a6cb6bc333998e007f9de7 Signed-off-by: Olav Haugan --- include/linux/sched/core_ctl.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/linux/sched/core_ctl.h (limited to 'include/linux') diff --git a/include/linux/sched/core_ctl.h b/include/linux/sched/core_ctl.h new file mode 100644 index 000000000000..98d7cb3e899b --- /dev/null +++ b/include/linux/sched/core_ctl.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __CORE_CTL_H +#define __CORE_CTL_H + +#ifdef CONFIG_SCHED_CORE_CTL +void core_ctl_check(u64 wallclock); +int core_ctl_set_boost(bool boost); +#else +static inline void core_ctl_check(u64 wallclock) {} +static inline int core_ctl_set_boost(bool boost) +{ + return 0; +} +#endif +#endif -- cgit v1.2.3 From 64892ef3284f74cff45dbe4fcc56ed4393c85b6e Mon Sep 17 00:00:00 2001 From: Lina Iyer Date: Tue, 23 Feb 2016 13:08:31 -0700 Subject: 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 --- include/linux/cpu_cooling.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/linux') 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) { -- cgit v1.2.3