All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Hans de Goede <hdegoede@redhat.com>, Jun Li <jun.li@nxp.com>,
	Mats Karrman <mats.dev.list@gmail.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/8] usb: typec: function for checking cable plug orientation
Date: Mon, 9 Jul 2018 11:59:08 -0700	[thread overview]
Message-ID: <20180709185908.GB1896@roeck-us.net> (raw)
In-Reply-To: <20180627151953.30942-3-heikki.krogerus@linux.intel.com>

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
> 

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Hans de Goede <hdegoede@redhat.com>, Jun Li <jun.li@nxp.com>,
	Mats Karrman <mats.dev.list@gmail.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [2/8] usb: typec: function for checking cable plug orientation
Date: Mon, 9 Jul 2018 11:59:08 -0700	[thread overview]
Message-ID: <20180709185908.GB1896@roeck-us.net> (raw)

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
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-07-09 18:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27 15:19 [PATCH 0/8] usb: typec: Support for Alternate Modes Heikki Krogerus
2018-06-27 15:19 ` [PATCH 1/8] usb: pd: include kernel.h Heikki Krogerus
2018-06-27 15:19   ` [1/8] " Heikki Krogerus
2018-07-09 18:58   ` [PATCH 1/8] " Guenter Roeck
2018-07-09 18:58     ` [1/8] " Guenter Roeck
2018-06-27 15:19 ` [PATCH 2/8] usb: typec: function for checking cable plug orientation Heikki Krogerus
2018-06-27 15:19   ` [2/8] " Heikki Krogerus
2018-07-09 18:59   ` Guenter Roeck [this message]
2018-07-09 18:59     ` Guenter Roeck
2018-06-27 15:19 ` [PATCH 3/8] usb: typec: mux: Get the mux identifier from function parameter Heikki Krogerus
2018-06-27 15:19   ` [3/8] " Heikki Krogerus
2018-06-28 10:51   ` [PATCH 3/8] " Greg Kroah-Hartman
2018-06-28 10:51     ` [3/8] " Greg Kroah-Hartman
2018-06-28 11:34     ` [PATCH 3/8] " Heikki Krogerus
2018-06-28 11:34       ` [3/8] " Heikki Krogerus
2018-07-09 19:03       ` [PATCH 3/8] " Guenter Roeck
2018-07-09 19:03         ` [3/8] " Guenter Roeck
2018-07-20 10:53         ` [PATCH 3/8] " Heikki Krogerus
2018-07-20 10:53           ` [3/8] " Heikki Krogerus
2018-06-27 15:19 ` [PATCH 4/8] usb: typec: Register a device for every mode Heikki Krogerus
2018-06-27 15:19   ` [4/8] " Heikki Krogerus
2018-06-27 15:19 ` [PATCH 5/8] usb: typec: Bus type for alternate modes Heikki Krogerus
2018-06-27 15:19   ` [5/8] " Heikki Krogerus
2018-06-27 15:19 ` [PATCH 6/8] usb: typec: Add driver for DisplayPort alternate mode Heikki Krogerus
2018-06-27 15:19   ` [6/8] " Heikki Krogerus
2018-06-27 15:19 ` [PATCH 7/8] usb: typec: pi3usb30532: Start using generic state values Heikki Krogerus
2018-06-27 15:19   ` [7/8] " Heikki Krogerus
2018-06-27 15:19 ` [PATCH 8/8] usb: typec: tcpm: Support for Alternate Modes Heikki Krogerus
2018-06-27 15:19   ` [8/8] " Heikki Krogerus
2018-06-29 14:21 ` [PATCH 0/8] usb: typec: " Heikki Krogerus
2018-07-01 12:08 ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180709185908.GB1896@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jun.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mats.dev.list@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.