diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 3d6d775e5363..f246d1929cab 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1777,7 +1777,27 @@ static int tcpm_pd_svdm(struct tcpm_port *port, struct typec_altmode *adev, } fallthrough; case CMD_DISCOVER_SVID: + break; case CMD_DISCOVER_MODES: + /* + * 6.4.4.3.3 + * A Responder that does not support any Modes Shall return a NAK. + * + * When Initiator meets this case, it should skip + * consuming modes and continue to request Discover + * Modes for the rest of SVIDs or register altmodes + * that have been consumed in previous ACK. + */ + modep->svid_index++; + if (modep->svid_index < modep->nsvids) { + u16 svid = modep->svids[modep->svid_index]; + + response[0] = VDO(svid, 1, svdm_version, CMD_DISCOVER_MODES); + rlen = 1; + } else if (port->data_role == TYPEC_HOST) { + tcpm_register_partner_altmodes(port); + } + break; case VDO_CMD_VENDOR(0) ... VDO_CMD_VENDOR(15): break; case CMD_ENTER_MODE: