[PATCH v2 0/3] Restrict alternate modes based on cable capabilities

From: Andrei Kuchynski

Date: Mon Jun 22 2026 - 05:42:06 EST


Currently, alternate mode drivers (like DisplayPort and Thunderbolt)
automatically assign operational callbacks (`typec_altmode_set_ops`)
during probing, even if the underlying cable capabilities cannot support
them. This can lead to incorrectly advertised state configurations or
initialization failures later on.

The first patch introduces the core helper function, and the subsequent
patches update the DisplayPort and Thunderbolt altmode drivers to
utilize this check during their respective probe phases.

Changes in v2:
- Updated patch 1/3 to use a switch-case statement, added detailed inline
comments, and separated the non-e-marked cable validation logic.
- Patches 2 and 3 remain unchanged from the previous version.

Andrei Kuchynski (3):
usb: typec: Add helper to check cable altmode support
usb: typec: thunderbolt: Check cable altmode support
usb: typec: displayport: Check cable altmode support

drivers/usb/typec/altmodes/displayport.c | 5 +-
drivers/usb/typec/altmodes/thunderbolt.c | 4 ++
drivers/usb/typec/class.c | 65 ++++++++++++++++++++++++
include/linux/usb/typec.h | 1 +
4 files changed, 74 insertions(+), 1 deletion(-)

--
2.55.0.rc0.738.g0c8ab3ebcc-goog