usb: typec: tcpm: reset the port on removal
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Tue, 10 Oct 2017 13:40:33 +0000 (16:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Oct 2017 09:56:11 +0000 (11:56 +0200)
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>
drivers/usb/typec/tcpm.c

index 8483d3e..2b735f3 100644 (file)
@@ -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);