summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2021-04-07 08:55:52 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-09 16:00:00 +0200
commitae196ddb0d3186bc08e529b8ea4bf62161ddfce2 (patch)
tree874f3934376726b9207c5510e8223fd106c4ea15 /include
parentusb: typec: tcpm: update power supply once partner accepts (diff)
downloadlinux-ae196ddb0d3186bc08e529b8ea4bf62161ddfce2.tar.xz
linux-ae196ddb0d3186bc08e529b8ea4bf62161ddfce2.zip
usb: typec: Port mapping utility
Adding functions that can be used to link/unlink ports - USB ports, TBT3/USB4 ports, DisplayPorts and so on - to the USB Type-C connectors they are attached to inside a system. The symlink that is created for the port device is named "connector". Initially only ACPI is supported. ACPI port object shares the _PLD (Physical Location of Device) with the USB Type-C connector that it's attached to. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20210407065555.88110-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/typec.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
index 91b4303ca305..e2714722b0c9 100644
--- a/include/linux/usb/typec.h
+++ b/include/linux/usb/typec.h
@@ -298,4 +298,17 @@ int typec_find_port_data_role(const char *name);
void typec_partner_set_svdm_version(struct typec_partner *partner,
enum usb_pd_svdm_ver svdm_version);
int typec_get_negotiated_svdm_version(struct typec_port *port);
+
+#if IS_REACHABLE(CONFIG_TYPEC)
+int typec_link_port(struct device *port);
+void typec_unlink_port(struct device *port);
+#else
+static inline int typec_link_port(struct device *port)
+{
+ return 0;
+}
+
+static inline void typec_unlink_port(struct device *port) { }
+#endif
+
#endif /* __LINUX_USB_TYPEC_H */