summaryrefslogtreecommitdiff
path: root/include/charge_state.h
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 /include/charge_state.h
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 'include/charge_state.h')
-rw-r--r--include/charge_state.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h
index 7aaf77b93d..152e767295 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -143,5 +143,16 @@ int charge_want_shutdown(void);
#else
static inline int charge_want_shutdown(void) { return 0; }
#endif
+
+/**
+ * Get the last polled battery/charger temperature.
+ *
+ * @param idx Sensor index to read.
+ * @param temp_ptr Destination for temperature in K.
+ *
+ * @return EC_SUCCESS if successful, non-zero if error.
+ */
+int charge_temp_sensor_get_val(int idx, int *temp_ptr);
+
#endif /* __CROS_EC_CHARGE_STATE_H */