aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/port.c
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2021-04-07 09:55:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-09 16:00:00 +0200
commit63cd78617350dae99cc5fbd8f643b83ee819fe33 (patch)
treeb0afcbe2e961cb6099bbc8a8b28c0f803b4cf63a /drivers/usb/core/port.c
parentusb: typec: Port mapping utility (diff)
downloadlinux-dev-63cd78617350dae99cc5fbd8f643b83ee819fe33.tar.xz
linux-dev-63cd78617350dae99cc5fbd8f643b83ee819fe33.zip
usb: Link the ports to the connectors they are attached to
Creating link to the USB Type-C connector for every new port that is added when possible. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20210407065555.88110-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/usb/core/port.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
index dfcca9c876c7..3c382a4b648e 100644
--- a/drivers/usb/core/port.c
+++ b/drivers/usb/core/port.c
@@ -9,6 +9,7 @@
#include <linux/slab.h>
#include <linux/pm_qos.h>
+#include <linux/usb/typec.h>
#include "hub.h"
@@ -576,6 +577,7 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1)
}
find_and_link_peer(hub, port1);
+ typec_link_port(&port_dev->dev);
/*
* Enable runtime pm and hold a refernce that hub_configure()
@@ -619,5 +621,6 @@ void usb_hub_remove_port_device(struct usb_hub *hub, int port1)
peer = port_dev->peer;
if (peer)
unlink_peers(port_dev, peer);
+ typec_unlink_port(&port_dev->dev);
device_unregister(&port_dev->dev);
}