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

Signed-off-by: Li Jun <jun...@nxp.com>
---
Change for v2:
- Directly enable vbus detect in tcpci_init rather than adding a API.

 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 1db67f0..953fc97 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -345,6 +345,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;
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to