diff options
-rw-r--r-- | board/servo_v4/usb_pd_config.h | 4 | ||||
-rw-r--r-- | board/servo_v4/usb_pd_policy.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/board/servo_v4/usb_pd_config.h b/board/servo_v4/usb_pd_config.h index de2e3c70c8..e56dc5c791 100644 --- a/board/servo_v4/usb_pd_config.h +++ b/board/servo_v4/usb_pd_config.h @@ -265,8 +265,8 @@ static inline void pd_set_host_mode(int port, int enable) static inline void pd_config_init(int port, uint8_t power_role) { /* - * Set CC pull resistors, and charge_en and vbus_en GPIOs to match - * the initial role. + * Set CC pull resistors. The PD state machine will then transit and + * enable VBUS after it detects valid voltages on CC lines. */ pd_set_host_mode(port, power_role); diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c index e45a920b1e..0ae2552e02 100644 --- a/board/servo_v4/usb_pd_policy.c +++ b/board/servo_v4/usb_pd_policy.c @@ -131,7 +131,7 @@ static void dut_allow_charge(void) pd_get_dual_role(DUT) != PD_DRP_FORCE_SOURCE) { CPRINTS("Enable DUT charge through"); pd_set_dual_role(DUT, PD_DRP_FORCE_SOURCE); - pd_config_init(DUT, PD_ROLE_SOURCE); + pd_set_host_mode(DUT, 1); pd_update_contract(DUT); } } @@ -165,7 +165,7 @@ static void board_manage_dut_port(void) /* Mark as SNK only. */ pd_set_dual_role(DUT, PD_DRP_FORCE_SINK); - pd_config_init(DUT, PD_ROLE_SINK); + pd_set_host_mode(DUT, 0); } else { /* Allow charge through after PD negotiate. */ hook_call_deferred(&dut_allow_charge_data, 2000 * MSEC); @@ -743,16 +743,16 @@ static void do_cc(int disable_cc_new, int disable_dts_new, int allow_src_new) allow_src_mode = allow_src_new; if (!disable_cc) { - /* Can we charge? */ + /* Can we source? */ dualrole = allow_src_mode && charge_port_is_active(); pd_set_dual_role(DUT, dualrole ? PD_DRP_FORCE_SOURCE : PD_DRP_FORCE_SINK); /* * Present Rp or Rd on CC1 and CC2 based on - * disable_dts_mode + * whether we can source or not. */ - pd_config_init(DUT, dualrole); + pd_set_host_mode(DUT, dualrole); pd_comm_enable(DUT, dualrole); } } |