guybrush: Don't read memory temp in G3
Memory thermistor is connected to S5 rail.
BRANCH=None
TEST=Build
@@ -168,6 +168,7 @@ const struct adc_t adc_channels[] = {
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] = {
@@ -185,7 +186,7 @@ const struct temp_sensor_t temp_sensors[] = {
[TEMP_SENSOR_MEMORY] = {
.name = "Memory",
.type = TEMP_SENSOR_TYPE_BOARD,
- .read = get_temp_3v3_30k9_47k_4050b,
+ .read = board_get_memory_temp,
.idx = TEMP_SENSOR_MEMORY,
},
[TEMP_SENSOR_CPU] = {
@@ -784,6 +785,13 @@ void bc12_interrupt(enum gpio_signal signal)
}
}
+static int board_get_memory_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);
+}
+
static int board_get_soc_temp(int idx, int *temp_k)
{
if (chipset_in_state(CHIPSET_STATE_HARD_OFF))
