diff options
author | Rob Barnes <robbarnes@google.com> | 2022-02-28 16:03:18 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-03-01 23:54:33 +0000 |
commit | b135e45447ba42f276b6f5232e2573d166320b31 (patch) | |
tree | 2a41981ac8191e3a2ac89495771f02dfde8fb57d /include | |
parent | 5130158262f9167cc8d4ef69f397a0a87968e996 (diff) | |
download | chrome-ec-b135e45447ba42f276b6f5232e2573d166320b31.tar.gz |
battery: Do not return display_soc if data is bad
If BATT_FLAG_BAD_FULL_CAPACITY or BATT_FLAG_BAD_REMAINING_CAPACITY
flags are set, then display_charge value is also bad.
Return UNAVALIABLE error rather than 0%.
BUG=b:217401040
BRANCH=guybrush
TEST=Force battery glitch, do not observe 0% battery in OS
Change-Id: Iea861582dde1f7db3d6a4c40e88169d7f74ca159
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3496464
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ec_commands.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 919215a085..c17f23ff3a 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -7028,6 +7028,14 @@ struct ec_response_pchg_update { } __ec_align4; +/***************************************************************************** + * Get displayable charge percent + * + * Return + * EC_RES_SUCCESS : Values successfully read + * EC_RES_UNAVAILABLE : Values are currently unavailable, + * e.g. unresponsive battery. + */ #define EC_CMD_DISPLAY_SOC 0x0137 struct ec_response_display_soc { |