mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
usb: typec: tcpm: handle nak for discover modes command
When a NAK is received in one Discover Modes, the Initiator 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. This fixes a few USB-C Docking Stations failed to register DP alternate mode since they respond a ACK in the DP SID Discover Modes first and a NAK in the second VID Discover Modes. Signed-off-by: Frank Wang <frank.wang@rock-chips.com> Change-Id: I52d3fae2731fbe88445f47be3ffee20751309ea4
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user