summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-01-11 17:23:41 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-01-12 14:31:13 -0800
commit9802a28f19df1e0e948d085b6bdfe99f2698eda6 (patch)
tree3c74cc23e768fd9b1e5a85aa00e3f892833571b1
parentcb8c63280139ec5990cd57668e81151e4b66856b (diff)
downloadchrome-ec-9802a28f19df1e0e948d085b6bdfe99f2698eda6.tar.gz
grunt: Enable the CPU temperature sensor
Set this up so we can measure the CPU temperature. BUG=b:71868256 BRANCH=none TEST=on EC: > temps Charger : 312 K = 39 C SOC : 321 K = 48 C CPU : 331 K = 58 C CPU shows 58 C (which seems a lot cooler than it actually is) Change-Id: Ia625e36b95a566aa436eff751c2ebf5863d984ad Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/862885 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
-rw-r--r--board/grunt/board.c2
-rw-r--r--board/grunt/board.h4
2 files changed, 6 insertions, 0 deletions
diff --git a/board/grunt/board.c b/board/grunt/board.c
index 8f03880128..92b1a69eb5 100644
--- a/board/grunt/board.c
+++ b/board/grunt/board.c
@@ -20,6 +20,7 @@
#include "driver/ppc/sn5s330.h"
#include "driver/tcpm/anx74xx.h"
#include "driver/tcpm/ps8xxx.h"
+#include "driver/temp_sensor/sb_tsi.h"
#include "ec_commands.h"
#include "extpower.h"
#include "gpio.h"
@@ -415,6 +416,7 @@ static int board_get_temp(int idx, int *temp_k)
const struct temp_sensor_t temp_sensors[] = {
{"Charger", TEMP_SENSOR_TYPE_BOARD, board_get_temp, 0, 1},
{"SOC", TEMP_SENSOR_TYPE_BOARD, board_get_temp, 1, 5},
+ {"CPU", TEMP_SENSOR_TYPE_CPU, sb_tsi_get_val, 0, 4},
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
diff --git a/board/grunt/board.h b/board/grunt/board.h
index 117da4eb3f..5175424082 100644
--- a/board/grunt/board.h
+++ b/board/grunt/board.h
@@ -133,6 +133,9 @@
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
+/* Thermal */
+#define CONFIG_TEMP_SENSOR_SB_TSI
+
/* FIFO size is a power of 2. */
#define CONFIG_ACCEL_FIFO 1024 /* TODO(teravest): Check this value. */
@@ -162,6 +165,7 @@ enum power_signal {
enum temp_sensor_id {
TEMP_SENSOR_CHARGER = 0,
TEMP_SENSOR_SOC,
+ TEMP_SENSOR_CPU,
TEMP_SENSOR_COUNT
};