Skip to content

Commit 7d00073

Browse files
committed
[Build][aarch64] Temperature compilation based on CONFIG_THERMAL
1 parent a9bd15e commit 7d00073

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

aarch64/corefreqk.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
#ifdef CONFIG_ACPI_CPPC_LIB
4949
#include <acpi/cppc_acpi.h>
5050
#endif
51+
#ifdef CONFIG_THERMAL
5152
#include <linux/thermal.h>
53+
#endif
5254

5355
#ifdef CONFIG_HAVE_NMI
5456
enum {
@@ -3255,6 +3257,7 @@ static void PerCore_Reset(CORE_RO *Core)
32553257

32563258
static void PerCore_ThermalZone(CORE_RO *Core)
32573259
{
3260+
#ifdef CONFIG_THERMAL
32583261
struct thermal_zone_device *tz = NULL;
32593262

32603263
switch (Core->T.Cluster.Hybrid_ID) {
@@ -3270,6 +3273,7 @@ static void PerCore_ThermalZone(CORE_RO *Core)
32703273
break;
32713274
}
32723275
PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone = tz;
3276+
#endif /* CONFIG_THERMAL */
32733277
}
32743278

32753279
static void PerCore_GenericMachine(void *arg)
@@ -3993,6 +3997,7 @@ static COF_ST Compute_COF_From_PMU_Counter( unsigned long long deltaCounter,
39933997

39943998
static void Core_Thermal_Temp(CORE_RO *Core)
39953999
{
4000+
#ifdef CONFIG_THERMAL
39964001
if (!IS_ERR(PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone)) {
39974002
int mcelsius;
39984003
if (thermal_zone_get_temp(PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone,
@@ -4001,6 +4006,7 @@ static void Core_Thermal_Temp(CORE_RO *Core)
40014006
Core->PowerThermal.Sensor = mcelsius;
40024007
}
40034008
}
4009+
#endif /* CONFIG_THERMAL */
40044010
}
40054011

40064012
static enum hrtimer_restart Cycle_GenericMachine(struct hrtimer *pTimer)

aarch64/corefreqk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,9 @@ typedef struct
424424
#ifdef CONFIG_CPU_FREQ
425425
struct cpufreq_policy FreqPolicy;
426426
#endif /* CONFIG_CPU_FREQ */
427+
#ifdef CONFIG_THERMAL
427428
struct thermal_zone_device *ThermalZone;
429+
#endif /* CONFIG_THERMAL */
428430
#ifdef CONFIG_PM_OPP
429431
struct {
430432
signed int VID;

0 commit comments

Comments
 (0)