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>
This commit is contained in:
parent
9b0ae69909
commit
ff6c8cb172
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue