diff options
author | Myles Watson <mylesgw@chromium.org> | 2014-11-25 14:29:57 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2014-12-31 00:01:00 +0000 |
commit | f0fe0160a589ed0e0553df42741d605092050354 (patch) | |
tree | e40f331860990be1e63a7640df968c2552c4768f /include/battery_bq27621_g1.h | |
parent | f326cef49f6797684e710e6a19a0d78785deb54c (diff) | |
download | chrome-ec-f0fe0160a589ed0e0553df42741d605092050354.tar.gz |
battery: Add support for TI's BQ27621_g1 fuel gauge.
define CONFIG_CMD_BATDEBUG to enable console commands.
If the battery is larger than 6Ah or smaller than 150mAh, scale the parameters
transparently to the user using macros.
BUG=chrome-os-partner:34477
BRANCH=none
TEST=Custom console commands for the fuel gauge
I also used a Logic16 from Saleae and the fuel gauge on hadoken.
Signed-off-by: Myles Watson <mylesgw@chromium.org>
Change-Id: I959d51c3188336e4ad0983528ad7e53a2955a764
Reviewed-on: https://chromium-review.googlesource.com/234285
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Myles Watson <mylesgw@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Myles Watson <mylesgw@chromium.org>
Diffstat (limited to 'include/battery_bq27621_g1.h')
-rw-r--r-- | include/battery_bq27621_g1.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/battery_bq27621_g1.h b/include/battery_bq27621_g1.h new file mode 100644 index 0000000000..c9b89d42a9 --- /dev/null +++ b/include/battery_bq27621_g1.h @@ -0,0 +1,19 @@ +/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * Battery driver for BQ27621-G1 + */ + +/* Sets percent to the battery life as a percentage (0-100) + * + * Returns EC_SUCCESS on success. + */ +int bq27621_state_of_charge(int *percent); + +/* Initializes the fuel gauge with the constants for the battery. + * + * Returns EC_SUCCESS on success. + */ +int bq27621_init(void); + |