diff options
author | Yilun Lin <yllin@google.com> | 2019-07-22 10:45:41 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-22 06:30:01 +0000 |
commit | be58022c66ca014d66ab89965ab3d61f4c6acd42 (patch) | |
tree | 1f10183f93f80b23ebb5366d667e75b1e17360d8 | |
parent | 473bd883b60fd5b00377766dae2bacad246de0d2 (diff) | |
download | chrome-ec-be58022c66ca014d66ab89965ab3d61f4c6acd42.tar.gz |
charger/rt946x: notify AC_CHANGE when ext power plugged/unplugged
Support hooking on AC_CHANGE when external power plugged and unplugged.
BUG=b:137903027
TEST=on kukui, shutdown -h now, and plug power adapter on kukui, and see
battery LED turning on immediately, and also see console prints
"AC on"
BRANCH=master
Change-Id: I6e2704cfe2d3ed09cc6e1c76b8d03a5030a400ed
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1712400
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Commit-Queue: Yilun Lin <yllin@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
-rw-r--r-- | driver/charger/rt946x.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c index 514829d6f6..e86d1e9add 100644 --- a/driver/charger/rt946x.c +++ b/driver/charger/rt946x.c @@ -989,6 +989,7 @@ void usb_charger_task(void *u) } rt946x_enable_bc12_detection(0); + hook_notify(HOOK_AC_CHANGE); } /* VBUS detach event */ @@ -1001,6 +1002,8 @@ void usb_charger_task(void *u) if (!IS_ENABLED(CONFIG_CHARGER_MT6370_BC12_GPIO)) rt946x_enable_bc12_detection(1); + + hook_notify(HOOK_AC_CHANGE); } task_wait_event(-1); |