From f4602ec472c5477b1dd1e8963f6d36bd735ebba8 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Tue, 23 Jan 2018 15:35:41 -0700 Subject: usbc: Moving PPC init after setting TCPC resistors. We don't want the PPC to connect the CC lines from the TCPC to the USB connector until the TCPC resistors are set in a valid state (SINK initially). If we connect the CC lines (happens in the ppc_init) before setting the resistor values, some TCPC will be toggling the CC line between Rp/Rd since it doesn't detect a cable yet. In the dead battery charging case, connecting the toggling CC lines to the charger can rail the CC lines to 3.3 V signaling to the charger to disconnect Vbus, thus browning out the board. BRANCH=none BUG=b:71865251 TEST=Grunt powers on via usbc p0 with and without USB hub. Change-Id: I8e78aa2af42075398fab89a2dccef5e7df27b260 Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/882305 Reviewed-by: Aseda Aboagye Reviewed-by: Edward Hill --- include/usbc_ppc.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/usbc_ppc.h') diff --git a/include/usbc_ppc.h b/include/usbc_ppc.h index 9fc8e61f91..c005540e99 100644 --- a/include/usbc_ppc.h +++ b/include/usbc_ppc.h @@ -95,6 +95,14 @@ struct ppc_config_t { extern const struct ppc_config_t ppc_chips[]; extern const unsigned int ppc_cnt; +/** + * Initializes the PPC for the specified port. + * + * @param port: The Type-C port number. + * @return EC_SUCCESS on success, error otherwise. + */ +int ppc_init(int port); + /** * Determine if VBUS is present or not. * -- cgit v1.2.1