From fc0bc62708cb39fb4ad0d7cc25cf25f3742446b5 Mon Sep 17 00:00:00 2001 From: Rob Barnes Date: Fri, 12 Feb 2021 09:16:53 -0700 Subject: guybrush: Don't read memory temp in G3 Memory thermistor is connected to S5 rail. BUG=b:179065659 BRANCH=None TEST=Build Change-Id: I5c412d6c473defae9088251db50cf23b098e2bc2 Signed-off-by: Rob Barnes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2692868 Reviewed-by: Diana Z --- baseboard/guybrush/baseboard.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'baseboard/guybrush/baseboard.c') diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c index 6f1f074f3b..ecc67a2f9c 100644 --- a/baseboard/guybrush/baseboard.c +++ b/baseboard/guybrush/baseboard.c @@ -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)) -- cgit v1.2.1