From dae56a931a44b3542b83ec672be02563f3bff3d1 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Fri, 28 Jul 2017 18:01:06 +0800 Subject: [PATCH] MLK-16013-35 staging: typec: Move to SRC_ATTACHED if condition is met If the other end is trying to be a sink and not driving vbus, we should move to SRC_ATTACHED directly. Reviewed-by: Peter Chen Signed-off-by: Li Jun --- drivers/staging/typec/tcpm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c index 3a70f70a43f2..aa2206fe4577 100644 --- a/drivers/staging/typec/tcpm.c +++ b/drivers/staging/typec/tcpm.c @@ -2904,11 +2904,8 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1, case SRC_TRYWAIT: /* Hand over to state machine if needed */ if (!port->vbus_present && tcpm_port_is_source(port)) - new_state = SRC_ATTACHED; - else - new_state = SRC_TRYWAIT_UNATTACHED; - - if (new_state != port->delayed_state) + tcpm_set_state(port, SRC_ATTACHED, 0); + else if (port->delayed_state != SRC_TRYWAIT_UNATTACHED) tcpm_set_state(port, SRC_TRYWAIT, 0); break; case SNK_TRY_WAIT: -- 2.17.1