summaryrefslogtreecommitdiff
path: root/include/usb_tc_sm.h
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2019-11-07 17:55:55 -0800
committerCommit Bot <commit-bot@chromium.org>2019-11-21 23:41:16 +0000
commit2e2dcb986bfe952cd9a87bf2cd3498fafde6e805 (patch)
tree2d63c1ceb0ab7bad0f2e414b73243307dff87676 /include/usb_tc_sm.h
parent154f597b8656fbcc16f6652f6fe8713943440939 (diff)
downloadchrome-ec-2e2dcb986bfe952cd9a87bf2cd3498fafde6e805.tar.gz
TCPMv2: Enable TCPC low power when port is looking for a connection
When the port is in a state where it is looking for a connection, to save power, we should put the TCPC in its low power mode and enable auto toggling. Low power mode can happen when DRP auto toggling, acting as a SNK only, or acting as a SRC only. BUG=chromium:1022217 BRANCH=none TEST=make -j buildall manual tests: 1: (S0) Nothing plugged in, port is drp and low power mode 2: (S5/S3/S0ix) Port is SNK only, and low power with nothing plugged in 3: (S3/S0ix) If TypeC sink was previously plugged in, port remains powered 4: (S5/S3/S0ix) TypeC source is recognized 5: (S3->S0) TypeC sink plugged in, port is powered when S0 is reached Low power exit test: Using this command from the AP console: ectool i2cread 8 2 0x16 0x0d Transfer failed with status=0x1 # This means the TCPC was asleep. On the EC console: 2019-11-21 09:50:24 [315.235538 TCPC p1 init ready] 2019-11-21 09:50:24 [315.236048 TCPC p1 Exit Low Power Mode] 2019-11-21 09:50:24 [315.242837 TCPC p1 init ready] 2019-11-21 09:50:24 [315.243229 C1: DRPAutoToggle] 2019-11-21 09:50:24 [315.246471 C1: Unattached.SNK] 2019-11-21 09:50:24 [315.252504 C1: DRPAutoToggle] 2019-11-21 09:50:24 [315.362878 C1: LowPowerMode] 2019-11-21 09:50:24 [315.363314 TCPC p1 Enter Low Power Mode] Change-Id: I7e853d05e0ece1f6b3031f17a18fcbf0d9a15a51 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1904974 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'include/usb_tc_sm.h')
-rw-r--r--include/usb_tc_sm.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/usb_tc_sm.h b/include/usb_tc_sm.h
index f6971b07e3..f94360ad3f 100644
--- a/include/usb_tc_sm.h
+++ b/include/usb_tc_sm.h
@@ -335,6 +335,20 @@ void tc_start_error_recovery(int port);
*/
void tc_hard_reset(int port);
+/**
+ * Start the state machine event loop
+ *
+ * @param port USB-C port number
+ */
+void tc_start_event_loop(int port);
+
+/**
+ * Pauses the state machine event loop
+ *
+ * @param port USB-C port number
+ */
+void tc_pause_event_loop(int port);
+
#ifdef CONFIG_USB_TYPEC_CTVPD
/**