Skip to contentSkip to conversation

staging: typec: tcpci: enable vbus detection

PATCH Superseded Jun Li 1 participant 1 message Mar 13, 2018

Subsystems (2)

v3 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Jun Li

author
#0 lore raw

PATCH v3 8/12 staging: typec: tcpci: enable vbus detection

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

---
 drivers/staging/typec/tcpci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/staging/typec/tcpci.c +6 -0
index f5a3bf5..9a230c6 100644
@@ -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;