diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-07-30 18:10:04 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-03 21:16:02 +0000 |
commit | 5dde4729511b55e169ee1d902ecdd469a71f3c0c (patch) | |
tree | 718252716b0e55d3636e770a826ef0b47b00fc47 | |
parent | 2bb093151fe5b65948f40b0518dc9c5e86f7b434 (diff) | |
download | chrome-ec-5dde4729511b55e169ee1d902ecdd469a71f3c0c.tar.gz |
glados: Add bd99992gw temperature sensors
BUG=chrome-os-partner:42156
TEST=Manual on Glados. Boot to S0, run "temps". Verify that temperatures
start around 28C and begin to increase after system is powered-on for a long
duration.
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I3bebba4864c8e5b5b23e78947522e58311298bbd
Reviewed-on: https://chromium-review.googlesource.com/289936
Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r-- | board/glados/board.c | 15 | ||||
-rw-r--r-- | board/glados/board.h | 12 |
2 files changed, 26 insertions, 1 deletions
diff --git a/board/glados/board.c b/board/glados/board.c index c4a6127024..c90c307364 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -6,6 +6,7 @@ /* Glados board-specific configuration */ #include "adc_chip.h" +#include "bd99992gw.h" #include "button.h" #include "charge_manager.h" #include "charge_state.h" @@ -192,6 +193,16 @@ void board_reset_pd_mcu(void) const struct temp_sensor_t temp_sensors[] = { {"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4}, + + /* These BD99992GW temp sensors are only readable in S0 */ + {"Ambient", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val, + BD99992GW_ADC_CHANNEL_SYSTHERM0, 4}, + {"Charger", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val, + BD99992GW_ADC_CHANNEL_SYSTHERM1, 4}, + {"DRAM", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val, + BD99992GW_ADC_CHANNEL_SYSTHERM2, 4}, + {"Wifi", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val, + BD99992GW_ADC_CHANNEL_SYSTHERM3, 4}, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); @@ -202,6 +213,10 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); struct ec_thermal_config thermal_params[] = { /* {Twarn, Thigh, Thalt}, fan_off, fan_max */ {{0, 0, 0}, 0, 0}, /* Battery */ + {{0, 0, 0}, 0, 0}, /* Ambient */ + {{0, 0, 0}, 0, 0}, /* Charger */ + {{0, 0, 0}, 0, 0}, /* DRAM */ + {{0, 0, 0}, 0, 0}, /* Wifi */ }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); diff --git a/board/glados/board.h b/board/glados/board.h index 6d99f250ce..000929d235 100644 --- a/board/glados/board.h +++ b/board/glados/board.h @@ -70,6 +70,8 @@ #define CONFIG_SPI_FLASH_W25Q64 #define CONFIG_TEMP_SENSOR +#define CONFIG_TEMP_SENSOR_BD99992GW + /* * Allow dangerous commands. * TODO(shawnn): Remove this config before production. @@ -113,6 +115,9 @@ #define I2C_PORT_CHARGER MEC1322_I2C3 #endif +/* Thermal sensors read through PMIC ADC interface */ +#define I2C_PORT_THERMAL I2C_PORT_PMIC + /* Modules we want to exclude */ #undef CONFIG_CMD_TIMERINFO #undef CONFIG_CONSOLE_CMDHELP @@ -148,9 +153,14 @@ enum power_signal { }; enum temp_sensor_id { - /* Battery temperature sensor */ TEMP_SENSOR_BATTERY, + /* These temp sensors are only readable in S0 */ + TEMP_SENSOR_AMBIENT, + TEMP_SENSOR_CHARGER, + TEMP_SENSOR_DRAM, + TEMP_SENSOR_WIFI, + TEMP_SENSOR_COUNT }; |