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/oak | |
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/oak')
-rw-r--r-- | board/oak/usb_pd_policy.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/board/oak/usb_pd_policy.c b/board/oak/usb_pd_policy.c index 33009e763e..9a37c8b205 100644 --- a/board/oak/usb_pd_policy.c +++ b/board/oak/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 */ } @@ -65,6 +68,7 @@ void pd_power_supply_reset(int port) gpio_set_level(port ? GPIO_USB_C1_5V_EN : GPIO_USB_C0_5V_EN, 0); + /* notify host of power info change */ pd_send_host_event(PD_EVENT_POWER_CHANGE); } @@ -78,6 +82,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, @@ -91,6 +96,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_board_checks(void) |