linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v6,10/15] staging: typec: tcpci: enable vbus detection
@ 2018-05-28  2:52 Jun Li
  0 siblings, 0 replies; 2+ messages in thread
From: Jun Li @ 2018-05-28  2:52 UTC (permalink / raw)
  To: robh+dt, gregkh, heikki.krogerus, linux
  Cc: cw00.choi, a.hajda, shufan_lee, peter.chen, garsilva, gsomlo,
	jun.li, linux-usb, devicetree, linux-imx

TCPCI implementation may need SW to enable VBUS detection to generate
power status events.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Li Jun <jun.li@nxp.com>
---
 drivers/staging/typec/tcpci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index 3b35fce..4d3b0ae 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -373,6 +373,12 @@ static int tcpci_init(struct tcpc_dev *tcpc)
 	if (ret < 0)
 		return ret;
 
+	/* Enable Vbus detection */
+	ret = regmap_write(tcpci->regmap, TCPC_COMMAND,
+			   TCPC_CMD_ENABLE_VBUS_DETECT);
+	if (ret < 0)
+		return ret;
+
 	reg = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_FAILED |
 		TCPC_ALERT_TX_DISCARDED | TCPC_ALERT_RX_STATUS |
 		TCPC_ALERT_RX_HARD_RST | TCPC_ALERT_CC_STATUS;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [v6,10/15] staging: typec: tcpci: enable vbus detection
@ 2018-06-11 12:36 Heikki Krogerus
  0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2018-06-11 12:36 UTC (permalink / raw)
  To: Li Jun
  Cc: robh+dt, gregkh, linux, cw00.choi, a.hajda, shufan_lee,
	peter.chen, garsilva, gsomlo, linux-usb, devicetree, linux-imx

On Mon, May 28, 2018 at 10:52:42AM +0800, Li Jun wrote:
> TCPCI implementation may need SW to enable VBUS detection to generate
> power status events.
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Li Jun <jun.li@nxp.com>

FWIW:

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

> ---
>  drivers/staging/typec/tcpci.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
> index 3b35fce..4d3b0ae 100644
> --- a/drivers/staging/typec/tcpci.c
> +++ b/drivers/staging/typec/tcpci.c
> @@ -373,6 +373,12 @@ static int tcpci_init(struct tcpc_dev *tcpc)
>  	if (ret < 0)
>  		return ret;
>  
> +	/* Enable Vbus detection */
> +	ret = regmap_write(tcpci->regmap, TCPC_COMMAND,
> +			   TCPC_CMD_ENABLE_VBUS_DETECT);
> +	if (ret < 0)
> +		return ret;
> +
>  	reg = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_FAILED |
>  		TCPC_ALERT_TX_DISCARDED | TCPC_ALERT_RX_STATUS |
>  		TCPC_ALERT_RX_HARD_RST | TCPC_ALERT_CC_STATUS;

Thanks,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-11 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-28  2:52 [v6,10/15] staging: typec: tcpci: enable vbus detection Jun Li
  -- strict thread matches above, loose matches on Subject: below --
2018-06-11 12:36 Heikki Krogerus

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).