MLK-16013-34 usb: typec: Support cc changes on RP pull-up value
authorLi Jun <jun.li@nxp.com>
Wed, 9 Jan 2019 07:14:21 +0000 (12:44 +0530)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
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>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
drivers/usb/typec/tcpm.c

index 8f60ae0..441af40 100644 (file)
@@ -3723,6 +3723,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)