summaryrefslogtreecommitdiff
path: root/common/build.mk
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-06-11 15:17:46 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-12 20:29:53 +0000
commitc8e36edc96360458dd29919e88a85a6749f1740b (patch)
tree5eb33a81b740b35483754575aff4a6d107ed70d8 /common/build.mk
parentdac0ef5c373bbe418ab9d9ccbf0f12a901077b1a (diff)
downloadchrome-ec-c8e36edc96360458dd29919e88a85a6749f1740b.tar.gz
extpower: Add helper function extpower_handle_update
This change adds a helper function extpower_handle_update() that performs all the necessary actions that need to be done on external power state change: 1. Call hook_notify with AC_CHANGE 2. Update memmap_batt_flags to update EC_BATT_FLAG_AC_PRESENT 3. Set host event for EC_HOST_EVENT_AC_CONNECTED or EC_HOST_EVENT_AC_DISCONNECTED. Step#2 above is important because it ensures that the memory map flag is correctly updated when host reads it. Before this change, it was observed that EC_BATT_FLAG_AC_PRESENT is updated only when static/dynamic battery information gets updated. This could result in host reading the wrong AC state if battery information did not update before host acts on the host event bit getting set for AC connect/disconnect. BUG=b:157752693 BRANCH=None TEST=Verified on trembyle that EC ASL routines read the correct state of AC present flag on receiving host event. Signed-off-by: Furquan Shaikh <furquan@google.com> Change-Id: I077de1135320654f571e5cf87ced6f08cbf23876 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2242353 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Auto-Submit: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'common/build.mk')
-rw-r--r--common/build.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/build.mk b/common/build.mk
index 1218c24326..d21baf5aa7 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -71,6 +71,7 @@ common-$(CONFIG_EC_EC_COMM_MASTER)+=ec_ec_comm_master.o
common-$(CONFIG_EC_EC_COMM_SLAVE)+=ec_ec_comm_slave.o
common-$(CONFIG_HOSTCMD_ESPI)+=espi.o
common-$(CONFIG_EXTPOWER_GPIO)+=extpower_gpio.o
+common-$(CONFIG_EXTPOWER)+=extpower_common.o
common-$(CONFIG_FANS)+=fan.o pwm.o
common-$(CONFIG_FLASH)+=flash.o
common-$(CONFIG_FMAP)+=fmap.o