diff options
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 16 | ||||
-rw-r--r-- | test/test_config.h | 2 | ||||
-rw-r--r-- | test/usb_pe_drp.c | 13 |
3 files changed, 14 insertions, 17 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index 7661e8b2ec..0230e0bbb2 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -2153,8 +2153,11 @@ static void pe_src_startup_entry(int port) /* Reset VCONN swap counter */ pe[port].vconn_swap_counter = 0; - /* Request partner sink caps */ - pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); + /* Request partner sink caps if a feature requires them */ + if (IS_ENABLED(CONFIG_USB_PD_HOST_CMD) || + CONFIG_USB_PD_3A_PORTS > 0 || + IS_ENABLED(CONFIG_USB_PD_FRS)) + pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); } } @@ -3005,13 +3008,18 @@ static void pe_snk_startup_entry(int port) PE_SET_FLAG(port, PE_FLAGS_VCONN_SWAP_TO_ON); } - /* Request sink caps for FRS and PRS evaluation. + /* + * Request sink caps for FRS, output power consideration, or reporting + * to the AP through host commands. * * On entry to the PE_SNK_Ready state if the Sink supports Fast Role * Swap, then the Policy Engine Shall do the following: * - Send a Get_Sink_Cap Message */ - pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); + if (IS_ENABLED(CONFIG_USB_PD_HOST_CMD) || + CONFIG_USB_PD_3A_PORTS > 0 || + IS_ENABLED(CONFIG_USB_PD_FRS)) + pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); } diff --git a/test/test_config.h b/test/test_config.h index d06db8252e..9e74a8646b 100644 --- a/test/test_config.h +++ b/test/test_config.h @@ -404,6 +404,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #undef CONFIG_USB_PD_HOST_CMD #define CONFIG_USB_PD_ALT_MODE_DFP #define CONFIG_USBC_SS_MUX +#define CONFIG_USB_PD_3A_PORTS 0 /* Host does not define a 3.0 A PDO */ #endif #if defined(TEST_USB_PE_DRP) || defined(TEST_USB_PE_DRP_NOEXTENDED) @@ -429,6 +430,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #define CONFIG_USBC_SS_MUX #define I2C_PORT_HOST_TCPC 0 #define CONFIG_CHARGE_MANAGER +#define CONFIG_USB_PD_3A_PORTS 0 /* Host does not define a 3.0 A PDO */ #endif /* TEST_USB_PE_DRP || TEST_USB_PE_DRP_NOEXTENDED */ /* Common TypeC tests defines */ diff --git a/test/usb_pe_drp.c b/test/usb_pe_drp.c index da204f3610..086e2263a5 100644 --- a/test/usb_pe_drp.c +++ b/test/usb_pe_drp.c @@ -97,19 +97,6 @@ test_static int finish_src_discovery(int startup_cable_probes) PD_ROLE_SINK, PD_ROLE_UFP, 0); /* - * Expect GET_SINK_CAP, reply with a simple Sink Cap since sink partners - * must support this message. - */ - TEST_EQ(mock_prl_wait_for_tx_msg(PORT0, TCPC_TX_SOP, - PD_CTRL_GET_SINK_CAP, 0, 10 * MSEC), - EC_SUCCESS, "%d"); - mock_prl_message_sent(PORT0); - task_wait_event(10 * MSEC); - rx_message(PD_MSG_SOP, 0, PD_DATA_SINK_CAP, - PD_ROLE_SINK, PD_ROLE_UFP, - PDO_FIXED(5000, 500, PDO_FIXED_COMM_CAP)); - - /* * Cable identity discovery is attempted 6 times total. 1 was done * above, so expect 5 more now. */ |