[PATCH v3 3/5] usb: typec: ucsi: Set no_mode_control flag

Andrei Kuchynski posted 5 patches 5 months, 1 week ago
There is a newer version of this series
[PATCH v3 3/5] usb: typec: ucsi: Set no_mode_control flag
Posted by Andrei Kuchynski 5 months, 1 week ago
This flag indicates that the PPM allows the OPM to change the currently
negotiated alternate mode using the SET_NEW_CAM command.

Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
---
 drivers/usb/typec/ucsi/ucsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 0d6b0cf5a7cd..9f754344a841 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1632,6 +1632,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
 
 	cap->driver_data = con;
 	cap->ops = &ucsi_ops;
+	cap->no_mode_control = !(con->ucsi->cap.features & UCSI_CAP_ALT_MODE_OVERRIDE);
 
 	if (ucsi->ops->update_connector)
 		ucsi->ops->update_connector(con);
-- 
2.51.0.355.g5224444f11-goog
Re: [PATCH v3 3/5] usb: typec: ucsi: Set no_mode_control flag
Posted by Heikki Krogerus 5 months ago
On Fri, Sep 05, 2025 at 02:22:04PM +0000, Andrei Kuchynski wrote:
> This flag indicates that the PPM allows the OPM to change the currently
> negotiated alternate mode using the SET_NEW_CAM command.
> 
> Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
> ---
>  drivers/usb/typec/ucsi/ucsi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 0d6b0cf5a7cd..9f754344a841 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1632,6 +1632,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
>  
>  	cap->driver_data = con;
>  	cap->ops = &ucsi_ops;
> +	cap->no_mode_control = !(con->ucsi->cap.features & UCSI_CAP_ALT_MODE_OVERRIDE);

The flag is now used to expose the priority file, but you can't affect
the order in which the UCSI attempts to enter the modes, or can you?

thanks,

-- 
heikki
Re: [PATCH v3 3/5] usb: typec: ucsi: Set no_mode_control flag
Posted by Andrei Kuchynski 5 months ago
On Tue, Sep 9, 2025 at 11:08 AM Heikki Krogerus
<heikki.krogerus@linux.intel.com> wrote:
>
> On Fri, Sep 05, 2025 at 02:22:04PM +0000, Andrei Kuchynski wrote:
> > This flag indicates that the PPM allows the OPM to change the currently
> > negotiated alternate mode using the SET_NEW_CAM command.
> >
> > Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
> > ---
> >  drivers/usb/typec/ucsi/ucsi.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > index 0d6b0cf5a7cd..9f754344a841 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.c
> > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > @@ -1632,6 +1632,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
> >
> >       cap->driver_data = con;
> >       cap->ops = &ucsi_ops;
> > +     cap->no_mode_control = !(con->ucsi->cap.features & UCSI_CAP_ALT_MODE_OVERRIDE);
>
> The flag is now used to expose the priority file, but you can't affect
> the order in which the UCSI attempts to enter the modes, or can you?
>
> thanks,
>
> --
> heikki

Hello Heikki,
Thank you for your review!

You are right, this patch does not affect the order in which UCSI
attempts to enter modes. Currently, UCSI implementation only has
DisplayPort alternate mode support. We are preparing to submit patches
for Thunderbolt.

Thanks,
Andrei
Re: [PATCH v3 3/5] usb: typec: ucsi: Set no_mode_control flag
Posted by Andrei Kuchynski 5 months ago
On Tue, Sep 9, 2025 at 9:22 AM Andrei Kuchynski <akuchynski@chromium.org> wrote:
>
> On Tue, Sep 9, 2025 at 11:08 AM Heikki Krogerus
> <heikki.krogerus@linux.intel.com> wrote:
> >
> > On Fri, Sep 05, 2025 at 02:22:04PM +0000, Andrei Kuchynski wrote:
> > > This flag indicates that the PPM allows the OPM to change the currently
> > > negotiated alternate mode using the SET_NEW_CAM command.
> > >
> > > Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
> > > ---
> > >  drivers/usb/typec/ucsi/ucsi.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > > index 0d6b0cf5a7cd..9f754344a841 100644
> > > --- a/drivers/usb/typec/ucsi/ucsi.c
> > > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > > @@ -1632,6 +1632,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
> > >
> > >       cap->driver_data = con;
> > >       cap->ops = &ucsi_ops;
> > > +     cap->no_mode_control = !(con->ucsi->cap.features & UCSI_CAP_ALT_MODE_OVERRIDE);
> >
> > The flag is now used to expose the priority file, but you can't affect
> > the order in which the UCSI attempts to enter the modes, or can you?
> >
> > thanks,
> >
> > --
> > heikki
>
> Hello Heikki,
> Thank you for your review!
>
> You are right, this patch does not affect the order in which UCSI
> attempts to enter modes. Currently, UCSI implementation only has
> DisplayPort alternate mode support. We are preparing to submit patches
> for Thunderbolt.
>

Hi Heikki,

should I send this patch later with the Thunderbolt UCSI support
implementation?

Thanks,
Andrei