Chrome platform driver development
 help / color / mirror / Atom feed
From: Dzmitry Sankouski <dsankouski@gmail.com>
To: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>,
	heikki.krogerus@linux.intel.com, tzungbi@kernel.org,
	linux-usb@vger.kernel.org, chrome-platform@lists.linux.dev
Cc: akuchynski@google.com, sboyd@kernel.org, pmalani@chromium.org,
	badhri@google.com, rdbabiera@google.com,
	dmitry.baryshkov@linaro.org, jthies@google.com,
	Benson Leung <bleung@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 7/8] platform/chrome: cros_ec_typec: Thunderbolt support
Date: Mon, 2 Mar 2026 12:36:56 +0300	[thread overview]
Message-ID: <cd1506b7-0438-4505-946e-4fc90961d3e3@gmail.com> (raw)
In-Reply-To: <20241213153543.v5.7.Ic61ced3cdfb5d6776435356061f12307da719829@changeid>



On 12/14/24 2:35 AM, Abhishek Pandit-Subedi wrote:
> Add support for entering and exiting Thunderbolt alt-mode using AP
> driven alt-mode.
> 
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> ---
>
(...)

> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index 1bcaa7269395..1ac5798d887f 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -303,18 +303,19 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
>   
>   	/*
>   	 * Register TBT compatibility alt mode. The EC will not enter the mode
> -	 * if it doesn't support it, so it's safe to register it unconditionally
> -	 * here for now.
> +	 * if it doesn't support it and it will not enter automatically by
> +	 * design so we can use the |ap_driven_altmode| feature to check if we
> +	 * should register it.
>   	 */
> -	memset(&desc, 0, sizeof(desc));
> -	desc.svid = USB_TYPEC_TBT_SID;
> -	desc.mode = TYPEC_ANY_MODE;
> -	amode = typec_port_register_altmode(port->port, &desc);
> -	if (IS_ERR(amode))
> -		return PTR_ERR(amode);
> -	port->port_altmode[CROS_EC_ALTMODE_TBT] = amode;
> -	typec_altmode_set_drvdata(amode, port);
> -	amode->ops = &port_amode_ops;

The last usage of port_amode_ops is deleted here. Is this a mistake?
AFAIU from kernel docs, port_amode_ops needed for alternate mode driver 
to send vdm messages to partner. Now, when it's unused, how does 
alternate modes work in this driver?

> +	if (typec->ap_driven_altmode) {
> +		memset(&desc, 0, sizeof(desc));
> +		desc.svid = USB_TYPEC_TBT_SID;
> +		desc.mode = TBT_MODE;
> +		amode = cros_typec_register_thunderbolt(port, &desc);
> +		if (IS_ERR(amode))
> +			return PTR_ERR(amode);
> +		port->port_altmode[CROS_EC_ALTMODE_TBT] = amode;
> +	}
>   
>   	port->state.alt = NULL;
>   	port->state.mode = TYPEC_STATE_USB;

  parent reply	other threads:[~2026-03-02  9:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 23:35 [PATCH v5 0/8] Thunderbolt and DP altmode support for cros-ec-typec Abhishek Pandit-Subedi
2024-12-13 23:35 ` [PATCH v5 1/8] usb: typec: Only use SVID for matching altmodes Abhishek Pandit-Subedi
2024-12-19  1:18   ` Benson Leung
2024-12-19  1:24   ` Benson Leung
2024-12-13 23:35 ` [PATCH v5 2/8] usb: typec: Add driver for Thunderbolt 3 Alternate Mode Abhishek Pandit-Subedi
2024-12-19  1:20   ` Benson Leung
2024-12-13 23:35 ` [PATCH v5 3/8] usb: typec: Make active on port altmode writable Abhishek Pandit-Subedi
2024-12-18  9:47   ` Heikki Krogerus
2024-12-19  1:23   ` Benson Leung
2024-12-13 23:35 ` [PATCH v5 4/8] usb: typec: Print err when displayport fails to enter Abhishek Pandit-Subedi
2024-12-18  9:48   ` Heikki Krogerus
2024-12-19  1:25   ` Benson Leung
2024-12-13 23:35 ` [PATCH v5 5/8] platform/chrome: cros_ec_typec: Update partner altmode active Abhishek Pandit-Subedi
2024-12-19  1:30   ` Benson Leung
2024-12-13 23:35 ` [PATCH v5 6/8] platform/chrome: cros_ec_typec: Displayport support Abhishek Pandit-Subedi
2024-12-18  1:16   ` Stephen Boyd
2024-12-13 23:35 ` [PATCH v5 7/8] platform/chrome: cros_ec_typec: Thunderbolt support Abhishek Pandit-Subedi
2024-12-19  1:31   ` Benson Leung
2026-03-02  9:36   ` Dzmitry Sankouski [this message]
2026-03-02 11:31     ` Andrei Kuchynski
2026-03-03 14:13       ` Dzmitry Sankouski
2024-12-13 23:35 ` [PATCH v5 8/8] platform/chrome: cros_ec_typec: Disable tbt on port Abhishek Pandit-Subedi
2024-12-19  1:32   ` Benson Leung
2024-12-20  4:28 ` [PATCH v5 0/8] Thunderbolt and DP altmode support for cros-ec-typec Tzung-Bi Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd1506b7-0438-4505-946e-4fc90961d3e3@gmail.com \
    --to=dsankouski@gmail.com \
    --cc=abhishekpandit@chromium.org \
    --cc=akuchynski@google.com \
    --cc=badhri@google.com \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=groeck@chromium.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jthies@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pmalani@chromium.org \
    --cc=rdbabiera@google.com \
    --cc=sboyd@kernel.org \
    --cc=tzungbi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox