Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720888

Re: [PATCH 2/6] staging: usb: typec: Check for port type for Try.SRC/Try.SNK

From Guenter Roeck <linux@roeck-us.net>
Newsgroups linux.kernel
Subject Re: [PATCH 2/6] staging: usb: typec: Check for port type for Try.SRC/Try.SNK
Date 2017-08-27 19:30 +0200
Message-ID <uj9xM-2j1-23@gated-at.bofh.it> (permalink)
References <uiYiZ-3gw-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Aug 26, 2017 at 10:24:12PM -0700, Badhri Jagan Sridharan wrote:
> Enable Try.SRC or Try.SNK only when port_type is
> DRP. Try.SRC or Try.SNK state machines are not
> valid for SRC only or SNK only ports.
> 
> Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>

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

> ---
>  drivers/staging/typec/tcpm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c
> index 6c045ac9c42a..1219e3bc13ef 100644
> --- a/drivers/staging/typec/tcpm.c
> +++ b/drivers/staging/typec/tcpm.c
> @@ -328,10 +328,12 @@ struct pd_rx_event {
>  	 (tcpm_cc_is_audio((port)->cc2) && tcpm_cc_is_open((port)->cc1)))
>  
>  #define tcpm_try_snk(port) \
> -	((port)->try_snk_count == 0 && (port)->try_role == TYPEC_SINK)
> +	((port)->try_snk_count == 0 && (port)->try_role == TYPEC_SINK && \
> +	(port)->port_type == TYPEC_PORT_DRP)
>  
>  #define tcpm_try_src(port) \
> -	((port)->try_src_count == 0 && (port)->try_role == TYPEC_SOURCE)
> +	((port)->try_src_count == 0 && (port)->try_role == TYPEC_SOURCE && \
> +	(port)->port_type == TYPEC_PORT_DRP)
>  
>  static enum tcpm_state tcpm_default_state(struct tcpm_port *port)
>  {
> -- 
> 2.14.1.342.g6490525c54-goog
> 

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 2/6] staging: usb: typec: Check for port type for Try.SRC/Try.SNK Badhri Jagan Sridharan <badhri@google.com> - 2017-08-27 07:30 +0200
  Re: [PATCH 2/6] staging: usb: typec: Check for port type for  Try.SRC/Try.SNK Guenter Roeck <linux@roeck-us.net> - 2017-08-27 19:30 +0200

csiph-web