This patch adds a new flag and init function for thermal_instance in order to provide connection with scheduler.
Signed-off-by: Lukasz Luba l.luba@partner.samsung.com --- drivers/thermal/thermal_core.c | 6 ++++++ drivers/thermal/thermal_core.h | 1 + 2 files changed, 7 insertions(+)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 2fc143ac8552..a3d80553b590 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -19,6 +19,7 @@ #include <linux/thermal.h> #include <linux/reboot.h> #include <linux/string.h> +#include <linux/sched/power.h> #include <linux/of.h> #include <net/netlink.h> #include <net/genetlink.h> @@ -837,6 +838,11 @@ int thermal_cpu_cdev_set_weight(int cpu, unsigned long weight) } EXPORT_SYMBOL_GPL(thermal_cpu_cdev_set_weight);
+static void thermal_cpu_cdev_init_weight(int cpu, unsigned int weight) +{ + sched_power_cpu_reinit_weight(cpu, weight); +} +
/** * thermal_zone_unbind_cooling_device() - unbind a cooling device from a diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 0df190ed82a7..f6ccd8fc2ba5 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -37,6 +37,7 @@ struct thermal_instance { struct list_head tz_node; /* node in tz->thermal_instances */ struct list_head cdev_node; /* node in cdev->thermal_instances */ unsigned int weight; /* The weight of the cooling device */ + bool sched_driven; };
#define to_thermal_zone(_dev) \