diff options
author | Denis Brockus <dbrockus@chromium.org> | 2020-02-19 09:39:17 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-20 01:51:09 +0000 |
commit | 3b2b7b26d3c033d4a75d67b081dbd4d6a3d3c74e (patch) | |
tree | c0c8edc5de75a459093e33a47710bd755ecb3326 /include | |
parent | 3651aea50eed4c24e8cdedcee54f3822c2f0b229 (diff) | |
download | chrome-ec-3b2b7b26d3c033d4a75d67b081dbd4d6a3d3c74e.tar.gz |
nct3807: potential connection cleanup
I changed TCPMv2 to call tcpm_set_new_connection
instead of tcpm_set_cc when connecting at the
parent state for a new connection type. This
allows the NCT3807 to clear out DRP and set the
correct connection instead of clobbering what
the hardware determined to be correct and setting
it to an open listen.
BUG=b:149593609
BRANCH=none
TEST=verify USB-C
Change-Id: I7402d3417a14fdc4158636e4716ef7fbdf4fa4a3
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2064184
Commit-Queue: Edward Hill <ecgh@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_pd_tcpm.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index 527388d73e..4589fc4839 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -319,29 +319,32 @@ struct tcpm_drv { void (*tcpc_enable_auto_discharge_disconnect)(int port, int enable); -#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE /** - * Enable TCPC auto DRP toggling. + * Set new connection + * There is a new connection. May have to handle differently + * if we were performing auto-toggle. Allow a driver to do + * any work required to leave the unattached auto-toggle mode + * as well as setting the CC lines. If auto-toggle is not + * being used or was not the cause of the new connection + * detection then set both CC lines to the passed pull. * * @param port Type-C port number + * @param pull enum tcpc_cc_pull of CC lines * * @return EC_SUCCESS or error */ - int (*drp_toggle)(int port); + int (*set_new_connection)(int port, + enum tcpc_cc_pull pull); +#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE /** - * Auto Toggle Connection - * There is a connection while performing auto-toggle. - * Allow a driver to do any work required to leave the - * unattached auto-toggle mode + * Enable TCPC auto DRP toggling. * * @param port Type-C port number - * @param cc1 enum tcpc_cc_pull of CC1 - * @param cc2 enum tcpc_cc_pull of CC2 + * + * @return EC_SUCCESS or error */ - void (*drp_toggle_connection)(int port, - enum tcpc_cc_voltage_status cc1, - enum tcpc_cc_voltage_status cc2); + int (*drp_toggle)(int port); #endif /** |