linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Badhri Jagan Sridharan <badhri@google.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kyle Tso <kyletso@google.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] usb: typec: tcpci: Add Callback to Usb Communication capable partner
Date: Tue, 2 Feb 2021 08:25:22 -0800	[thread overview]
Message-ID: <20210202162522.GB159455@roeck-us.net> (raw)
In-Reply-To: <20210202003101.221145-2-badhri@google.com>

On Mon, Feb 01, 2021 at 04:31:00PM -0800, Badhri Jagan Sridharan wrote:
> The USB Communications Capable bit indicates if port
> partner is capable of communication over the USB data lines
> (e.g. D+/- or SS Tx/Rx). TCPM passes this information for chip specific
> operations.
> 
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/usb/typec/tcpm/tcpci.c | 9 +++++++++
>  drivers/usb/typec/tcpm/tcpci.h | 6 ++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index f676abab044b..a27deb0b5f03 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -255,6 +255,14 @@ static int tcpci_set_polarity(struct tcpc_dev *tcpc,
>  			   TCPC_TCPC_CTRL_ORIENTATION : 0);
>  }
>  
> +static void tcpci_set_partner_usb_comm_capable(struct tcpc_dev *tcpc, bool capable)
> +{
> +	struct tcpci *tcpci = tcpc_to_tcpci(tcpc);
> +
> +	if (tcpci->data->set_partner_usb_comm_capable)
> +		tcpci->data->set_partner_usb_comm_capable(tcpci, tcpci->data, capable);
> +}
> +
>  static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable)
>  {
>  	struct tcpci *tcpci = tcpc_to_tcpci(tcpc);
> @@ -720,6 +728,7 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data)
>  	tcpci->tcpc.set_bist_data = tcpci_set_bist_data;
>  	tcpci->tcpc.enable_frs = tcpci_enable_frs;
>  	tcpci->tcpc.frs_sourcing_vbus = tcpci_frs_sourcing_vbus;
> +	tcpci->tcpc.set_partner_usb_comm_capable = tcpci_set_partner_usb_comm_capable;
>  
>  	if (tcpci->data->auto_discharge_disconnect) {
>  		tcpci->tcpc.enable_auto_vbus_discharge = tcpci_enable_auto_vbus_discharge;
> diff --git a/drivers/usb/typec/tcpm/tcpci.h b/drivers/usb/typec/tcpm/tcpci.h
> index c3c7d07d9b4e..57b6e24e0a0c 100644
> --- a/drivers/usb/typec/tcpm/tcpci.h
> +++ b/drivers/usb/typec/tcpm/tcpci.h
> @@ -161,6 +161,10 @@ struct tcpci;
>   *		Optional; Enables TCPC to autonously discharge vbus on disconnect.
>   * @vbus_vsafe0v:
>   *		optional; Set when TCPC can detect whether vbus is at VSAFE0V.
> + * @set_partner_usb_comm_capable:
> + *		Optional; The USB Communications Capable bit indicates if port
> + *		partner is capable of communication over the USB data lines
> + *		(e.g. D+/- or SS Tx/Rx). Called to notify the status of the bit.
>   */
>  struct tcpci_data {
>  	struct regmap *regmap;
> @@ -175,6 +179,8 @@ struct tcpci_data {
>  				  enum typec_cc_status cc);
>  	int (*set_vbus)(struct tcpci *tcpci, struct tcpci_data *data, bool source, bool sink);
>  	void (*frs_sourcing_vbus)(struct tcpci *tcpci, struct tcpci_data *data);
> +	void (*set_partner_usb_comm_capable)(struct tcpci *tcpci, struct tcpci_data *data,
> +					     bool capable);
>  };
>  
>  struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data);
> -- 
> 2.30.0.365.g02bc693789-goog
> 

  parent reply	other threads:[~2021-02-02 16:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  0:30 [PATCH v2 1/3] usb: typec: tcpm: Add Callback to Usb Communication capable partner Badhri Jagan Sridharan
2021-02-02  0:31 ` [PATCH v2 2/3] usb: typec: tcpci: " Badhri Jagan Sridharan
2021-02-02  8:49   ` Heikki Krogerus
2021-02-02 16:25   ` Guenter Roeck [this message]
2021-02-02  0:31 ` [PATCH v2 3/3] usb: typec: tcpci_maxim: Enable data path when partner is USB Comm capable Badhri Jagan Sridharan
2021-02-02  8:52   ` Heikki Krogerus
2021-02-02 16:25   ` Guenter Roeck
2021-02-02  4:34 ` [PATCH v2 1/3] usb: typec: tcpm: Add Callback to Usb Communication capable partner Badhri Jagan Sridharan
2021-02-02  8:37 ` Heikki Krogerus
2021-02-02 16:25 ` Guenter Roeck

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=20210202162522.GB159455@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kyletso@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;
as well as URLs for NNTP newsgroup(s).