summaryrefslogtreecommitdiff
path: root/include/cros_ec.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-05 16:32:49 -0600
committerSimon Glass <sjg@chromium.org>2021-07-21 10:27:34 -0600
commit201efb2bb0f7c4ae5f08f51b6f6b7cdfdba5b4f4 (patch)
tree6026b80c95198250f84aa76701c47770f552948b /include/cros_ec.h
parentecc1ed912e4400b19783d4bd384914597c4a3679 (diff)
cros_ec: Allow reading the battery-charge state
Add a function to read this information from the EC. It is useful for determining whether the battery has enough charge to boot. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/cros_ec.h')
-rw-r--r--include/cros_ec.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/cros_ec.h b/include/cros_ec.h
index 9396b4d246..9dab6cdf9b 100644
--- a/include/cros_ec.h
+++ b/include/cros_ec.h
@@ -652,4 +652,12 @@ int cros_ec_vstore_read(struct udevice *dev, int slot, uint8_t *data);
int cros_ec_vstore_write(struct udevice *dev, int slot, const uint8_t *data,
size_t size);
+/**
+ * cros_ec_read_batt_charge() - Read the battery-charge state
+ *
+ * @dev: CROS-EC device
+ * @chargep: Return battery-charge state as a percentage
+ */
+int cros_ec_read_batt_charge(struct udevice *dev, uint *chargep);
+
#endif