diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2016-12-14 15:08:51 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-12-20 21:56:45 -0800 |
commit | d00a15a78d1fa82c81798081d960fd0bcd5eca33 (patch) | |
tree | 11aeffc6d0855d1a2f313037cc944ddd3981fd3f /common | |
parent | 9cc53cb892ca53f600235241b3f0ddcdeea09da6 (diff) | |
download | chrome-ec-d00a15a78d1fa82c81798081d960fd0bcd5eca33.tar.gz |
tcpm: anx74xx: Remove auto-toggle support
Auto-role toggle on the anx74xx does not function correctly with
e-marked cables and cannot be used.
Also check for TCPC support for auto-toggle at runtime, to allow
auto-toggle supported TCPC to be used alongside an unsupported part.
(from CL:420405)
BUG=chrome-os-partner:60890
BRANCH=reef
TEST=Manual on reef, boot to S0:
`pd 0 state`: Toggling between SRC_DISCONNECTED / SNK_DISCONNECTED
`pd 1 state`: DRP_AUTO_TOGGLE
Also verify port 0 can become sink + source correctly in S0.
Change-Id: Iafdedf31773feef23923cefe1f4fb02fcffda120
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/420866
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_pd_protocol.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index dd84d80cc8..4f27ff4477 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1575,6 +1575,9 @@ void pd_task(void) #ifndef CONFIG_USB_PD_VBUS_DETECT_NONE int snk_hard_reset_vbus_off = 0; #endif +#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE + const int auto_toggle_supported = tcpm_auto_toggle_supported(port); +#endif #ifdef CONFIG_CHARGE_MANAGER int typec_curr = 0, typec_curr_change = 0; #endif /* CONFIG_CHARGE_MANAGER */ @@ -1729,7 +1732,8 @@ void pd_task(void) * Attempt TCPC auto DRP toggle if it is * not already auto toggling and not try.src */ - if (!(pd[port].flags & PD_FLAGS_TCPC_DRP_TOGGLE) && + if (auto_toggle_supported && + !(pd[port].flags & PD_FLAGS_TCPC_DRP_TOGGLE) && !(pd[port].flags & PD_FLAGS_TRY_SRC) && (cc1 == TYPEC_CC_VOLT_OPEN && cc2 == TYPEC_CC_VOLT_OPEN)) { @@ -2208,7 +2212,8 @@ void pd_task(void) * Attempt TCPC auto DRP toggle if it is * not already auto toggling and not try.src */ - if (!(pd[port].flags & PD_FLAGS_TCPC_DRP_TOGGLE) && + if (auto_toggle_supported && + !(pd[port].flags & PD_FLAGS_TCPC_DRP_TOGGLE) && !(pd[port].flags & PD_FLAGS_TRY_SRC) && (cc1 == TYPEC_CC_VOLT_OPEN && cc2 == TYPEC_CC_VOLT_OPEN)) { @@ -2817,6 +2822,8 @@ defined(CONFIG_CASE_CLOSED_DEBUG_EXTERNAL) { enum pd_states next_state; + assert(auto_toggle_supported); + /* Check for connection */ tcpm_get_cc(port, &cc1, &cc2); |