summaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/acpi/acpi.c4
-rw-r--r--src/soc/intel/common/block/include/intelblocks/acpi.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c
index d217729446..a6c626f682 100644
--- a/src/soc/intel/common/block/acpi/acpi.c
+++ b/src/soc/intel/common/block/acpi/acpi.c
@@ -242,7 +242,7 @@ void southbridge_inject_dsdt(const struct device *device)
}
}
-static int calculate_power(int tdp, int p1_ratio, int ratio)
+int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio)
{
u32 m;
u32 power;
@@ -360,7 +360,7 @@ void generate_p_state_entries(int core, int cores_per_package)
ratio >= ratio_min; ratio -= ratio_step) {
/* Calculate power at this ratio */
- power = calculate_power(power_max, ratio_max, ratio);
+ power = common_calculate_power_ratio(power_max, ratio_max, ratio);
clock = (ratio * cpu_get_bus_clock()) / KHz;
acpigen_write_PSS_package(clock, /* MHz */
diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h
index d058a5db6b..cd3a309c21 100644
--- a/src/soc/intel/common/block/include/intelblocks/acpi.h
+++ b/src/soc/intel/common/block/include/intelblocks/acpi.h
@@ -63,4 +63,9 @@ void generate_t_state_entries(int core, int cores_per_package);
*/
void soc_power_states_generation(int core_id, int cores_per_package);
+/*
+ * Common function to calculate the power ratio for power state generation
+ */
+int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio);
+
#endif /* _SOC_INTEL_COMMON_BLOCK_ACPI_H_ */