mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
f14879eae1c5afd899e63f3a459a8c06fc3da21d
CONTROL1 bits can be modified from multiple tasks: - charger_enable_otg_power (charger or pd task) - charger_discharge_on_ac (host command or console) - charger_enable/disable_psys (chipset task) - print_amon_bmon (console) Since we use I2C read, modify, then I2C write access pattern, there is a small chance of races between these accesses: let's protect them with a mutex. Also, the current code sometimes uses charger_get_option/set_option instead of manipulating CONTROL0 directly: fix those to regain a bit of the extra code size caused by the mutex. BRANCH=none BUG=b:67029560 TEST=Flash lux, battery charges, amon works fine. TEST=Flash elm, battery charges. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Change-Id: If375d9922db53dd582582bfa44d6218fe0b416ec Reviewed-on: https://chromium-review.googlesource.com/848486 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
For an overview of the Embedded Controller firmware, refer to http://www.chromium.org/chromium-os/2014-firmware-summit For instructions on building from source, refer to http://www.chromium.org/chromium-os/ec-development/getting-started-building-ec-images-quickly
Description
Languages
C
64.7%
Lasso
20.7%
ASL
3.6%
JavaScript
3.2%
C#
2.9%
Other
4.6%