summaryrefslogtreecommitdiff
path: root/common/usbc/usb_pd_host.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usbc/usb_pd_host.c')
-rw-r--r--common/usbc/usb_pd_host.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/common/usbc/usb_pd_host.c b/common/usbc/usb_pd_host.c
index 0b3958cd47..1e2965d114 100644
--- a/common/usbc/usb_pd_host.c
+++ b/common/usbc/usb_pd_host.c
@@ -5,17 +5,17 @@
* Host commands for TCPMv2 USB PD module
*/
+#include <string.h>
+
#include "console.h"
#include "ec_commands.h"
#include "host_command.h"
#include "usb_mux.h"
#include "usb_pd.h"
-#include "usb_pd_dpm_sm.h"
+#include "usb_pd_dpm.h"
#include "usb_pd_tcpm.h"
#include "util.h"
-#include <string.h>
-
#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ##args)
#define CPRINTS(format, args...) cprints(CC_USBPD, format, ##args)
@@ -112,8 +112,6 @@ static enum ec_status hc_typec_control(struct host_cmd_handler_args *args)
{
const struct ec_params_typec_control *p = args->params;
mux_state_t mode;
- uint32_t data[VDO_MAX_SIZE];
- enum tcpci_msg_type tx_type;
if (p->port >= board_get_usb_pd_port_count())
return EC_RES_INVALID_PARAM;
@@ -142,34 +140,6 @@ static enum ec_status hc_typec_control(struct host_cmd_handler_args *args)
return EC_RES_SUCCESS;
case TYPEC_CONTROL_COMMAND_BIST_SHARE_MODE:
return pd_set_bist_share_mode(p->bist_share_mode);
- case TYPEC_CONTROL_COMMAND_SEND_VDM_REQ:
- if (!IS_ENABLED(CONFIG_USB_PD_VDM_AP_CONTROL))
- return EC_RES_INVALID_PARAM;
-
- if (p->vdm_req_params.vdm_data_objects <= 0 ||
- p->vdm_req_params.vdm_data_objects > VDO_MAX_SIZE)
- return EC_RES_INVALID_PARAM;
-
- memcpy(data, p->vdm_req_params.vdm_data,
- sizeof(uint32_t) * p->vdm_req_params.vdm_data_objects);
-
- switch (p->vdm_req_params.partner_type) {
- case TYPEC_PARTNER_SOP:
- tx_type = TCPCI_MSG_SOP;
- break;
- case TYPEC_PARTNER_SOP_PRIME:
- tx_type = TCPCI_MSG_SOP_PRIME;
- break;
- case TYPEC_PARTNER_SOP_PRIME_PRIME:
- tx_type = TCPCI_MSG_SOP_PRIME_PRIME;
- break;
- default:
- return EC_RES_INVALID_PARAM;
- }
-
- return pd_request_vdm(p->port, data,
- p->vdm_req_params.vdm_data_objects,
- tx_type);
default:
return EC_RES_INVALID_PARAM;
}