summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/amd/cezanne/acpi.c7
-rw-r--r--src/soc/amd/mendocino/acpi.c7
-rw-r--r--src/soc/amd/picasso/acpi.c7
3 files changed, 12 insertions, 9 deletions
diff --git a/src/soc/amd/cezanne/acpi.c b/src/soc/amd/cezanne/acpi.c
index 6ce041b850..e9123456d5 100644
--- a/src/soc/amd/cezanne/acpi.c
+++ b/src/soc/amd/cezanne/acpi.c
@@ -195,16 +195,17 @@ static uint32_t get_pstate_core_power(msr_t pstate_def)
}
/* Power in mW */
- power_in_mw = (voltage_in_uvolts) / 1000 * current_value_amps;
+ power_in_mw = (voltage_in_uvolts) / 10 * current_value_amps;
switch (current_divisor) {
case 0:
+ power_in_mw = power_in_mw / 100L;
break;
case 1:
- power_in_mw = power_in_mw / 10L;
+ power_in_mw = power_in_mw / 1000L;
break;
case 2:
- power_in_mw = power_in_mw / 100L;
+ power_in_mw = power_in_mw / 10000L;
break;
case 3:
/* current_divisor is set to an undefined value.*/
diff --git a/src/soc/amd/mendocino/acpi.c b/src/soc/amd/mendocino/acpi.c
index 75dcf82efc..3005920aff 100644
--- a/src/soc/amd/mendocino/acpi.c
+++ b/src/soc/amd/mendocino/acpi.c
@@ -197,16 +197,17 @@ static uint32_t get_pstate_core_power(msr_t pstate_def)
}
/* Power in mW */
- power_in_mw = (voltage_in_uvolts) / 1000 * current_value_amps;
+ power_in_mw = (voltage_in_uvolts) / 10 * current_value_amps;
switch (current_divisor) {
case 0:
+ power_in_mw = power_in_mw / 100L;
break;
case 1:
- power_in_mw = power_in_mw / 10L;
+ power_in_mw = power_in_mw / 1000L;
break;
case 2:
- power_in_mw = power_in_mw / 100L;
+ power_in_mw = power_in_mw / 10000L;
break;
case 3:
/* current_divisor is set to an undefined value.*/
diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c
index 9c798caffd..d075e052be 100644
--- a/src/soc/amd/picasso/acpi.c
+++ b/src/soc/amd/picasso/acpi.c
@@ -203,16 +203,17 @@ static uint32_t get_pstate_core_power(msr_t pstate_def)
}
/* Power in mW */
- power_in_mw = (voltage_in_uvolts) / 1000 * current_value_amps;
+ power_in_mw = (voltage_in_uvolts) / 10 * current_value_amps;
switch (current_divisor) {
case 0:
+ power_in_mw = power_in_mw / 100L;
break;
case 1:
- power_in_mw = power_in_mw / 10L;
+ power_in_mw = power_in_mw / 1000L;
break;
case 2:
- power_in_mw = power_in_mw / 100L;
+ power_in_mw = power_in_mw / 10000L;
break;
case 3:
/* current_divisor is set to an undefined value.*/