diff options
author | Badhri Jagan Sridharan <badhri@google.com> | 2017-08-28 10:23:13 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-29 08:21:10 +0200 |
commit | ff6c8cb172269cb9102a1f247d093ae628f3f23b (patch) | |
tree | bbcf4f16f0b33182219e4a91ee58cb969df43527 /drivers/staging/typec/tcpm.c | |
parent | 9b0ae69909c2813e61f5c747a1508497ce35d71b (diff) | |
download | linux-stable-ff6c8cb172269cb9102a1f247d093ae628f3f23b.tar.gz linux-stable-ff6c8cb172269cb9102a1f247d093ae628f3f23b.tar.bz2 linux-stable-ff6c8cb172269cb9102a1f247d093ae628f3f23b.zip |
staging: typec: tcpm: Check for port type for Try.SRC/Try.SNK
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/typec/tcpm.c')
-rw-r--r-- | drivers/staging/typec/tcpm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c index 7c9b1485818b..81b052384cd5 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) { |