[PATCH v4 0/2] USB Type-C mode selection

From: Andrei Kuchynski

Date: Thu Nov 05 2026 - 11:07:03 EST


This patch series introduces priority-based alternate mode selection
support for cros_ec_typec.
The base patch series and UCSI support was submitted here:
https://lore.kernel.org/all/20260119131824.2529334-1-akuchynski@xxxxxxxxxxxx/

When AP-driven alternate mode selection is active, the driver enforces the
mode_selection bit for each registered Alternate Mode. This blocks
individual altmode drivers from self-activating. Once registration
completes, the driver evaluates USB4 capability. If USB4 is unsupported,
it falls back to priority-based negotiation via typec_mode_selection_start.

Additionally, we swap the registration sequence of the port's alternate
modes. Registering DisplayPort after Thunderbolt correctly ensures DP is
prioritized.

Changes in v4:
- Dropped typec_altmode_state_update() call in cros_typec_altmode.c as
it is potentially unsafe.
- Added explicit partner usb mode setting via
'typec_partner_set_usb_mode' upon successful USB4 mux configuration.
- Rebased on top of the latest platform-chrome tree.
Changes in v3:
- Replaced delay/timeout consts with macros.
- Downgraded USB4/mode selection error logs to dev_warn().
- Fixed comment formatting and added comment for DP/TBT order.
Changes in v2:
- Added this cover letter.
- Rebased on top of the latest platform-chrome tree.
- Tested on Redrix with Linux Fedora 7.3.0-rc5+.
v1 Link:
https://lore.kernel.org/all/20260129131928.794768-1-akuchynski@xxxxxxxxxxxx/

Andrei Kuchynski (2):
platform/chrome: cros_ec_typec: Enforce priority-based mode selection
platform/chrome: cros_ec_typec: Reorder altmode registration

drivers/platform/chrome/cros_ec_typec.c | 67 +++++++++++++++++++++----
1 file changed, 56 insertions(+), 11 deletions(-)

--
2.56.0.398.g882cbad275-goog