[PATCH v5 2/4] platform/chrome: cros_ec_typec: Set no_mode_control flag

Andrei Kuchynski posted 4 patches 1 week ago
[PATCH v5 2/4] platform/chrome: cros_ec_typec: Set no_mode_control flag
Posted by Andrei Kuchynski 1 week ago
This flag specifies that the Embedded Controller (EC) must receive explicit
approval from the Application Processor (AP) before initiating Type-C
alternate modes or USB4 mode.

Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
 drivers/platform/chrome/cros_ec_typec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index b712bcff6fb2..c0806c562bb9 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -491,6 +491,7 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
 
 		cap->driver_data = cros_port;
 		cap->ops = &cros_typec_usb_mode_ops;
+		cap->no_mode_control = !typec->ap_driven_altmode;
 
 		cros_port->port = typec_register_port(dev, cap);
 		if (IS_ERR(cros_port->port)) {
-- 
2.52.0.rc2.455.g230fcf2819-goog
Re: [PATCH v5 2/4] platform/chrome: cros_ec_typec: Set no_mode_control flag
Posted by Benson Leung 1 week ago
Hi Andrei,

On Mon, Nov 24, 2025 at 12:46:37PM +0000, Andrei Kuchynski wrote:
> This flag specifies that the Embedded Controller (EC) must receive explicit
> approval from the Application Processor (AP) before initiating Type-C
> alternate modes or USB4 mode.
> 
> Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>

Reviewed-by: Benson Leung <bleung@chromium.org>

> ---
>  drivers/platform/chrome/cros_ec_typec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index b712bcff6fb2..c0806c562bb9 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -491,6 +491,7 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
>  
>  		cap->driver_data = cros_port;
>  		cap->ops = &cros_typec_usb_mode_ops;
> +		cap->no_mode_control = !typec->ap_driven_altmode;
>  
>  		cros_port->port = typec_register_port(dev, cap);
>  		if (IS_ERR(cros_port->port)) {
> -- 
> 2.52.0.rc2.455.g230fcf2819-goog
>