MLK-16013-34 staging: typec: Support cc changes on RP pull-up value
authorLi Jun <jun.li@nxp.com>
Fri, 28 Jul 2017 09:43:01 +0000 (17:43 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:36:21 +0000 (15:36 -0500)
CC line changes on souce side RP value is permitted per standard, in
this case we should move to SNK_ATTACH_WAIT.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
drivers/staging/typec/tcpm.c

index f14aae3..3a70f70 100644 (file)
@@ -2857,6 +2857,9 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1,
                        new_state = SNK_UNATTACHED;
                else if (port->vbus_present)
                        new_state = tcpm_try_src(port) ? SRC_TRY : SNK_ATTACHED;
+               else if (cc1 > TYPEC_CC_RP_DEF || cc2 > TYPEC_CC_RP_DEF)
+                       /* CC changes on pull-up value */
+                       new_state = SNK_ATTACH_WAIT;
                else
                        new_state = SNK_UNATTACHED;
                if (new_state != port->delayed_state)