From 486f91d4b826c4f9654379d68eeeafc3435b26cd Mon Sep 17 00:00:00 2001 From: Li Jun Date: Thu, 27 Jul 2017 01:08:27 +0800 Subject: [PATCH] MLK-16013-16: staging: typec: tcpm: tcpm init sequence update Force an error recovery is not a good way to handle all cases and may break the case of power up with typec already connected. Also the tcpc init should start after tcpm init setup is done, as tcpc init will turn on HW event alert so may generate events immediately and drive tcpm state machine go forward, so move it at the end of tcpm_init. Reviewed-by: Peter Chen Signed-off-by: Li Jun --- drivers/staging/typec/tcpm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c index dc2f09ec42a4..1dde877d6a41 100644 --- a/drivers/staging/typec/tcpm.c +++ b/drivers/staging/typec/tcpm.c @@ -3272,8 +3272,6 @@ static void tcpm_init(struct tcpm_port *port) { enum typec_cc_status cc1, cc2; - port->tcpc->init(port->tcpc); - tcpm_reset_port(port); /* @@ -3294,7 +3292,9 @@ static void tcpm_init(struct tcpm_port *port) * Some adapters need a clean slate at startup, and won't recover * otherwise. So do not try to be fancy and force a clean disconnect. */ - tcpm_set_state(port, ERROR_RECOVERY, 0); + /*tcpm_set_state(port, ERROR_RECOVERY, 0);*/ + + port->tcpc->init(port->tcpc); } void tcpm_tcpc_reset(struct tcpm_port *port) -- 2.17.1