mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: typec: ucsi: Leave the mux to the altmode driver for alt mode partners
@ 2026-11-03 13:50 Joonhoe Kim
  0 siblings, 0 replies; only message in thread
From: Joonhoe Kim @ 2026-11-03 13:50 UTC (permalink / raw)
  To: heikki.krogerus, gregkh
  Cc: neil.armstrong, dmitry.baryshkov, tvlad744, linux-usb,
	linux-arm-msm, linux-kernel, stable

Commit 25a2bc21c863 ("usb: typec: ucsi: call typec_set_mode on
non-altmode partner change") set TYPEC_STATE_USB only when the partner
flags were exactly USB, so that the altmode drivers set up the
switches, muxes and retimers for alt mode partners. Commit 226ff2e681d0
("usb: typec: ucsi: Convert connector specific commands to bitmaps")
turned that into a test of the USB bit alone, so a partner that
reports both USB and alt mode now gets TYPEC_STATE_USB as well.

On pmic_glink platforms the altmode driver programs the same mux chain,
and the two notifications are not ordered. When the UCSI connector
change comes last, an FSA4480 switches the SBU lines off, the
DisplayPort AUX channel stops working and the sink is never detected.
On the Lenovo Y700 Gen 5 (TB323FU, Kaanapali) this happens when a
DisplayPort sink is plugged in during system suspend.

Set TYPEC_STATE_USB only when the partner does not report alt mode.
USB4 partners keep TYPEC_STATE_USB, as they do now.

Fixes: 226ff2e681d0 ("usb: typec: ucsi: Convert connector specific commands to bitmaps")
Cc: stable@vger.kernel.org
Signed-off-by: Joonhoe Kim <26rote@gmail.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 2f9adf4f8bde..395554ba0312 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1356,7 +1356,8 @@ static void ucsi_partner_change(struct ucsi_connector *con)
 			typec_set_mode(con->port, TYPEC_MODE_AUDIO);
 			break;
 		default:
-			if (UCSI_CONSTAT(con, PARTNER_FLAG_USB))
+			if (UCSI_CONSTAT(con, PARTNER_FLAG_USB) &&
+			    !UCSI_CONSTAT(con, PARTNER_FLAG_ALT_MODE))
 				typec_set_mode(con->port, TYPEC_STATE_USB);
 		}
 

base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-03 13:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 13:50 [PATCH] usb: typec: ucsi: Leave the mux to the altmode driver for alt mode partners Joonhoe Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®