ANDROID: thermal: Add vendor hook to check power range

For SoC's skin temperature, we have to use more stringent temperature
control to make IPA can monitor and mitigate temperature control earlier
and faster, so add it to meet platform thermal requirement.

Bug: 211564753

Signed-off-by: Jeson Gao <jeson.gao@unisoc.com>
Signed-off-by: Di Shen <di.shen@unisoc.com>
Change-Id: Iaef87287eef93d6fdbc3c58c93f70c1525e38296
(cherry picked from commit 6709f52325)
(cherry picked from commit 97a290b0e5)
This commit is contained in:
Jeson Gao
2021-12-21 16:32:42 +08:00
committed by Todd Kjos
parent 7191b6a759
commit ce7ceff8c8
3 changed files with 8 additions and 0 deletions

View File

@@ -271,3 +271,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_del_ref);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_register);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_unregister);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_thermal_zone_device);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_power_cap);

View File

@@ -14,6 +14,8 @@
#define CREATE_TRACE_POINTS
#include <trace/events/thermal_power_allocator.h>
#undef CREATE_TRACE_POINTS
#include <trace/hooks/thermal.h>
#include "thermal_core.h"
@@ -462,6 +464,7 @@ static int allocate_power(struct thermal_zone_device *tz,
}
power_range = pid_controller(tz, control_temp, max_allocatable_power);
trace_android_vh_thermal_power_cap(&power_range);
divvy_up_power(weighted_req_power, max_power, num_actors,
total_weighted_req_power, power_range, granted_power,

View File

@@ -44,6 +44,10 @@ DECLARE_HOOK(android_vh_get_thermal_zone_device,
TP_PROTO(struct thermal_zone_device *tz),
TP_ARGS(tz));
DECLARE_HOOK(android_vh_thermal_power_cap,
TP_PROTO(u32 *power_range),
TP_ARGS(power_range));
#endif /* _TRACE_HOOK_THERMAL_H */
/* This part must be outside protection */
#include <trace/define_trace.h>