diff options
author | Jett Rink <jettrink@chromium.org> | 2019-08-08 10:06:40 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-19 17:00:54 +0000 |
commit | a0ed5aebb22c4d9b83c257b4127a1df372751e14 (patch) | |
tree | e66b9f2244ce72ac3be4874cbc8bb24a004a00d2 /include/charge_state.h | |
parent | df805d082e0272060d2761bfb065b8421a8eabd9 (diff) | |
download | chrome-ec-a0ed5aebb22c4d9b83c257b4127a1df372751e14.tar.gz |
usb: de-dup common code from old and new PD stack
We still need to pull out more common code between the two stacks, but
this is scaffolding with a few examples.
BRANCH=none
BUG=b:137493121
TEST=unit tests pass
Change-Id: Ibd9dda1e544e06f02aa3dde48ca7de1539700cfa
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744655
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'include/charge_state.h')
-rw-r--r-- | include/charge_state.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h index 04ca4c6648..4a152032fc 100644 --- a/include/charge_state.h +++ b/include/charge_state.h @@ -86,10 +86,17 @@ int charge_keep_power_off(void); */ uint32_t charge_get_flags(void); +#if defined(CONFIG_CHARGER) /** * Return current battery charge percentage. */ int charge_get_percent(void); +#elif defined(CONFIG_BATTERY) +/** + * Return current battery charge if not using charge manager sub-system. + */ +int board_get_battery_soc(void); +#endif /** * Return current display charge in 10ths of a percent (e.g. 1000 = 100.0%) |