From 5ab85a9540b925746e987af702e7f991ffeaf4ae Mon Sep 17 00:00:00 2001 From: Li Jun Date: Wed, 9 Jan 2019 12:37:13 +0530 Subject: [PATCH] MLK-16013-31 usb: 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 Signed-off-by: Vipul Kumar --- drivers/usb/typec/tcpm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 50c5073724d3..50d322114732 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c @@ -3390,7 +3390,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 */ -- 2.17.1