]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Wed, 13 Oct 2021 08:08:16 +0000 (10:08 +0200)
commit2159446417face1f851995e4df62f0f8f791e90d
treee97ccdba4952c00dcc6e6682fcab74b3153ef87d
parent0c534dc76e096ce72aa4174a856233c873e31a0e
usb: typec: tcpm: handle SRC_STARTUP state if cc changes

commit 6d91017a295e9790eec02c4e43f020cdb55f5d98 upstream.

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: 335656067cd4 ("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.1e8cf50-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c