OSDN Git Service

usb: typec: tcpm: handle SRC_STARTUP state if cc changes
authorXu Yang <xu.yang_2@nxp.com>
Tue, 28 Sep 2021 11:16:39 +0000 (19:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Oct 2021 11:47:00 +0000 (13:47 +0200)
commit6d91017a295e9790eec02c4e43f020cdb55f5d98
tree5f733617c5da2599b001123eb0b333fa683be83b
parent05300871c0e21c288bd5c30ac6f9b1da6ddeed22
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>
drivers/usb/typec/tcpm/tcpm.c