diff options
author | Edward Hill <ecgh@chromium.org> | 2019-10-18 10:53:54 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-18 22:26:51 +0000 |
commit | 6e785cd95b5070e329785daf7166bb8823dcf48d (patch) | |
tree | 546ad3b152eaaa0ebedd82358d9356c5a2aa35de | |
parent | 73948347d8d2faf4e5ce761c93614d238c5179d9 (diff) | |
download | chrome-ec-6e785cd95b5070e329785daf7166bb8823dcf48d.tar.gz |
usbc: Add missing IS_ENABLED(CONFIG_CHARGE_MANAGER) checks
Remove the need for stubs of charge_manager_set_ceil() by adding a few
missing IS_ENABLED(CONFIG_CHARGE_MANAGER) checks.
BUG=none
BRANCH=none
TEST=buildall
Change-Id: Ia70434b05107747eb773ae30ee1de5b4bd8cbcea
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1869401
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 7 | ||||
-rw-r--r-- | common/usbc/usb_tc_drp_acc_trysrc_sm.c | 7 | ||||
-rw-r--r-- | fuzz/usb_tcpm_v2_fuzz.c | 4 | ||||
-rw-r--r-- | test/usb_typec_drp_acc_trysrc.c | 5 |
4 files changed, 7 insertions, 16 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index fc1fb2353e..ad6e892497 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -2217,11 +2217,10 @@ static void pe_snk_hard_reset_entry(int port) /* Transition Sink's power supply to the new power level */ pd_set_input_current_limit(port, pe[port].curr_limit, pe[port].supply_voltage); -#ifdef CONFIG_CHARGE_MANAGER - /* Set ceiling based on what's negotiated */ - charge_manager_set_ceil(port, CEIL_REQUESTOR_PD, + if (IS_ENABLED(CONFIG_CHARGE_MANAGER)) + /* Set ceiling based on what's negotiated */ + charge_manager_set_ceil(port, CEIL_REQUESTOR_PD, pe[port].curr_limit); -#endif } } diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c index 2dd3e4210c..15cc1e1f09 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -530,10 +530,9 @@ void tc_src_power_off(int port) /* Remove VBUS */ pd_power_supply_reset(port); - if (IS_ENABLED(CONFIG_CHARGE_MANAGER)) { + if (IS_ENABLED(CONFIG_CHARGE_MANAGER)) charge_manager_set_ceil(port, CEIL_REQUESTOR_PD, CHARGE_CEIL_NONE); - } } } @@ -1962,7 +1961,9 @@ static void tc_unoriented_dbg_acc_src_run(const int port) tc[port].cc2 == TYPEC_CC_VOLT_OPEN) { /* Remove VBUS */ pd_power_supply_reset(port); - charge_manager_set_ceil(port, CEIL_REQUESTOR_PD, + + if (IS_ENABLED(CONFIG_CHARGE_MANAGER)) + charge_manager_set_ceil(port, CEIL_REQUESTOR_PD, CHARGE_CEIL_NONE); set_state_tc(port, TC_UNATTACHED_SNK); diff --git a/fuzz/usb_tcpm_v2_fuzz.c b/fuzz/usb_tcpm_v2_fuzz.c index 71ac1fe62b..70a8f15f5f 100644 --- a/fuzz/usb_tcpm_v2_fuzz.c +++ b/fuzz/usb_tcpm_v2_fuzz.c @@ -19,7 +19,3 @@ int pd_check_vconn_swap(int port) { return 1; } - -void charge_manager_set_ceil(int port, enum ceil_requestor requestor, int ceil) -{ -} diff --git a/test/usb_typec_drp_acc_trysrc.c b/test/usb_typec_drp_acc_trysrc.c index ffc2a896c3..cce747e94c 100644 --- a/test/usb_typec_drp_acc_trysrc.c +++ b/test/usb_typec_drp_acc_trysrc.c @@ -10,11 +10,6 @@ #include "usb_sm_checks.h" #include "charge_manager.h" -void charge_manager_set_ceil(int port, enum ceil_requestor requestor, int ceil) -{ - /* Do Nothing, but needed for linking */ -} - void run_test(void) { test_reset(); |