From 75d2109382bb56285f63974f6dec7bbc2d388525 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Wed, 9 Jan 2019 12:39:10 +0530 Subject: [PATCH] MLK-16013-32 usb: typec: refine source to sink swap handling To early start sink power after source turn off vbus, move the set power role after vbus is turned off in PR_SWAP_SRC_SNK_SOURCE_OFF, also per spec, we should do error recovery if the sink side does not turn on vbus in PD_T_PS_SOURCE_ON. Reviewed-by: Peter Chen Signed-off-by: Li Jun Signed-off-by: Vipul Kumar --- drivers/usb/typec/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 50d322114732..50a16677574e 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c @@ -3490,7 +3490,7 @@ static void run_state_machine(struct tcpm_port *port) tcpm_set_state(port, ERROR_RECOVERY, 0); break; } - tcpm_set_state_cond(port, SNK_UNATTACHED, PD_T_PS_SOURCE_ON); + tcpm_set_state_cond(port, ERROR_RECOVERY, PD_T_PS_SOURCE_ON); break; case PR_SWAP_SRC_SNK_SINK_ON: tcpm_set_state(port, SNK_STARTUP, 0); -- 2.17.1