diff options
author | Mary Ruthven <mruthven@chromium.org> | 2016-05-27 13:01:03 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2016-06-30 19:08:54 +0000 |
commit | 1e9868cf3948b0791c04f99b533d9fd099c33c83 (patch) | |
tree | f809ef462e2bb1cca082c59134d9b33b7f5210ec | |
parent | 01e6d4ba8b958af32ee6e879159ab4c660a2b680 (diff) | |
download | chrome-ec-1e9868cf3948b0791c04f99b533d9fd099c33c83.tar.gz |
lucid: Add battery temp to temp_sensors list
BUG=none
BRANCH=lucid
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>
(cherry picked from commit 8f886b40f4335a43bde5da9096308ae91935c7eb)
Reviewed-on: https://chromium-review.googlesource.com/356821
-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 a396f0b547..592e6585a1 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" @@ -141,6 +142,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 70d7ec99e9..af14adce93 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 @@ -97,6 +98,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 */ |