lkml.org 
[lkml]   [2018]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] usb: typec: function for checking cable plug orientation
On Wed, Jun 27, 2018 at 06:19:47PM +0300, Heikki Krogerus wrote:
> 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>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> drivers/usb/typec/class.c | 12 ++++++++++++
> include/linux/usb/typec.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
> index 53df10df2f9d..2b3eaa969f3b 100644
> --- a/drivers/usb/typec/class.c
> +++ b/drivers/usb/typec/class.c
> @@ -1279,6 +1279,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
> diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
> index 672b39bb0adc..a5f6433e218b 100644
> --- a/include/linux/usb/typec.h
> +++ b/include/linux/usb/typec.h
> @@ -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);
>
> #endif /* __LINUX_USB_TYPEC_H */
> --
> 2.18.0
>

\
 
 \ /
  Last update: 2018-07-09 21:00    [W:0.180 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site