Commit ff6c8cb1 authored by Badhri Jagan Sridharan's avatar Badhri Jagan Sridharan Committed by Greg Kroah-Hartman

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: default avatarBadhri Jagan Sridharan <Badhri@google.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9b0ae699
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment