summaryrefslogtreecommitdiff
path: root/chip/lm4/peci.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/lm4/peci.c')
-rw-r--r--chip/lm4/peci.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/chip/lm4/peci.c b/chip/lm4/peci.c
index 210fb4e6c9..ddbb1a9a6c 100644
--- a/chip/lm4/peci.c
+++ b/chip/lm4/peci.c
@@ -5,8 +5,9 @@
/* PECI interface for Chrome EC */
-#include "board.h"
+#include "chipset.h"
#include "clock.h"
+#include "config.h"
#include "console.h"
#include "gpio.h"
#include "hooks.h"
@@ -75,6 +76,9 @@ int peci_temp_sensor_get_val(int idx, int *temp_ptr)
int success_cnt = 0;
int i;
+ if (!chipset_in_state(CHIPSET_STATE_ON))
+ return EC_ERROR_NOT_POWERED;
+
for (i = 0; i < TEMP_AVG_LENGTH; ++i) {
if (temp_vals[i] >= 0) {
success_cnt++;