mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
9da3dfb29fb7d2abf718a6f7173a9591c2c72720
Fix some issues with how the battery present flag is reported up to the host. If there is no battery presence GPIO or custom function then errors updating the smart battery info can result in the battery present flag reporting BP_NOT_SURE and indicating to the host that the battery is missing. In order to prevent spurious events require a second back-to-back read of a missing battery before the host is notified. When the battery presence does change, the host needs to be told to re-read the static battery info with EC_HOST_EVENT_BATTERY, passed to the OS via Notify command to tell the OS to re-execute _BIF/_BIX method on the ACPI battery device. When sending these events to the host the battery flags should first be updated in LPC shared memory so if the host handles the event quickly it will read the correct updated flags value. BUG=chrome-os-partner:34011 BRANCH=broadwell TEST=manual testing on samus: 1) add a console command that allows the smart battery update function to set batt.is_present to BP_NOT_SURE for a specified number of update cycles. 2) ensure that when the smart battery update only returns the battery missing for one update cycle that it does not result in an event to the host. 3) ensure that if the smart battery update indicates the battery is missing for more than one update cycle, such that the host is notified the battery is missing, that it correctly gets an event to re-read the battery info when it is indicated as present again. Change-Id: I0da004b991ea1a89b34cd7c0f8f3628b813ffe44 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/241763 Reviewed-by: Alec Berg <alecaberg@chromium.org>
For an overview of the Embedded Controller firmware, refer to http://www.chromium.org/chromium-os/2014-firmware-summit
Description
Languages
C
64.7%
Lasso
20.7%
ASL
3.6%
JavaScript
3.2%
C#
2.9%
Other
4.6%