coreboot/src/ec
Tobias Diedrich 7b5e304c06 UPSTREAM: ec/lenovo/h8: Guard against EC bugs in the battery status logic.
On my Thinkpad with an H8-compatible ENE KB9012 EC (GDHT92WW 1.52), when
the battery is nearly full and we switch from battery to AC by plugging
in the cable, the current rate will not drop to 0 immediately, but the
discharging state is cleared immediately.

This leads to the code trying to process an invalid rate value >0x8000,
leading to a displayed rate of >1000W.

This patch changes the logic to deal with these corner cases.

BUG=none
BRANCH=none
TEST=none

Change-Id: Ib0ec4d6bd5ecc128485e89449fca8021c58dd272
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 9b798d7904
Original-Change-Id: Ideb588d00757f259792e5ae97729e371b63a096c
Original-Signed-off-by: Tobias Diedrich <ranma+coreboot@tdiedrich.de>
Original-Reviewed-on: https://review.coreboot.org/18349
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/446391
2017-02-27 14:07:51 -08:00
..
acpi UPSTREAM: ec/acpi: Include ec.c unconditionally in romstage 2016-11-10 18:31:06 -08:00
compal/ene932 UPSTREAM: ec/ene932: correct ACPI battery data fed into ToString() 2016-12-16 07:51:42 -08:00
google/chromeec UPSTREAM: ec/google/chromeec: let platform prepare for reboot when resetting EC 2017-02-08 07:27:11 -08:00
kontron/it8516e UPSTREAM: sio/acpi: Add more magic bytes to ENTER/EXIT_CONFIG_MODE 2016-12-08 22:46:20 -08:00
lenovo UPSTREAM: ec/lenovo/h8: Guard against EC bugs in the battery status logic. 2017-02-27 14:07:51 -08:00
purism/librem ec: Add support for EC used on Purism Librem laptops 2016-01-21 02:31:34 +01:00
quanta UPSTREAM: src/ec: Improve code formatting 2016-09-07 21:31:50 -07:00
roda/it8518 UPSTREAM: ec/roda/it8518: Add another embedded controller 2016-11-21 11:54:13 -08:00
smsc/mec1308 Workaround for unused variable warning. 2016-02-09 19:58:14 +01:00
ec.h UPSTREAM: mainboards,ec: provide common declaration for mainboard_ec_init() 2016-09-28 05:49:31 -07:00