Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: typec: tcpm: handle SRC_STARTUP state if cc changes

TCPM for DRP should do the same action as SRC_ATTACHED when cc changes in
SRC_STARTUP state. Otherwise, TCPM will transition to SRC_UNATTACHED state
which is not satisfied with the Type-C spec.

Per Type-C spec:
DRP port should move to Unattached.SNK instead of Unattached.SRC if sink
removed.

Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
cc: <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://lore.kernel.org/r/20210928111639.3854174-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Xu Yang and committed by
Greg Kroah-Hartman
6d91017a 05300871

+1
+1
drivers/usb/typec/tcpm/tcpm.c
··· 4876 4876 tcpm_set_state(port, SRC_ATTACH_WAIT, 0); 4877 4877 break; 4878 4878 case SRC_ATTACHED: 4879 + case SRC_STARTUP: 4879 4880 case SRC_SEND_CAPABILITIES: 4880 4881 case SRC_READY: 4881 4882 if (tcpm_port_is_disconnected(port) ||