Blob Blame History Raw
From a6d5d230e0c2dbc710d473105d5652d3980da673 Mon Sep 17 00:00:00 2001
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Date: Tue, 10 Oct 2017 16:40:33 +0300
Subject: [PATCH] usb: typec: tcpm: reset the port on removal
Git-commit: a6d5d230e0c2dbc710d473105d5652d3980da673
Patch-mainline: v4.15
References: FATE#326325

If a port is unregistered, all the devices attached to it
must be unregistered as well. This will also make sure VBUS
and VCONN are disabled.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/usb/typec/tcpm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
index 8483d3e33853..2b735f3e5765 100644
--- a/drivers/usb/typec/tcpm.c
+++ b/drivers/usb/typec/tcpm.c
@@ -3602,6 +3602,7 @@ void tcpm_unregister_port(struct tcpm_port *port)
 {
 	int i;
 
+	tcpm_reset_port(port);
 	for (i = 0; i < ARRAY_SIZE(port->port_altmode); i++)
 		typec_unregister_altmode(port->port_altmode[i]);
 	typec_unregister_port(port->typec_port);
-- 
2.16.4