Skip to content

Commit 328dc17

Browse files
author
Desnes Nunes
committed
usb: typec: displayport: Receive DP Status Update NAK request exit dp altmode
JIRA: https://issues.redhat.com/browse/RHEL-116016 commit b4b38ff Author: Jos Wang <joswang@lenovo.com> Date: Sun, 9 Feb 2025 15:19:26 +0800 Although some Type-C DRD devices that do not support the DP Sink function (such as Huawei Mate 40Pro), the Source Port initiates Enter Mode CMD, but the device responds to Enter Mode ACK, the Source port then initiates DP Status Update CMD, and the device responds to DP Status Update NAK. As PD2.0 spec ("6.4.4.3.4 Enter Mode Command"),A DR_Swap Message Shall Not be sent during Modal Operation between the Port Partners. At this time, the source port initiates DR_Swap message through the "echo device > /sys/class/typec/port0/data_role" command to switch the data role from host to device. The device will initiate a Hard Reset for recovery, resulting in the failure of data role swap. Therefore, when DP Status Update NAK is received, Exit Mode CMD is initiated to exit the currently entered DP altmode. Signed-off-by: Jos Wang <joswang@lenovo.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20250209071926.69625-1-joswang1221@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent 003c872 commit 328dc17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/usb/typec/altmodes/displayport.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ static int dp_altmode_vdm(struct typec_altmode *alt,
393393
break;
394394
case CMDT_RSP_NAK:
395395
switch (cmd) {
396+
case DP_CMD_STATUS_UPDATE:
397+
if (typec_altmode_exit(alt))
398+
dev_err(&dp->alt->dev, "Exit Mode Failed!\n");
399+
break;
396400
case DP_CMD_CONFIGURE:
397401
dp->data.conf = 0;
398402
ret = dp_altmode_configured(dp);

0 commit comments

Comments
 (0)