Skip to content

Commit

Permalink
usb: typec: function for checking cable plug orientation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heikki Krogerus authored and Greg Kroah-Hartman committed Jun 28, 2018
1 parent 82f5d77 commit aaf3f4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/usb/typec/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,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
Expand Down
1 change: 1 addition & 0 deletions include/linux/usb/typec.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ void typec_set_pwr_opmode(struct typec_port *port, enum typec_pwr_opmode mode);

int typec_set_orientation(struct typec_port *port,
enum typec_orientation orientation);
enum typec_orientation typec_get_orientation(struct typec_port *port);
int typec_set_mode(struct typec_port *port, int mode);

int typec_find_port_power_role(const char *name);
Expand Down

0 comments on commit aaf3f4e

Please sign in to comment.