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

From: Andrei Kuchynski

Date: Fri Jun 26 2026 - 10:27:44 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 v3:
- Extracted core verification logic into a static helper function
- Added an enum to handle supported, unsupported, and unknown cable states
- Patches 2 and 3 remain unchanged from the previous version.

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 | 71 ++++++++++++++++++++++++
include/linux/usb/typec.h | 1 +
4 files changed, 80 insertions(+), 1 deletion(-)

--
2.55.0.rc0.799.gd6f94ed593-goog