diff options
author | Diana Z <dzigterman@chromium.org> | 2019-02-06 14:32:28 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-13 14:42:49 -0800 |
commit | 5ea22dcbf4c467d3610eeb7dfdddec5f8c286d4f (patch) | |
tree | ff48acdd4e8050a21c4bd19307886efd3e6128b6 /board | |
parent | 1bbeef12f7d1f4b8f56648202cfe467b53cfc6b4 (diff) | |
download | chrome-ec-5ea22dcbf4c467d3610eeb7dfdddec5f8c286d4f.tar.gz |
Ampton: correct thermistor reading function
The charger thermistor on ampton is tied to the PP3300_A rail, rather
than the PP6000_LDO_OUT rail which bip used. As such, the charger
reading does not depend on AC being present, but does depend on the A
rail being enabled.
BUG=None
BRANCH=octopus
TEST=loaded onto apel and confirmed "ectool temps all" now returns
charger temperature with AC unplugged, in G3 "temps" will show the
ambient and charger sensors as not powered
Change-Id: I2ae03899fba8a436e34452bbc644f5e872afd408
Signed-off-by: Diana Z <dzigterman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1457076
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/ampton/board.c | 9 | ||||
-rw-r--r-- | board/ampton/board.h | 1 |
2 files changed, 2 insertions, 8 deletions
diff --git a/board/ampton/board.c b/board/ampton/board.c index caca6f1d13..d4529af87c 100644 --- a/board/ampton/board.c +++ b/board/ampton/board.c @@ -115,13 +115,6 @@ const struct adc_t adc_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); -static int read_charger_temp(int idx, int *temp_ptr) -{ - if (!gpio_get_level(GPIO_AC_PRESENT)) - return EC_ERROR_NOT_POWERED; - return get_temp_3v3_13k7_47k_4050b(idx, temp_ptr); -} - const struct temp_sensor_t temp_sensors[] = { [TEMP_SENSOR_BATTERY] = {.name = "Battery", .type = TEMP_SENSOR_TYPE_BATTERY, @@ -134,7 +127,7 @@ const struct temp_sensor_t temp_sensors[] = { .action_delay_sec = 5}, [TEMP_SENSOR_CHARGER] = {.name = "Charger", .type = TEMP_SENSOR_TYPE_BOARD, - .read = read_charger_temp, + .read = get_temp_3v3_13k7_47k_4050b, .idx = ADC_TEMP_SENSOR_CHARGER, .action_delay_sec = 1}, }; diff --git a/board/ampton/board.h b/board/ampton/board.h index 76cee7f6af..bc4132385e 100644 --- a/board/ampton/board.h +++ b/board/ampton/board.h @@ -29,6 +29,7 @@ #define CONFIG_THERMISTOR #define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B #define CONFIG_STEINHART_HART_3V3_13K7_47K_4050B +#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_PP3300 #define CONFIG_ACCEL_KX022 /* Lid accel */ #define CONFIG_ACCELGYRO_BMI160 /* Base accel */ |