summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--baseboard/guybrush/baseboard.c9
-rw-r--r--baseboard/guybrush/baseboard.h2
-rw-r--r--board/guybrush/board.c19
3 files changed, 22 insertions, 8 deletions
diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c
index 4a370143b7..2cf2da3051 100644
--- a/baseboard/guybrush/baseboard.c
+++ b/baseboard/guybrush/baseboard.c
@@ -189,7 +189,7 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
/* Temp Sensors */
static int board_get_memory_temp(int, int *);
-static int board_get_soc_temp(int, int *);
+
const struct temp_sensor_t temp_sensors[] = {
[TEMP_SENSOR_SOC] = {
.name = "SOC",
@@ -755,13 +755,6 @@ static int board_get_memory_temp(int idx, int *temp_k)
return get_temp_3v3_30k9_47k_4050b(idx, temp_k);
}
-static int board_get_soc_temp(int idx, int *temp_k)
-{
- if (chipset_in_state(CHIPSET_STATE_HARD_OFF))
- return EC_ERROR_NOT_POWERED;
- return get_temp_3v3_30k9_47k_4050b(idx, temp_k);
-}
-
/**
* Return if VBUS is sagging too low
*/
diff --git a/baseboard/guybrush/baseboard.h b/baseboard/guybrush/baseboard.h
index 84a65e8508..20c298126a 100644
--- a/baseboard/guybrush/baseboard.h
+++ b/baseboard/guybrush/baseboard.h
@@ -348,6 +348,8 @@ void sbu_fault_interrupt(enum ioex_signal signal);
void baseboard_en_pwr_pcore_s0(enum gpio_signal signal);
void baseboard_en_pwr_s0(enum gpio_signal signal);
+int board_get_soc_temp(int idx, int *temp_k);
+
/* CBI utility functions */
uint32_t get_sku_id(void);
uint32_t get_board_version(void);
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;
+}