diff options
author | Mary Ruthven <mruthven@chromium.org> | 2016-05-27 13:01:03 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-27 18:08:51 -0700 |
commit | 8f886b40f4335a43bde5da9096308ae91935c7eb (patch) | |
tree | f8ff6ddbdd101a0f35057be6d9727e142512173a | |
parent | 9139071b7188dc63e19ddf31fb748e35add79ebf (diff) | |
download | chrome-ec-8f886b40f4335a43bde5da9096308ae91935c7eb.tar.gz |
lucid: Add battery temp to temp_sensors list
BUG=none
BRANCH=none
TEST=verify "ectool temps 0" displays the battery temperature
Change-Id: If8f58886f84b2aaffd8a517bf85633c34c9b7ca2
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347990
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | board/lucid/board.c | 16 | ||||
-rw-r--r-- | board/lucid/board.h | 7 |
2 files changed, 23 insertions, 0 deletions
diff --git a/board/lucid/board.c b/board/lucid/board.c index 86a423b653..f2c5467f87 100644 --- a/board/lucid/board.c +++ b/board/lucid/board.c @@ -18,6 +18,7 @@ #include "led_common.h" #include "registers.h" #include "task.h" +#include "temp_sensor.h" #include "usb_charge.h" #include "usb_pd.h" #include "util.h" @@ -142,6 +143,21 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +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); + /* Initialize board. */ static void board_init(void) { diff --git a/board/lucid/board.h b/board/lucid/board.h index 2163d28517..f063ad9c7c 100644 --- a/board/lucid/board.h +++ b/board/lucid/board.h @@ -52,6 +52,7 @@ #define CONFIG_STM_HWTIMER32 #define CONFIG_STM32_CHARGER_DETECT #undef CONFIG_TASK_PROFILING +#define CONFIG_TEMP_SENSOR #define CONFIG_USB_POWER_DELIVERY #define CONFIG_USB_PD_ALT_MODE #define CONFIG_USB_PD_ALT_MODE_DFP @@ -100,6 +101,12 @@ enum adc_channel { ADC_CH_COUNT }; +enum temp_sensor_id { + TEMP_SENSOR_BATTERY, + + TEMP_SENSOR_COUNT +}; + #define PD_DEFAULT_STATE PD_STATE_SNK_DISCONNECTED /* we are never a source : don't care about power supply */ |