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

Andrei Kuchynski posted 5 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH v1 3/5] usb: typec: ucsi: Set alt_mode_override flag
Posted by Andrei Kuchynski 1 month, 2 weeks 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 5739ea2abdd1..5ba8b1bc874b 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1616,6 +1616,8 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
 
 	cap->driver_data = con;
 	cap->ops = &ucsi_ops;
+	cap->alt_mode_override =
+		!!(con->ucsi->cap.features & UCSI_CAP_ALT_MODE_OVERRIDE);
 
 	if (ucsi->ops->update_connector)
 		ucsi->ops->update_connector(con);
-- 
2.51.0.rc0.215.g125493bb4a-goog
Re: [PATCH v1 3/5] usb: typec: ucsi: Set alt_mode_override flag
Posted by Heikki Krogerus 1 month, 2 weeks ago
On Thu, Aug 14, 2025 at 06:44:53PM +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 5739ea2abdd1..5ba8b1bc874b 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1616,6 +1616,8 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
>  
>  	cap->driver_data = con;
>  	cap->ops = &ucsi_ops;
> +	cap->alt_mode_override =
> +		!!(con->ucsi->cap.features & UCSI_CAP_ALT_MODE_OVERRIDE);

One line is enough.

>  	if (ucsi->ops->update_connector)
>  		ucsi->ops->update_connector(con);
> -- 
> 2.51.0.rc0.215.g125493bb4a-goog

thanks,

-- 
heikki