diff options
-rw-r--r-- | board/oak/board.c | 1 | ||||
-rw-r--r-- | board/oak/usb_pd_policy.c | 18 |
2 files changed, 14 insertions, 5 deletions
diff --git a/board/oak/board.c b/board/oak/board.c index 1b4141b4f7..065a7f62ea 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -269,6 +269,7 @@ void board_set_charge_limit(int charge_ma) { charge_set_input_current_limit(MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT)); + pd_send_host_event(PD_EVENT_POWER_CHANGE); } /** diff --git a/board/oak/usb_pd_policy.c b/board/oak/usb_pd_policy.c index 9a37c8b205..38db163b58 100644 --- a/board/oak/usb_pd_policy.c +++ b/board/oak/usb_pd_policy.c @@ -81,8 +81,12 @@ void pd_set_input_current_limit(int port, uint32_t max_ma, charge.voltage = supply_voltage; charge_manager_update_charge(CHARGE_SUPPLIER_PD, port, &charge); #endif - /* notify host of power info change */ - pd_send_host_event(PD_EVENT_POWER_CHANGE); + /* + * move power info change notification to board_set_charge_limit(), + * board_set_charge_limit() will be executed in call stack of + * charge_manager_update_charge() if the "charge limit" or "charge port" + * or supplier if is changed. + */ } void typec_set_input_current_limit(int port, uint32_t max_ma, @@ -94,11 +98,15 @@ void typec_set_input_current_limit(int port, uint32_t max_ma, charge.voltage = supply_voltage; charge_manager_update_charge(CHARGE_SUPPLIER_TYPEC, port, &charge); #endif - - /* notify host of power info change */ - pd_send_host_event(PD_EVENT_POWER_CHANGE); + /* + * move power info change notification to board_set_charge_limit(), + * board_set_charge_limit() will be executed in call stack of + * charge_manager_update_charge() if the "charge limit" or "charge port" + * or supplier if is changed. + */ } + int pd_board_checks(void) { #if BOARD_REV <= OAK_REV3 |