diff options
author | Ben Lok <ben.lok@mediatek.com> | 2015-11-24 14:34:34 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-12-01 01:11:04 -0800 |
commit | 9ea7ca8d87a5d6d9a8ff8e95230d7f38ee2f1eda (patch) | |
tree | 3172cfa2691a46f9ab00e665e47fc183892d6e20 /board/chell/usb_pd_policy.c | |
parent | af3172cd7ef56ab1f3ff835aad62ff7196960f1a (diff) | |
download | chrome-ec-9ea7ca8d87a5d6d9a8ff8e95230d7f38ee2f1eda.tar.gz |
pd: send power change event to AP whenever input power is changed
Send power change event to AP whenever input power is changed,
ensure that AP gets the latest power charging info.
BUG=chrome-os-partner:47677
BRANCH=none
TEST=tested on Oak by plug/unplug AC adapter to type-C ports and
verifying the UI battery icon shows the correct status instantly.
Change-Id: I7465afcd8bc9b1c56ecf70fc74446866a8ab1b9a
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/313926
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'board/chell/usb_pd_policy.c')
-rw-r--r-- | board/chell/usb_pd_policy.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/board/chell/usb_pd_policy.c b/board/chell/usb_pd_policy.c index b1a65b73bf..cc2c87d239 100644 --- a/board/chell/usb_pd_policy.c +++ b/board/chell/usb_pd_policy.c @@ -56,6 +56,9 @@ int pd_set_power_supply_ready(int port) gpio_set_level(port ? GPIO_USB_C1_5V_EN : GPIO_USB_C0_5V_EN, 1); + /* notify host of power info change */ + pd_send_host_event(PD_EVENT_POWER_CHANGE); + return EC_SUCCESS; /* we are ready */ } @@ -80,6 +83,7 @@ void pd_set_input_current_limit(int port, uint32_t max_ma, charge_manager_update_charge(CHARGE_SUPPLIER_PD, port, &charge); #endif /* notify host of power info change */ + pd_send_host_event(PD_EVENT_POWER_CHANGE); } void typec_set_input_current_limit(int port, uint32_t max_ma, @@ -94,6 +98,7 @@ void typec_set_input_current_limit(int port, uint32_t max_ma, #endif /* notify host of power info change */ + pd_send_host_event(PD_EVENT_POWER_CHANGE); } int pd_snk_is_vbus_provided(int port) |