Skip to content

Commit

Permalink
[CR] CPPC structure members compatibility since kernel 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Feb 4, 2024
1 parent af70a9d commit dfea789
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,11 @@ signed int Get_ACPI_CPPC_Registers(unsigned int cpu, void *arg)
.Minimum = CPPC_Caps.lowest_perf,
#endif
.Maximum = CPPC_Caps.highest_perf,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
.Desired = CPPC_Perf.reference_perf,
#else
.Desired = CPPC_Caps.reference_perf,
#endif
.Energy = 0
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
Expand Down
8 changes: 8 additions & 0 deletions x86_64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4075,7 +4075,11 @@ signed int Get_ACPI_CPPC_Registers(unsigned int cpu, void *arg)
.Minimum = CPPC_Caps.lowest_perf,
#endif
.Maximum = CPPC_Caps.highest_perf,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
.Desired = CPPC_Perf.reference_perf,
#else
.Desired = CPPC_Caps.reference_perf,
#endif
.Energy = 0
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
Expand Down Expand Up @@ -8138,7 +8142,11 @@ signed int Put_ACPI_CPPC_Registers(unsigned int cpu, void *arg)
#else
.min_perf = CPPC_Caps.lowest_perf,
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
.desired_perf = CPPC_Perf.reference_perf
#else
.desired_perf = CPPC_Caps.reference_perf
#endif
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
unsigned long long desired_perf = 0;
Expand Down

0 comments on commit dfea789

Please sign in to comment.