summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2019-12-20 15:54:10 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-23 01:02:40 +0000
commitb71046c818aee78f1d2d90201dd221c7c1fab726 (patch)
tree0ed4820b2c529c0cd7c2720e7bf816920c84c925
parent961eec44d8d92398cd8ff592f46c7bf59f5c0505 (diff)
downloadchrome-ec-b71046c818aee78f1d2d90201dd221c7c1fab726.tar.gz
Trogdor: Implement board_set_tcpc_power_mode
The board_set_tcpc_power_mode() function hasn't been defined. When doing TCPC software sync, AP to ask EC to suspend the TCPC chip, and then resume it when done. Missing the board_set_tcpc_power_mode() function made the TCPC chip can't resume back. BRANCH=None BUG=b:146652805 TEST=Executed the TCPC software sync, verified the TCPC is back, i.e. 2019-12-20 15:33:27 > C0 st1 SUSPENDED 2019-12-20 15:33:30 [286.977749 TCPC p0 suspended!] 2019-12-20 15:34:14 C0 st2 SNK_DISCONNECTED 2019-12-20 15:34:14 [330.333053 Resetting TCPCs...] 2019-12-20 15:34:14 [330.382545 C0 FAULT 0x00 detected] 2019-12-20 15:34:14 [330.383235 C0 FAULT 0x00 handled] 2019-12-20 15:34:14 [330.387583 TCPC p0 resumed!] Without this CL, an error was reported and the TCPC chip still in suspend. 2019-12-20 14:57:52 C0 st2 SNK_DISCONNECTED 2019-12-20 14:57:52 [546.264649 TCPC p0 restart failed!] Change-Id: I6cee0b7a6d24b9b6ab40f5259a659ca234319990 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1979611 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
-rw-r--r--board/trogdor/board.c9
-rw-r--r--board/trogdor/board.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/board/trogdor/board.c b/board/trogdor/board.c
index c9367cca9c..5e966c75cf 100644
--- a/board/trogdor/board.c
+++ b/board/trogdor/board.c
@@ -381,6 +381,15 @@ void board_reset_pd_mcu(void)
msleep(PS8805_FW_INIT_DELAY_MS);
}
+void board_set_tcpc_power_mode(int port, int mode)
+{
+ /* Ignore the "mode" to turn the chip on. We can only do a reset. */
+ if (mode)
+ return;
+
+ board_reset_pd_mcu();
+}
+
int board_vbus_sink_enable(int port, int enable)
{
/* Both ports are controlled by PPC SN5S330 */
diff --git a/board/trogdor/board.h b/board/trogdor/board.h
index 915375d719..f44e08aaca 100644
--- a/board/trogdor/board.h
+++ b/board/trogdor/board.h
@@ -102,7 +102,6 @@
/*
* TODO(b/145723652): Add back the following CONFIG's after we enable
* the PD software sync to update the PS8805 firmware.
- *
* #define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
* #define CONFIG_USB_PD_TCPC_LOW_POWER
*/
@@ -236,6 +235,7 @@ int board_is_sourcing_vbus(int port);
int board_vbus_sink_enable(int port, int enable);
/* Reset all TCPCs. */
void board_reset_pd_mcu(void);
+void board_set_tcpc_power_mode(int port, int mode);
#endif /* !defined(__ASSEMBLER__) */