summaryrefslogtreecommitdiff
path: root/driver/battery/max17055.h
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2018-03-19 13:47:05 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-03-21 13:25:57 -0700
commit9aee2a19e81949eca86eb0b113c99d1782eaa2d2 (patch)
treec0821d7988bc02398c876474e4914c81422a55f7 /driver/battery/max17055.h
parent6e92603e06084e9c517826bf92c37b0efd5a2e9e (diff)
downloadchrome-ec-9aee2a19e81949eca86eb0b113c99d1782eaa2d2.tar.gz
battery/max17055: Implement battery_status()
BUG=b:74841068 BRANCH=scarlet TEST='/sys/class/power_supply/sbs-9-000b/status' shows discharging/charging/full status correctly Change-Id: I4216ba2d95ac82a9f600d8685d993cb5b37206d8 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/969747 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/battery/max17055.h')
-rw-r--r--driver/battery/max17055.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/driver/battery/max17055.h b/driver/battery/max17055.h
index fb49e69c22..be070e9896 100644
--- a/driver/battery/max17055.h
+++ b/driver/battery/max17055.h
@@ -54,11 +54,16 @@
/* FStat reg (0x3d) flags */
#define FSTAT_DNR 0x0001
+#define FSTAT_FQ 0x0080
/* ModelCfg reg (0xdb) flags */
#define MODELCFG_REFRESH 0x8000
#define MODELCFG_VCHG 0x0400
+/* Smart battery status bits (sbs reg 0x16) */
+#define BATTERY_DISCHARGING 0x40
+#define BATTERY_FULLY_CHARGED 0x20
+
/*
* Before we have the battery fully characterized, we use these macros to
* convert basic battery parameters to max17055 reg values for ez config.