From 072de836f53be56a70cecf70b43ae43b7ce17376 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 10:08:36 +0000
Subject: [PATCH] mk-rootfs.sh
---
kernel/drivers/usb/typec/tcpm/tcpm.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/kernel/drivers/usb/typec/tcpm/tcpm.c b/kernel/drivers/usb/typec/tcpm/tcpm.c
index a088c6e..141a143 100644
--- a/kernel/drivers/usb/typec/tcpm/tcpm.c
+++ b/kernel/drivers/usb/typec/tcpm/tcpm.c
@@ -1724,6 +1724,14 @@
rlen = 1;
} else if (port->data_role == TYPEC_HOST) {
tcpm_register_partner_altmodes(port);
+ } else {
+ /* Do dr_swap for ufp if the port supports drd */
+ if (port->typec_caps.data == TYPEC_PORT_DRD &&
+ !IS_ERR_OR_NULL(port->port_altmode[0])) {
+ port->vdm_sm_running = false;
+ port->upcoming_state = DR_SWAP_SEND;
+ tcpm_ams_start(port, DATA_ROLE_SWAP);
+ }
}
break;
case CMD_ENTER_MODE:
@@ -1755,6 +1763,16 @@
tcpm_ams_finish(port);
switch (cmd) {
case CMD_DISCOVER_IDENT:
+ /* Do dr_swap for ufp if the port supports drd */
+ if (port->typec_caps.data == TYPEC_PORT_DRD &&
+ port->data_role == TYPEC_DEVICE &&
+ !IS_ERR_OR_NULL(port->port_altmode[0])) {
+ port->vdm_sm_running = false;
+ port->upcoming_state = DR_SWAP_SEND;
+ tcpm_ams_start(port, DATA_ROLE_SWAP);
+ break;
+ }
+ fallthrough;
case CMD_DISCOVER_SVID:
case CMD_DISCOVER_MODES:
case VDO_CMD_VENDOR(0) ... VDO_CMD_VENDOR(15):
--
Gitblit v1.6.2