From 07f0d51a8ea57b0d29c35fd0c81f4f452ff60f22 Mon Sep 17 00:00:00 2001 From: Andrei Kuchynski Date: Fri, 26 Jun 2026 14:27:01 +0000 Subject: [PATCH] usb: typec: thunderbolt: Check cable altmode support Update the probe function to utilize the new typec_cable_altmode_unsupported() helper. If the cable doesn't support Thunderbolt altmode, don't initialize altmode_ops and prevent altmode from being activated. Signed-off-by: Andrei Kuchynski Reviewed-by: Benson Leung Reviewed-by: Heikki Krogerus Link: https://patch.msgid.link/20260626142702.1941182-3-akuchynski@chromium.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/altmodes/thunderbolt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/typec/altmodes/thunderbolt.c b/drivers/usb/typec/altmodes/thunderbolt.c index 32250b94262a..2eccdddf1b1f 100644 --- a/drivers/usb/typec/altmodes/thunderbolt.c +++ b/drivers/usb/typec/altmodes/thunderbolt.c @@ -284,6 +284,10 @@ static int tbt_altmode_probe(struct typec_altmode *alt) alt->desc = "Thunderbolt3"; typec_altmode_set_drvdata(alt, tbt); + + if (typec_cable_altmode_unsupported(alt)) + return 0; + typec_altmode_set_ops(alt, &tbt_altmode_ops); if (!alt->mode_selection && tbt_ready(alt)) {