summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2020-04-02 16:27:41 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2020-04-14 11:41:12 +0200
commit33a88af10944edc7fd390000cd6bc9bbde918bc3 (patch)
tree30481005320efdc391857a372da2a6cfd3505df5 /drivers/thermal
parentc68df440b07f88210c5839d4507b5cbfa35e3df9 (diff)
thermal: Move internal IPA functions
The exported IPA functions are used by the IPA. It is pointless to declare the functions in the thermal.h file. For better self-encapsulation and less impact for the compilation if a change is made on it. Move the code in the thermal core internal header file. As the users depends on THERMAL then it is pointless to have the stub, remove them. Take also the opportunity to fix checkpatch warnings/errors when moving the code around. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Acked-by: Zhang Rui <rui.zhang@intel.com> Link: https://lore.kernel.org/r/20200402142747.8307-3-daniel.lezcano@linaro.org
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/thermal_core.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 5d08ad60d9df..f99551ce9838 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -46,6 +46,19 @@ struct thermal_attr {
char name[THERMAL_NAME_LENGTH];
};
+static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
+{
+ return cdev->ops->get_requested_power && cdev->ops->state2power &&
+ cdev->ops->power2state;
+}
+
+int power_actor_get_max_power(struct thermal_cooling_device *cdev,
+ struct thermal_zone_device *tz, u32 *max_power);
+int power_actor_get_min_power(struct thermal_cooling_device *cdev,
+ struct thermal_zone_device *tz, u32 *min_power);
+int power_actor_set_power(struct thermal_cooling_device *cdev,
+ struct thermal_instance *ti, u32 power);
+
/*
* This structure is used to describe the behavior of
* a certain cooling device on a certain trip point