[PATCH v2 3/5] usb: typec: ucsi: Set alt_mode_override flag

Andrei Kuchynski posted 5 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH v2 3/5] usb: typec: ucsi: Set alt_mode_override flag
Posted by Andrei Kuchynski 1 month, 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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 0d6b0cf5a7cd..85a6b7fc6d93 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1632,6 +1632,8 @@ 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.rc2.233.g662b1ed5c5-goog
Re: [PATCH v2 3/5] usb: typec: ucsi: Set alt_mode_override flag
Posted by Heikki Krogerus 4 weeks ago
On Mon, Aug 25, 2025 at 02:57:48PM +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 | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 0d6b0cf5a7cd..85a6b7fc6d93 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1632,6 +1632,8 @@ 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);

Fits to one.

thanks,

-- 
heikki
Re: [PATCH v2 3/5] usb: typec: ucsi: Set alt_mode_override flag
Posted by Andrei Kuchynski 4 weeks ago
On Fri, Sep 5, 2025 at 11:59 AM Heikki Krogerus
<heikki.krogerus@linux.intel.com> wrote:
>
> On Mon, Aug 25, 2025 at 02:57:48PM +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 | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > index 0d6b0cf5a7cd..85a6b7fc6d93 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.c
> > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > @@ -1632,6 +1632,8 @@ 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);
>
> Fits to one.
>
> thanks,
>
> --
> heikki

I miscalculated it. One line

Thanks,
Andrei