MLK-17376 typec: support power source with 2 stages of capability
authorJun Li <jun.li@nxp.com>
Tue, 16 Jan 2018 10:06:52 +0000 (18:06 +0800)
committerJun Li <jun.li@nxp.com>
Tue, 16 Jan 2018 14:46:24 +0000 (22:46 +0800)
Some power delivery source send the source capability by 2 stages:
1st stage send the source capability message with only basic 5V
PDO, after the 5V power session setup, 2nd stage it will send full
source capabilities with all PDOs it can support, in this case, we
should go on to process the following PD source cap to have a new
power session setup.

Signed-off-by: Li Jun <jun.li@nxp.com>
board/freescale/common/tcpc.c

index 2982ded..a674717 100644 (file)
@@ -614,6 +614,7 @@ static void tcpc_pd_sink_process(struct tcpc_port *port)
 
                switch (pd_state) {
                case WAIT_SOURCE_CAP:
+               case SINK_READY:
                        if (msgtype != PD_DATA_SOURCE_CAP)
                                continue;
 
@@ -656,9 +657,8 @@ static void tcpc_pd_sink_process(struct tcpc_port *port)
                                continue;
 
                        if (msgtype == PD_CTRL_PS_RDY) {
-                           tcpc_log(port, "PD source ready! \n");
-                           pd_state = SINK_READY;
-                               return;
+                               tcpc_log(port, "PD source ready!\n");
+                               pd_state = SINK_READY;
                        }
 
                        break;