summaryrefslogtreecommitdiff
path: root/board/guybrush
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2021-05-19 14:39:05 -0600
committerCommit Bot <commit-bot@chromium.org>2021-05-24 20:41:58 +0000
commita8b87b8e128292db37e53a412742fd2532f14292 (patch)
treea641a5b3fa7f0f1f2cc2863a356c8533d31a58a6 /board/guybrush
parentd4d9349c1198f831d45199209827e91fd21a8d01 (diff)
downloadchrome-ec-a8b87b8e128292db37e53a412742fd2532f14292.tar.gz
guybrush: Disable SOC_TEMP for board_version > 1
SOC_TEMP is being replaced with i2c temp sensor in board version 2. Disable SOC_TEMP so it doesn't cause thermal trips on board version 2. Move board_get_soc_temp to board level since variants will not need this logic. BUG=b:188540408 TEST=Boot guybrush, see SOC temp is correct BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I8880b74993d0a942894f1c06346c534d1f39466d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2906314 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/guybrush')
-rw-r--r--board/guybrush/board.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/board/guybrush/board.c b/board/guybrush/board.c
index 75ffa3d183..1a7a169ac1 100644
--- a/board/guybrush/board.c
+++ b/board/guybrush/board.c
@@ -18,6 +18,7 @@
#include "power_button.h"
#include "switch.h"
#include "tablet_mode.h"
+#include "temp_sensor/thermistor.h"
#include "usb_mux.h"
#include "gpio_list.h" /* Must come after other header files. */
@@ -188,3 +189,21 @@ void motion_interrupt(enum gpio_signal signal)
break;
}
}
+
+int board_get_soc_temp(int idx, int *temp_k)
+{
+ uint32_t board_version = get_board_version();
+
+ if (chipset_in_state(CHIPSET_STATE_HARD_OFF))
+ return EC_ERROR_NOT_POWERED;
+
+ if (board_version == 1)
+ return get_temp_3v3_30k9_47k_4050b(idx, temp_k);
+ /*
+ * b/188539950: Read SOC temp from i2c temp sensor.
+ *
+ * For now just return 0 so no thermal events are triggered.
+ */
+ *temp_k = 0;
+ return EC_SUCCESS;
+}