aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2018-06-27 18:19:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-28 19:52:07 +0900
commitaaf3f4e925dc2bdc4715142103660285632a245c (patch)
tree04c85a7cf31c9c7977edb2c988bc299222318dff /drivers
parentusb: pd: include kernel.h (diff)
downloadlinux-dev-aaf3f4e925dc2bdc4715142103660285632a245c.tar.xz
linux-dev-aaf3f4e925dc2bdc4715142103660285632a245c.zip
usb: typec: function for checking cable plug orientation
This adds function typec_get_orientation() that can be used for checking the current cable plug orientation. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/typec/class.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index 633105917fa6..3ef7b99b080f 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -1330,6 +1330,18 @@ int typec_set_orientation(struct typec_port *port,
EXPORT_SYMBOL_GPL(typec_set_orientation);
/**
+ * typec_get_orientation - Get USB Type-C cable plug orientation
+ * @port: USB Type-C Port
+ *
+ * Get current cable plug orientation for @port.
+ */
+enum typec_orientation typec_get_orientation(struct typec_port *port)
+{
+ return port->orientation;
+}
+EXPORT_SYMBOL_GPL(typec_get_orientation);
+
+/**
* typec_set_mode - Set mode of operation for USB Type-C connector
* @port: USB Type-C port for the connector
* @mode: Operation mode for the connector