Skip to content

Commit

Permalink
usb: typec: tcpm: move to SNK_UNATTACHED if sink removed for DRP
Browse files Browse the repository at this point in the history
Per typec spec:
Figure 4-15 Connection State Diagram: DRP
Figure 4-16 Connection State Diagram: DRP with Accessory and Try.SRC
	    Support
Figure 4-17 Connection State Diagram: DRP with Accessory and Try.SNK
	    Support
DRP port should move to Unattached.SNK instead of Unattached.SRC if
sink removed.

Signed-off-by: Li Jun <jun.li@nxp.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/1582128343-22438-1-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Li Jun authored and Greg Kroah-Hartman committed Mar 4, 2020
1 parent 9cb9322 commit 6754046
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/usb/typec/tcpm/tcpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3680,8 +3680,12 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1,
case SRC_SEND_CAPABILITIES:
case SRC_READY:
if (tcpm_port_is_disconnected(port) ||
!tcpm_port_is_source(port))
tcpm_set_state(port, SRC_UNATTACHED, 0);
!tcpm_port_is_source(port)) {
if (port->port_type == TYPEC_PORT_SRC)
tcpm_set_state(port, SRC_UNATTACHED, 0);
else
tcpm_set_state(port, SNK_UNATTACHED, 0);
}
break;
case SNK_UNATTACHED:
if (tcpm_port_is_sink(port))
Expand Down

0 comments on commit 6754046

Please sign in to comment.