diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_common.c | 4 | ||||
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/common/usb_common.c b/common/usb_common.c index 47b0bc9454..d2a5e43cdb 100644 --- a/common/usb_common.c +++ b/common/usb_common.c @@ -622,6 +622,10 @@ __overridable int pd_custom_vdm(int port, int cnt, uint32_t *payload, if (cnt == 0) return 0; + /* Only handle custom requests for SVID Google */ + if (PD_VDO_VID(*payload) != USB_VID_GOOGLE) + return 0; + switch (cmd) { case VDO_CMD_VERSION: /* guarantee last byte of payload is null character */ diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index d4a8184883..2f61b2efe3 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -4562,6 +4562,12 @@ static void pe_handle_custom_vdm_request_entry(int port) tx_emsg[port].len = rlen * 4; memcpy(tx_emsg[port].buf, (uint8_t *)rdata, tx_emsg[port].len); send_data_msg(port, sop, PD_DATA_VENDOR_DEF); + } else { + if (prl_get_rev(port, TCPC_TX_SOP) > PD_REV20) + set_state_pe(port, PE_SEND_NOT_SUPPORTED); + else + pe_set_ready_state(port); + return; } } |