[PATCH v5 0/4] USB Type-C alternate mode priorities

Andrei Kuchynski posted 4 patches 1 week ago
Documentation/ABI/testing/sysfs-class-typec | 11 +++
drivers/platform/chrome/cros_ec_typec.c     |  1 +
drivers/usb/typec/class.c                   | 99 ++++++++++++++++++++-
drivers/usb/typec/class.h                   |  1 +
drivers/usb/typec/ucsi/ucsi.c               |  1 +
include/linux/usb/typec.h                   |  2 +
include/linux/usb/typec_altmode.h           |  1 +
7 files changed, 112 insertions(+), 4 deletions(-)
[PATCH v5 0/4] USB Type-C alternate mode priorities
Posted by Andrei Kuchynski 1 week ago
This patch series introduces a mechanism for setting USB Type-C alternate
mode priorities. It allows the user to specify their preferred order for
mode selection, such as USB4, Thunderbolt, or DisplayPort.

A new sysfs attribute named 'priority' is exposed to provide user-space
control over the mode selection process.

This series was tested on a Android OS device running kernel 6.18.0-rc6.

Changes in v5:
- Patches 3 and 4 (v4) have been consolidated into a singular patch,
keeping the mode priority implementation within drivers/usb/typec/class.c.

Andrei Kuchynski (4):
  usb: typec: Add mode_control field to port property
  platform/chrome: cros_ec_typec: Set no_mode_control flag
  usb: typec: ucsi: Set no_mode_control flag
  usb: typec: Expose alternate mode priority via sysfs

 Documentation/ABI/testing/sysfs-class-typec | 11 +++
 drivers/platform/chrome/cros_ec_typec.c     |  1 +
 drivers/usb/typec/class.c                   | 99 ++++++++++++++++++++-
 drivers/usb/typec/class.h                   |  1 +
 drivers/usb/typec/ucsi/ucsi.c               |  1 +
 include/linux/usb/typec.h                   |  2 +
 include/linux/usb/typec_altmode.h           |  1 +
 7 files changed, 112 insertions(+), 4 deletions(-)

-- 
2.52.0.rc2.455.g230fcf2819-goog
Re: [PATCH v5 0/4] USB Type-C alternate mode priorities
Posted by Heikki Krogerus 5 days, 14 hours ago
Hi Andrei, guys,

Mon, Nov 24, 2025 at 12:46:35PM +0000, Andrei Kuchynski kirjoitti:
> This patch series introduces a mechanism for setting USB Type-C alternate
> mode priorities. It allows the user to specify their preferred order for
> mode selection, such as USB4, Thunderbolt, or DisplayPort.
> 
> A new sysfs attribute named 'priority' is exposed to provide user-space
> control over the mode selection process.
> 
> This series was tested on a Android OS device running kernel 6.18.0-rc6.
> 
> Changes in v5:
> - Patches 3 and 4 (v4) have been consolidated into a singular patch,
> keeping the mode priority implementation within drivers/usb/typec/class.c.
> 
> Andrei Kuchynski (4):
>   usb: typec: Add mode_control field to port property
>   platform/chrome: cros_ec_typec: Set no_mode_control flag
>   usb: typec: ucsi: Set no_mode_control flag
>   usb: typec: Expose alternate mode priority via sysfs
> 
>  Documentation/ABI/testing/sysfs-class-typec | 11 +++
>  drivers/platform/chrome/cros_ec_typec.c     |  1 +
>  drivers/usb/typec/class.c                   | 99 ++++++++++++++++++++-
>  drivers/usb/typec/class.h                   |  1 +
>  drivers/usb/typec/ucsi/ucsi.c               |  1 +
>  include/linux/usb/typec.h                   |  2 +
>  include/linux/usb/typec_altmode.h           |  1 +
>  7 files changed, 112 insertions(+), 4 deletions(-)

These are okay by me. I think we can move to the next step. But I'm
not sure we apply these before that, because the file has no effect
at the moment.

Br,

-- 
heikki
Re: [PATCH v5 0/4] USB Type-C alternate mode priorities
Posted by Andrei Kuchynski 15 hours ago
On Wed, Nov 26, 2025 at 10:23 AM Heikki Krogerus
<heikki.krogerus@linux.intel.com> wrote:
>
> Hi Andrei, guys,
>
> Mon, Nov 24, 2025 at 12:46:35PM +0000, Andrei Kuchynski kirjoitti:
> > This patch series introduces a mechanism for setting USB Type-C alternate
> > mode priorities. It allows the user to specify their preferred order for
> > mode selection, such as USB4, Thunderbolt, or DisplayPort.
> >
> > A new sysfs attribute named 'priority' is exposed to provide user-space
> > control over the mode selection process.
> >
> > This series was tested on a Android OS device running kernel 6.18.0-rc6.
> >
> > Changes in v5:
> > - Patches 3 and 4 (v4) have been consolidated into a singular patch,
> > keeping the mode priority implementation within drivers/usb/typec/class.c.
> >
> > Andrei Kuchynski (4):
> >   usb: typec: Add mode_control field to port property
> >   platform/chrome: cros_ec_typec: Set no_mode_control flag
> >   usb: typec: ucsi: Set no_mode_control flag
> >   usb: typec: Expose alternate mode priority via sysfs
> >
> >  Documentation/ABI/testing/sysfs-class-typec | 11 +++
> >  drivers/platform/chrome/cros_ec_typec.c     |  1 +
> >  drivers/usb/typec/class.c                   | 99 ++++++++++++++++++++-
> >  drivers/usb/typec/class.h                   |  1 +
> >  drivers/usb/typec/ucsi/ucsi.c               |  1 +
> >  include/linux/usb/typec.h                   |  2 +
> >  include/linux/usb/typec_altmode.h           |  1 +
> >  7 files changed, 112 insertions(+), 4 deletions(-)
>
> These are okay by me. I think we can move to the next step. But I'm
> not sure we apply these before that, because the file has no effect
> at the moment.
>
> Br,
>
> --
> heikki

Hi Heikki, Abel, Benson,

Thank you for your review of the series.
I will send the subsequent series detailing how we are going to use
priorities in cros_ec_typec and cros_ec_ucsi drivers.

Thanks,
Andrei