The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Restrict alternate modes based on cable capabilities
@ 2026-06-26 14:26 Andrei Kuchynski
  2026-06-26 14:27 ` [PATCH v3 1/3] usb: typec: Add helper to check cable altmode support Andrei Kuchynski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrei Kuchynski @ 2026-06-26 14:26 UTC (permalink / raw)
  To: Heikki Krogerus, Benson Leung, Jameson Thies
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Andrei Kuchynski

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-26 18:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 14:26 [PATCH v3 0/3] Restrict alternate modes based on cable capabilities Andrei Kuchynski
2026-06-26 14:27 ` [PATCH v3 1/3] usb: typec: Add helper to check cable altmode support Andrei Kuchynski
2026-06-26 18:34   ` Benson Leung
2026-06-26 14:27 ` [PATCH v3 2/3] usb: typec: thunderbolt: Check " Andrei Kuchynski
2026-06-26 14:27 ` [PATCH v3 3/3] usb: typec: displayport: " Andrei Kuchynski

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