MLK-16820-1 staging: typec: tcpm: don't do source debounce if remote keep Rp
authorLi Jun <jun.li@nxp.com>
Wed, 15 Nov 2017 15:52:30 +0000 (23:52 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:55:46 +0000 (15:55 -0500)
While TRY.SRC, if the remote keeps the Rp and we also enable Rp,
there will be a disconnect, this disconnect should be ignored,
then either the remote further enable Rd before timeout to have
a succeed TRY.SRC, or TRY.SRC timeout and start to sink.

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

index 723b80b..1f2fc73 100644 (file)
@@ -2924,7 +2924,8 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1,
                break;
 
        case SRC_TRY:
-               tcpm_set_state(port, SRC_TRY_DEBOUNCE, 0);
+               if (tcpm_port_is_source(port))
+                       tcpm_set_state(port, SRC_TRY_DEBOUNCE, 0);
                break;
        case SRC_TRY_DEBOUNCE:
                tcpm_set_state(port, SRC_TRY, 0);