Commit602c233f65added a conditional for ops->get_trip_temp(). In the original code, ops->get_trip_temp() is called unconditionally. So delete the conditional to fix it. At the same time, modify the comment of enable. Actually, IPA is always enable, but sometimes it needs to be disabled for a while. Making 'enable' true or false, IPA can be enabled or disabled by user requirement. When the 'override' turns to false from true and current temperature is below the switch_on_temp(means 'update' is false), the cooling device state has not changed, also the power could not be updated to the maximum power. So add a vendor hook to renew the 'update' value, so that the cooling device can be updated. Fixes:602c233f65("ANDROID: thermal: Add a flag for vendor hook enable_thermal_power_throttle") Bug: 271370056 Signed-off-by: Di Shen <di.shen@unisoc.com> Change-Id: I43191926f8da9016fe76d7cb78639b1cbd89c53e
64 lines
1.8 KiB
C
64 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM thermal
|
|
|
|
#define TRACE_INCLUDE_PATH trace/hooks
|
|
|
|
#if !defined(_TRACE_HOOK_THERMAL_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_HOOK_THERMAL_H
|
|
|
|
#include <trace/hooks/vendor_hooks.h>
|
|
|
|
#ifdef __GENKSYMS__
|
|
#include <linux/cpufreq.h>
|
|
#include <linux/thermal.h>
|
|
#endif
|
|
|
|
struct cpufreq_policy;
|
|
struct thermal_cooling_device;
|
|
struct thermal_zone_device;
|
|
|
|
DECLARE_HOOK(android_vh_modify_thermal_request_freq,
|
|
TP_PROTO(struct cpufreq_policy *policy, unsigned long *request_freq),
|
|
TP_ARGS(policy, request_freq));
|
|
|
|
DECLARE_HOOK(android_vh_modify_thermal_target_freq,
|
|
TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq),
|
|
TP_ARGS(policy, target_freq));
|
|
|
|
DECLARE_HOOK(android_vh_thermal_register,
|
|
TP_PROTO(struct cpufreq_policy *policy),
|
|
TP_ARGS(policy));
|
|
|
|
DECLARE_HOOK(android_vh_thermal_unregister,
|
|
TP_PROTO(struct cpufreq_policy *policy),
|
|
TP_ARGS(policy));
|
|
|
|
DECLARE_HOOK(android_vh_enable_thermal_power_throttle,
|
|
TP_PROTO(bool *enable, bool *override),
|
|
TP_ARGS(enable, override));
|
|
|
|
DECLARE_HOOK(android_vh_modify_thermal_throttle_update,
|
|
TP_PROTO(struct thermal_zone_device *tz, bool *update),
|
|
TP_ARGS(tz, update));
|
|
|
|
DECLARE_HOOK(android_vh_thermal_power_cap,
|
|
TP_PROTO(u32 *power_range),
|
|
TP_ARGS(power_range));
|
|
|
|
DECLARE_HOOK(android_vh_get_thermal_zone_device,
|
|
TP_PROTO(struct thermal_zone_device *tz),
|
|
TP_ARGS(tz));
|
|
|
|
DECLARE_HOOK(android_vh_disable_thermal_cooling_stats,
|
|
TP_PROTO(struct thermal_cooling_device *cdev, int *disable_stats),
|
|
TP_ARGS(cdev, disable_stats));
|
|
|
|
DECLARE_HOOK(android_vh_modify_thermal_cpu_get_power,
|
|
TP_PROTO(struct cpufreq_policy *policy, u32 *power),
|
|
TP_ARGS(policy, power));
|
|
|
|
#endif /* _TRACE_HOOK_THERMAL_H */
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|