ANDROID: thermal: Add vendor hook to get thermal zone device

Need to get temperature data and config info from thermal zone device.

Bug: 208946028

Signed-off-by: Di Shen <di.shen@unisoc.com>
Signed-off-by: Jeson Gao <jeson.gao@unisoc.com>
Change-Id: I5945df5258181b4a441b6bbe09327099491418b3
(cherry picked from commit c53f0e3530641d6b696bae12eed55c58599ab516)
This commit is contained in:
Di Shen
2022-04-07 19:46:18 +08:00
committed by Todd Kjos
parent e21b6105a9
commit 12b8ef18b2
3 changed files with 11 additions and 0 deletions

View File

@@ -277,3 +277,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_audio_usb_offload_ep_action);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_audio_usb_offload_synctype); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_audio_usb_offload_synctype);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_atomic_remove_fb); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_atomic_remove_fb);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_drm_atomic_check_modeset); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_drm_atomic_check_modeset);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_thermal_zone_device);

View File

@@ -23,6 +23,8 @@
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
#include <trace/events/thermal.h> #include <trace/events/thermal.h>
#undef CREATE_TRACE_POINTS
#include <trace/hooks/thermal.h>
#include "thermal_core.h" #include "thermal_core.h"
#include "thermal_hwmon.h" #include "thermal_hwmon.h"
@@ -505,6 +507,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
for (count = 0; count < tz->trips; count++) for (count = 0; count < tz->trips; count++)
handle_thermal_trip(tz, count); handle_thermal_trip(tz, count);
trace_android_vh_get_thermal_zone_device(tz);
} }
EXPORT_SYMBOL_GPL(thermal_zone_device_update); EXPORT_SYMBOL_GPL(thermal_zone_device_update);

View File

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