public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benson Leung <bleung@google.com>
To: Jameson Thies <jthies@google.com>
Cc: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, dmitry.baryshkov@oss.qualcomm.com,
	bleung@chromium.org, gregkh@linuxfoundation.org,
	akuchynski@chromium.org, abhishekpandit@chromium.org
Subject: Re: [PATCH v1] usb: typec: ucsi: Set usb mode on partner change
Date: Thu, 2 Apr 2026 19:50:36 +0000	[thread overview]
Message-ID: <ac7IjGWy0vE2_gYM@google.com> (raw)
In-Reply-To: <20260402182438.867396-1-jthies@google.com>

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

Hi Jameson,

On Thu, Apr 02, 2026 at 06:24:38PM +0000, Jameson Thies wrote:
> Currently the partner usb_mode is only set in ucsi_register_partner().
> If the partner enters USB4 operation after it is registered, this is not
> reported to the typec class. The UCSI spec states that the Connector
> Partner Changed bit can represent a Connector Partner Flags change. When
> handling a UCSI partner change, check the partner flags for USB4
> operation.
> 
> Signed-off-by: Jameson Thies <jthies@google.com>

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


> ---
>  drivers/usb/typec/ucsi/ucsi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index fe1fb8a68a1d..e6fd2e2eba94 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1182,6 +1182,12 @@ static void ucsi_partner_change(struct ucsi_connector *con)
>  			if (UCSI_CONSTAT(con, PARTNER_FLAG_USB))
>  				typec_set_mode(con->port, TYPEC_STATE_USB);
>  		}
> +
> +		if (((con->ucsi->version >= UCSI_VERSION_3_0 &&
> +		    UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN4)) ||
> +		    (con->ucsi->version >= UCSI_VERSION_2_0 &&
> +		    UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN3))) && con->partner)
> +			typec_partner_set_usb_mode(con->partner, USB_MODE_USB4);
>  	}
>  
>  	if ((!UCSI_CONSTAT(con, PARTNER_FLAG_USB)) &&
> 
> base-commit: 81ebd43cc0d6d106ce7b6ccbf7b5e40ca7f5503d
> -- 
> 2.53.0.1213.gd9a14994de-goog
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-04-02 19:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 18:24 [PATCH v1] usb: typec: ucsi: Set usb mode on partner change Jameson Thies
2026-04-02 19:50 ` Benson Leung [this message]

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=ac7IjGWy0vE2_gYM@google.com \
    --to=bleung@google.com \
    --cc=abhishekpandit@chromium.org \
    --cc=akuchynski@chromium.org \
    --cc=bleung@chromium.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jthies@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.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