Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Heikki Krogerus and committed by
Greg Kroah-Hartman
aaf3f4e9 82f5d774

+13
+12
drivers/usb/typec/class.c
··· 1330 1330 EXPORT_SYMBOL_GPL(typec_set_orientation); 1331 1331 1332 1332 /** 1333 + * typec_get_orientation - Get USB Type-C cable plug orientation 1334 + * @port: USB Type-C Port 1335 + * 1336 + * Get current cable plug orientation for @port. 1337 + */ 1338 + enum typec_orientation typec_get_orientation(struct typec_port *port) 1339 + { 1340 + return port->orientation; 1341 + } 1342 + EXPORT_SYMBOL_GPL(typec_get_orientation); 1343 + 1344 + /** 1333 1345 * typec_set_mode - Set mode of operation for USB Type-C connector 1334 1346 * @port: USB Type-C port for the connector 1335 1347 * @mode: Operation mode for the connector
+1
include/linux/usb/typec.h
··· 265 265 266 266 int typec_set_orientation(struct typec_port *port, 267 267 enum typec_orientation orientation); 268 + enum typec_orientation typec_get_orientation(struct typec_port *port); 268 269 int typec_set_mode(struct typec_port *port, int mode); 269 270 270 271 int typec_find_port_power_role(const char *name);