summaryrefslogtreecommitdiff
path: root/board/rambi
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-02-07 14:22:07 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-02-08 04:21:26 +0000
commit3192264679d56a6fe2ddf7ca7292025bdb3b6dfb (patch)
treec7373054c6cb04c5c3f7030f198bc9d5a5d2341c /board/rambi
parent683beb87378afbebc24a41b532cb2480d90d5282 (diff)
downloadchrome-ec-3192264679d56a6fe2ddf7ca7292025bdb3b6dfb.tar.gz
Include battery fuel gauge temp sensor in temperature sensors
This gives the AP a way to see that temperature for DPTF. Alarm thresholds were defined on a per-sensor basis, so they come along for free. BUG=chrome-os-partner:25585 BRANCH=rambi TEST=temps command shows same temp for battery as battery command (other than rounding error; battery command shows with 0.1C accuracy). 'ectool temps all' shows the battery temp as the last temperature. Unplug battery and temps command shows error for the battery temp, as does 'ectool temps all'. Change-Id: I1bce72f164d9fb1be631e7241a4ea24ddf409d7a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/185444 Reviewed-by: Dave Parker <dparker@chromium.org>
Diffstat (limited to 'board/rambi')
-rw-r--r--board/rambi/board.c3
-rw-r--r--board/rambi/board.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/board/rambi/board.c b/board/rambi/board.c
index cdef1c11b1..d4497d9901 100644
--- a/board/rambi/board.c
+++ b/board/rambi/board.c
@@ -7,6 +7,7 @@
#include "adc.h"
#include "adc_chip.h"
#include "backlight.h"
+#include "charge_state.h"
#include "charger.h"
#include "common.h"
#include "driver/temp_sensor/tmp432.h"
@@ -185,6 +186,7 @@ const struct temp_sensor_t temp_sensors[] = {
TMP432_IDX_REMOTE1, 4},
{"TMP432_CPU_bottom", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
TMP432_IDX_REMOTE2, 4},
+ {"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
@@ -196,6 +198,7 @@ struct ec_thermal_config thermal_params[] = {
{{0, 0, 0}, 0, 0},
{{0, 0, 0}, 0, 0},
{{0, 0, 0}, 0, 0},
+ {{0, 0, 0}, 0, 0},
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
diff --git a/board/rambi/board.h b/board/rambi/board.h
index 95736b2e09..091c9d9d04 100644
--- a/board/rambi/board.h
+++ b/board/rambi/board.h
@@ -179,6 +179,9 @@ enum temp_sensor_id {
TEMP_SENSOR_I2C_TMP432_REMOTE1,
TEMP_SENSOR_I2C_TMP432_REMOTE2,
+ /* Battery temperature sensor */
+ TEMP_SENSOR_BATTERY,
+
TEMP_SENSOR_COUNT
};