From: Li Jun Date: Fri, 28 Jul 2017 09:19:13 +0000 (+0800) Subject: MLK-16013-31 staging: typec: Set to unattached state if souce disconnected X-Git-Tag: C0P2-H0.0--20200415~1902 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=61871e3b8610e11d403e2f0fedcf39855809322c;p=linux.git MLK-16013-31 staging: typec: Set to unattached state if souce disconnected In SNK_HARD_RESET_SINK_ON, if the source disconnected, we should set state to be unattached state intead of startup sink. Reviewed-by: Peter Chen Signed-off-by: Li Jun --- diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c index b2480d8b8d6b..59f891d863d2 100644 --- a/drivers/staging/typec/tcpm.c +++ b/drivers/staging/typec/tcpm.c @@ -2571,7 +2571,10 @@ static void run_state_machine(struct tcpm_port *port) * to PE_SNK_Transition_to_default. */ tcpm_set_attached_state(port, true); - tcpm_set_state(port, SNK_STARTUP, 0); + if (tcpm_port_is_disconnected(port)) + tcpm_set_state(port, unattached_state(port), 0); + else + tcpm_set_state(port, SNK_STARTUP, 0); break; /* Soft_Reset states */