diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2022-08-25 15:31:37 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-01 10:12:48 +0000 |
commit | a57e1ae3adc248977c8b7b2c6fe42bc24478ce06 (patch) | |
tree | 6e8671779c6b35446982359b11f8c8d470bb9003 | |
parent | 219b32e255f3f5f5da96416fc56fa0f842fbab6e (diff) | |
download | chrome-ec-a57e1ae3adc248977c8b7b2c6fe42bc24478ce06.tar.gz |
battery: print gauge C-FET status
BUG=b:240883830
TEST=ec:~$ battery
Status: 0x00e0 FULL DCHG INIT
Param flags:00000002
Temp: 0x0bac = 298.8 K (25.7 C)
V: 0x32e7 = 13031 mV
V-desired: 0x0000 = 0 mV
I: 0x0000 = 0 mA
I-desired: 0x0000 = 0 mA
Charging: Not Allowed
Charge: 100 %
Display: 100.0 %
Manuf: COSMX
Device: L22X3PG0
Chem: LiP
Serial: 0x00bc
V-design: 0x2c2e = 11310 mV
Mode: 0x6020
Abs charge:100 %
Remaining: 4152 mAh
Cap-full: 4156 mAh
Design: 4156 mAh
Time-full: 0h:0
Empty: 0h:0
full_factor:0.97
shutdown_soc:4 %
C-FET: 0
BRANCH=none
Change-Id: Icbd8b357b608bf014f8670614fd3755a47b6d535
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3855650
Tested-by: Eric Yilun Lin <yllin@google.com>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Auto-Submit: Eric Yilun Lin <yllin@google.com>
-rw-r--r-- | common/battery.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/battery.c b/common/battery.c index 35b0c500a9..9023af7c0e 100644 --- a/common/battery.c +++ b/common/battery.c @@ -6,6 +6,7 @@ */ #include "battery.h" +#include "battery_fuel_gauge.h" #include "charge_manager.h" #include "charge_state.h" #include "common.h" @@ -243,6 +244,15 @@ static void print_battery_info(void) print_item_name("shutdown_soc:"); ccprintf("%d %%\n", batt_host_shutdown_pct); + +#ifdef CONFIG_BATTERY_FUEL_GAUGE + value = battery_is_charge_fet_disabled(); + /* reverse the flag if no error */ + if (value != -1) + value = !value; + print_item_name("C-FET:"); + ccprintf("%d\n", value); +#endif } void print_battery_debug(void) |