[Build][aarch64] Temperature compilation based on CONFIG_THERMAL

This commit is contained in:
CyrIng
2025-07-08 09:22:50 +02:00
parent a9bd15efe3
commit 7d00073f0e
2 changed files with 8 additions and 0 deletions

View File

@@ -48,7 +48,9 @@
#ifdef CONFIG_ACPI_CPPC_LIB
#include <acpi/cppc_acpi.h>
#endif
#ifdef CONFIG_THERMAL
#include <linux/thermal.h>
#endif
#ifdef CONFIG_HAVE_NMI
enum {
@@ -3255,6 +3257,7 @@ static void PerCore_Reset(CORE_RO *Core)
static void PerCore_ThermalZone(CORE_RO *Core)
{
#ifdef CONFIG_THERMAL
struct thermal_zone_device *tz = NULL;
switch (Core->T.Cluster.Hybrid_ID) {
@@ -3270,6 +3273,7 @@ static void PerCore_ThermalZone(CORE_RO *Core)
break;
}
PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone = tz;
#endif /* CONFIG_THERMAL */
}
static void PerCore_GenericMachine(void *arg)
@@ -3993,6 +3997,7 @@ static COF_ST Compute_COF_From_PMU_Counter( unsigned long long deltaCounter,
static void Core_Thermal_Temp(CORE_RO *Core)
{
#ifdef CONFIG_THERMAL
if (!IS_ERR(PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone)) {
int mcelsius;
if (thermal_zone_get_temp(PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone,
@@ -4001,6 +4006,7 @@ static void Core_Thermal_Temp(CORE_RO *Core)
Core->PowerThermal.Sensor = mcelsius;
}
}
#endif /* CONFIG_THERMAL */
}
static enum hrtimer_restart Cycle_GenericMachine(struct hrtimer *pTimer)

View File

@@ -424,7 +424,9 @@ typedef struct
#ifdef CONFIG_CPU_FREQ
struct cpufreq_policy FreqPolicy;
#endif /* CONFIG_CPU_FREQ */
#ifdef CONFIG_THERMAL
struct thermal_zone_device *ThermalZone;
#endif /* CONFIG_THERMAL */
#ifdef CONFIG_PM_OPP
struct {
signed int VID;