mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 12:30:23 +09:00
ANDROID: thermal: Add vendor hooks for thermal
Need to get the request frequency and target frequency use it to do frequency check and modify it according to the platform thermal requirements. Bug: 208166320 Signed-off-by: Jeson Gao <jeson.gao@unisoc.com> Change-Id: I776b43c8f559b8a072abd8d3abcb3528348b2c5d
This commit is contained in:
@@ -374,3 +374,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_usb_dev_resume);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipv6_gen_linklocal_addr);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sound_usb_support_cpu_suspend);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snd_compr_use_pause_in_drain);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_request_freq);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_target_freq);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <linux/thermal.h>
|
||||
|
||||
#include <trace/events/thermal.h>
|
||||
#include <trace/hooks/thermal.h>
|
||||
|
||||
/*
|
||||
* Cooling state <-> CPUFreq frequency
|
||||
@@ -213,6 +214,8 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev,
|
||||
|
||||
freq = cpufreq_quick_get(policy->cpu);
|
||||
|
||||
trace_android_vh_modify_thermal_request_freq(policy, &freq);
|
||||
|
||||
if (trace_thermal_power_cpu_get_power_enabled()) {
|
||||
u32 ncpus = cpumask_weight(policy->related_cpus);
|
||||
|
||||
@@ -312,6 +315,8 @@ static int cpufreq_power2state(struct thermal_cooling_device *cdev,
|
||||
normalised_power = (power * 100) / last_load;
|
||||
target_freq = cpu_power_to_freq(cpufreq_cdev, normalised_power);
|
||||
|
||||
trace_android_vh_modify_thermal_target_freq(policy, &target_freq);
|
||||
|
||||
*state = get_level(cpufreq_cdev, target_freq);
|
||||
trace_thermal_power_cpu_limit(policy->related_cpus, target_freq, *state,
|
||||
power);
|
||||
|
||||
@@ -19,6 +19,14 @@ DECLARE_HOOK(android_vh_thermal_pm_notify_suspend,
|
||||
TP_PROTO(struct thermal_zone_device *tz, int *irq_wakeable),
|
||||
TP_ARGS(tz, irq_wakeable));
|
||||
|
||||
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));
|
||||
|
||||
#endif /* _TRACE_HOOK_THERMAL_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
||||
Reference in New Issue
Block a user