diff --git a/board/glados/board.c b/board/glados/board.c index 3bfc0139bb..123d478385 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -23,6 +23,7 @@ #include "power_button.h" #include "switch.h" #include "task.h" +#include "temp_sensor.h" #include "timer.h" #include "usb_charge.h" #include "usb_pd.h" @@ -169,6 +170,21 @@ struct motion_sensor_t motion_sensors[] = { }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); +const struct temp_sensor_t temp_sensors[] = { + {"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4}, +}; +BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); + +/* + * Thermal limits for each temp sensor. All temps are in degrees K. Must be in + * same order as enum temp_sensor_id. To always ignore any temp, use 0. + */ +struct ec_thermal_config thermal_params[] = { + /* {Twarn, Thigh, Thalt}, fan_off, fan_max */ + {{0, 0, 0}, 0, 0}, /* Battery */ +}; +BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); + const struct button_config buttons[CONFIG_BUTTON_COUNT] = { { 0 }, { 0 }, diff --git a/board/glados/board.h b/board/glados/board.h index 5317c19e63..6768b61749 100644 --- a/board/glados/board.h +++ b/board/glados/board.h @@ -55,6 +55,7 @@ #define CONFIG_SPI_FLASH_SIZE 524288 #define CONFIG_SPI_FLASH_W25Q64 +#define CONFIG_TEMP_SENSOR /* * Allow dangerous commands. * TODO(shawnn): Remove this config before production. @@ -103,6 +104,13 @@ enum power_signal { POWER_SIGNAL_COUNT }; +enum temp_sensor_id { + /* Battery temperature sensor */ + TEMP_SENSOR_BATTERY, + + TEMP_SENSOR_COUNT +}; + /* start as a sink in case we have no other power supply/battery */ #define PD_DEFAULT_STATE PD_STATE_SNK_DISCONNECTED