mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Sven Peter <sven@svenpeter.dev>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	asahi@lists.linux.dev
Subject: Re: [PATCH] usb: typec: tipd: Set mode of operation for USB Type-C connector
Date: Wed, 30 Nov 2022 17:36:39 +0200	[thread overview]
Message-ID: <Y4d4h6N6EyOozkYS@kuha.fi.intel.com> (raw)
In-Reply-To: <20221128162304.80125-1-sven@svenpeter.dev>

On Mon, Nov 28, 2022 at 05:23:04PM +0100, Sven Peter wrote:
> Forward the mode of operation to the typec subsystem such that it can
> configure the mux correctly.
> 
> Signed-off-by: Sven Peter <sven@svenpeter.dev>

Looks OK to me.

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

> ---
>  drivers/usb/typec/tipd/core.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> index 982bd2cad931..46a4d8b128f0 100644
> --- a/drivers/usb/typec/tipd/core.c
> +++ b/drivers/usb/typec/tipd/core.c
> @@ -14,6 +14,7 @@
>  #include <linux/regmap.h>
>  #include <linux/interrupt.h>
>  #include <linux/usb/typec.h>
> +#include <linux/usb/typec_altmode.h>
>  #include <linux/usb/role.h>
>  
>  #include "tps6598x.h"
> @@ -257,6 +258,7 @@ static int tps6598x_connect(struct tps6598x *tps, u32 status)
>  		typec_set_orientation(tps->port, TYPEC_ORIENTATION_REVERSE);
>  	else
>  		typec_set_orientation(tps->port, TYPEC_ORIENTATION_NORMAL);
> +	typec_set_mode(tps->port, TYPEC_STATE_USB);
>  	tps6598x_set_data_role(tps, TPS_STATUS_TO_TYPEC_DATAROLE(status), true);
>  
>  	tps->partner = typec_register_partner(tps->port, &desc);
> @@ -280,6 +282,7 @@ static void tps6598x_disconnect(struct tps6598x *tps, u32 status)
>  	typec_set_pwr_role(tps->port, TPS_STATUS_TO_TYPEC_PORTROLE(status));
>  	typec_set_vconn_role(tps->port, TPS_STATUS_TO_TYPEC_VCONN(status));
>  	typec_set_orientation(tps->port, TYPEC_ORIENTATION_NONE);
> +	typec_set_mode(tps->port, TYPEC_STATE_SAFE);
>  	tps6598x_set_data_role(tps, TPS_STATUS_TO_TYPEC_DATAROLE(status), false);
>  
>  	power_supply_changed(tps->psy);

thanks,

-- 
heikki

      reply	other threads:[~2022-11-30 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 16:23 Sven Peter
2022-11-30 15:36 ` 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=Y4d4h6N6EyOozkYS@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=asahi@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sven@svenpeter.dev \
    /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

all inboxes | Powered by JetHome®