Linux USB
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: "Abhishek Pandit-Subedi" <abhishekpandit@chromium.org>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Łukasz Bartosik" <ukaszb@chromium.org>,
	"Benson Leung" <bleung@chromium.org>,
	"Jameson Thies" <jthies@google.com>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH v3 4/4] usb: typec: ucsi: Add support for the partner USB Modes
Date: Fri, 11 Oct 2024 15:11:01 +0200	[thread overview]
Message-ID: <2024101142-pastrami-sedan-7dbd@gregkh> (raw)
In-Reply-To: <20241011124402.3306994-5-heikki.krogerus@linux.intel.com>

On Fri, Oct 11, 2024 at 03:44:02PM +0300, Heikki Krogerus wrote:
> UCSI does not share the contents of the Enter_USB Message
> that was used, so the active mode still has to be always
> determined from the enumerated USB device. However, after
> UCSI v2.0 it is possible to check separately is USB4 the
> active mode.
> 
> So with USB2 and USB3 the mode is always determined from the
> result of the USB enumeration, and when USB4 USB Mode is
> active, UCSI driver can assign the mode directly.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  drivers/usb/typec/ucsi/ucsi.c | 8 ++++++++
>  drivers/usb/typec/ucsi/ucsi.h | 2 ++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 13c739d334c4..804f7f9b35ea 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1057,6 +1057,14 @@ static int ucsi_register_partner(struct ucsi_connector *con)
>  
>  	con->partner = partner;
>  
> +	if (con->ucsi->version >= UCSI_VERSION_3_0)
> +		if (UCSI_CONSTAT_PARTNER_FLAGS(con->status.flags) &
> +		    UCSI_CONSTAT_PARTNER_FLAG_USB4_GEN4)
> +			typec_partner_set_usb_mode(partner, USB_MODE_USB4);
> +	if (con->ucsi->version >= UCSI_VERSION_2_0)
> +		if (UCSI_CONSTAT_PARTNER_FLAGS(con->status.flags) &
> +		    UCSI_CONSTAT_PARTNER_FLAG_USB4_GEN3)
> +			typec_partner_set_usb_mode(partner, USB_MODE_USB4);

Will this cause multiple set mode uevents to go out if both of these are
true?

thanks,

greg k-h

  reply	other threads:[~2024-10-11 13:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11 12:43 [PATCH v3 0/4] usb: typec: USB Modes Heikki Krogerus
2024-10-11 12:43 ` [PATCH v3 1/4] usb: typec: Add attribute file showing the supported USB modes of the port Heikki Krogerus
2024-10-11 13:07   ` Greg Kroah-Hartman
2024-10-11 13:59     ` Heikki Krogerus
2024-10-15  2:38       ` Abhishek Pandit-Subedi
2024-10-15 12:12         ` Heikki Krogerus
2024-10-11 12:44 ` [PATCH v3 2/4] usb: typec: Add attribute file showing the USB Modes of the partner Heikki Krogerus
2024-10-11 13:09   ` Greg Kroah-Hartman
2024-10-11 14:04     ` Heikki Krogerus
2024-10-15  4:07       ` Abhishek Pandit-Subedi
2024-10-15 12:13         ` Heikki Krogerus
2024-10-11 12:44 ` [PATCH v3 3/4] usb: typec: ucsi: Supply the USB capabilities to the ports Heikki Krogerus
2024-10-11 12:44 ` [PATCH v3 4/4] usb: typec: ucsi: Add support for the partner USB Modes Heikki Krogerus
2024-10-11 13:11   ` Greg Kroah-Hartman [this message]
2024-10-11 14:04     ` Heikki Krogerus

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=2024101142-pastrami-sedan-7dbd@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=abhishekpandit@chromium.org \
    --cc=bleung@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jthies@google.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=ukaszb@chromium.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