stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Kyle Tso <kyletso@google.com>
Cc: linux@roeck-us.net, gregkh@linuxfoundation.org,
	badhri@google.com, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v1] usb: typec: tcpm: Update PD of Type-C port upon pd_set
Date: Tue, 12 Mar 2024 12:25:47 +0200	[thread overview]
Message-ID: <ZfAtq5TS5Ykqscej@kuha.fi.intel.com> (raw)
In-Reply-To: <20240311172306.3911309-1-kyletso@google.com>

On Tue, Mar 12, 2024 at 01:23:06AM +0800, Kyle Tso wrote:
> The PD of Type-C port needs to be updated in pd_set. Unlink the Type-C
> port device to the old PD before linking it to a new one.
> 
> Fixes: cd099cde4ed2 ("usb: typec: tcpm: Support multiple capabilities")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kyle Tso <kyletso@google.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 3d505614bff1..896f594b9328 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -6907,7 +6907,9 @@ static int tcpm_pd_set(struct typec_port *p, struct usb_power_delivery *pd)
>  
>  	port->port_source_caps = data->source_cap;
>  	port->port_sink_caps = data->sink_cap;
> +	typec_port_set_usb_power_delivery(p, NULL);
>  	port->selected_pd = pd;
> +	typec_port_set_usb_power_delivery(p, port->selected_pd);
>  unlock:
>  	mutex_unlock(&port->lock);
>  	return ret;
> -- 
> 2.44.0.278.ge034bb2e1d-goog

-- 
heikki

      reply	other threads:[~2024-03-12 10:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 17:23 [PATCH v1] usb: typec: tcpm: Update PD of Type-C port upon pd_set Kyle Tso
2024-03-12 10:25 ` Heikki Krogerus [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=ZfAtq5TS5Ykqscej@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kyletso@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).